1 Select[ID]2 , [Stockapplycode]3 , [Rccode]4 , [Labcentercode]5 , [Labgroupcode]6 , [Labgroupname]7 , [Barcode]8 , [Testsubitemcode]9 , [Testsubitemname]Ten , [CreateDate] One , [Calcrule] A , [Bomtype] - , [Bomconsume] - , [singleconsumepredict] the , [Singleconsume] - , [begindate] - , [EndDate] - , [Costprice] + Into #tempRCUDCalc - fromFinancial.reagentconsumablesusedetailcalc + whereStockapplycode =@StockApplyCode A atDECLARE @TotalRowCount INT--total number of rows -SET @TotalRowCount = (SelectCOUNT (1) from #tempRCUDCalc) - -DECLARE @tempint - Set@[email protected]* (@PageIndex-1) - SelectTop (Select@PageSize) in [ID] - , [Stockapplycode] to , [Rccode] + , [Labcentercode] - , [Labgroupcode] the , [Labgroupname] * , [Barcode] $ , [Testsubitemcode]Panax Notoginseng , [Testsubitemname] - , [CreateDate] the , [Calcrule] + , [Bomtype] A , [Bomconsume] the , [singleconsumepredict] + , [Singleconsume] - , [begindate] $ , [EndDate] $ , [Costprice] ---, @TotalRowCount totalrowcount - from#tempRCUDCalc A the whereNot EXISTS ( -SELECT1 from(SelectTop (Select@temp) ID from#tempRCUDCalc ORDER by ID) Bwherea.ID =b.idWuyi ) the ORDER BY ID - Wu--Results Total Rows - SelectCOUNT (1) Totalrowcount from #tempRCUDCalc
Public voidLoadreagentconsumablesuseapplyedit (stringStrapplycode,intPageIndex,intPageSize, out intCounttotal, out intAllrowscount) {Counttotal= +; Allrowscount=0; Try { if(PageIndex <=0) PageIndex=1; if(PageSize <=0) PageSize= +; Byte[] Isdata= serviceexecutemethod.executemethod<ifinancial>(Config.readvaluebykey (commonstring.ifinancialurl),"Loadreagentconsumablesuseapplyeditbypage",New Object[] {strapplycode, PageIndex, pageSize}, Config.readvaluebykey (commonstring.ifinancialbinding)) asbyte[]; if(PageIndex = =1) {_reagentconsumablesuse= Dataziphelp.retrievedatasetdecompress (Isdata) asDsreagentconsumablesuse; Counttotal=_reagentconsumablesuse.reagentconsumablesusedetailcalc.count; if(Counttotal >0) Allrowscount=int. Parse (_reagentconsumablesuse.tables["Tableinfo"]. rows[0]["Totalrowcount"]. ToString ()); } Else{dsreagentconsumablesuse dstemp= Dataziphelp.retrievedatasetdecompress (Isdata) asDsreagentconsumablesuse; if(_reagentconsumablesuse = =NULL)return; Counttotal=DsTemp.ReagentConsumablesUseDetailCalc.Count; if(Counttotal >0) Allrowscount=int. Parse (_reagentconsumablesuse.tables["Tableinfo"]. rows[0]["Totalrowcount"]. ToString ()); _reagentconsumablesuse.reagentconsumablesusedetailcalc.merge (DSTEMP.REAGENTCONSUMABLESUSEDETAILCALC); _reagentconsumablesuse.acceptchanges (); } } Catch(Exception ex) {Throwex; } } Private voidRefreshreagentconsumablesusedetailcalcdata () {Try { //Popup Prompt Screen NewThread ((ThreadStart)Delegate{waitingdatarefreshing=NewDevExpress.Utils.WaitDialogForm ("Please wait ...","Loading Data",NewSize ( -, +)); Application.Run (waitingdatarefreshing); }). Start (); _biz.loadreagentconsumablesuseapplyedit (Stockapplycode,++pageindex, PageSize, outCounttotal, outallrowscount); //Tempds = Commonbiz.splitdataset (_biz.reagentconsumablesuse, Tempds, "Reagentconsumablesusedetailcalc", + + PageIndex, PageSize, out Counttotal, out allrowscount); //Application Details-apportionment_bsreagentconsumablesusedetailcalc.datasource =_biz.reagentconsumablesuse; _bsreagentconsumablesusedetailcalc.datamember="Reagentconsumablesusedetailcalc"; GrdcReagentConsumablesUseDetailCalc.EmbeddedNavigator.TextStringFormat=@"Record {0} of"+allrowscount.tostring (); Grdvreagentconsumablesusedetailcalc.bestfitcolumns (); //waitdialogform.close ();Waitingdatarefreshing.invoke ((EventHandler)Delegate{waitingdatarefreshing.close ();}); } Catch(Exception ex) {xtramessagebox.show ("Data load failed! Error message ["+ ex. Message +"]"); } } Private voidGrdvreagentconsumablesusedetailcalc_toprowchanged (Objectsender, EventArgs e) { Try { if(Grdvreagentconsumablesusedetailcalc.isrowvisible (Grdvreagentconsumablesusedetailcalc.rowcount-1) ==rowvisiblestate.visible) {grdvreagentconsumablesusedetailcalc.toprowchanged-=grdvreagentconsumablesusedetailcalc_toprowchanged; if(Counttotal = = PageSize && allrowscount >counttotal) {Refreshreagentconsumablesusedetailcalcdata (); Grdvreagentconsumablesusedetailcalc.toprowchanged+=grdvreagentconsumablesusedetailcalc_toprowchanged; } } } Catch(Exception ex) {Xtramessagebox.show (ex). Message); } }
Using Code
The SQL Server data is displayed in pagination.