123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <?xml version="1.0" encoding="UTF-8"?>
- <Forms>
- <Form Name="FrmInventoryCheck">
- <Client>
- <Events>
- <Load><![CDATA[
- @Title="盘点查询";
- GetSchema();
- Search("SearchLocation");
- Search("SearchType");
- ChangeMode("Search");
- ]]></Load>
- <EndLoad>
- for(@i=0;@i < CLB_Location.GetItemsCount();@i++)
- CLB_Location.SetItemChecked(@i,true);
-
- </EndLoad>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search"/>
- </Search>
- </Mode>
- <Controls>
- <IKCheckedListBoxEx name="CLB_Location" DataSource="Location" DisplayMember="Name_location" ValueMember="ID_Location">
- <Events>
- <ItemCheck>
- if(CLB_Location.SelectedIndex == 0)
- CLB_Location.SelectAllItems();
- </ItemCheck>
- </Events>
- </IKCheckedListBoxEx>
- <IKTextButton name="tbProduct1">
- <Events>
- <Click>
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct1.CValue);
- if( @temp == "" )
- return;
- tbProduct1.CValue = @temp;
- </Click>
- <TextBoxButtonTextChanged>
- tbProduct2.CValue = tbProduct1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbProduct2">
- <Events>
- <Click>
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct2.CValue);
- if( @temp == "" )
- return;
- tbProduct2.CValue = @temp;
- </Click>
- </Events>
- </IKTextButton>
-
- <IKComboBoxEx name="cbTypeFrom" DataSource="Type" DisplayMember="Name_TypeDef" >
- <Events>
- <TextChanged>
- cbTypeTo.Text = cbTypeFrom.Text;
- </TextChanged>
- </Events>
- </IKComboBoxEx>
-
- <IKComboBoxEx name="cbTypeTo" DataSource="Type" DisplayMember="Name_TypeDef" />
-
- <IKDateTimePicker name = "dtStart">
- <Events>
- <CheckedChanged>
- dtEnd.Checked = dtStart.Checked;
- </CheckedChanged>
- <ValueChanged>
- dtEnd.CValue = dtStart.CValue;
- </ValueChanged>
- </Events>
-
- </IKDateTimePicker>
-
- <IKExtendGrid name="dgProduct" DataSource="FrmInventoryCheck" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="FrmInventoryCheck.No_Product"/>
- <DataColumn Index="1" DataSource="FrmInventoryCheck.Name_Product"/>
- <DataColumn Index="2" DataSource="FrmInventoryCheck.No_StocktakingBill"/>
- <DataColumn Index="3" DataSource="FrmInventoryCheck.Date_StocktakingBill"/>
- <DataColumn Index="4" DataSource="FrmInventoryCheck.StockQty_StocktakingBillProduct"/>
- <DataColumn Index="5" DataSource="FrmInventoryCheck.Quantity_StocktakingBillProduct"/>
- <DataColumn Index="6" DataSource="FrmInventoryCheck.Quantity_Difference"/>
- <DataColumn Index="7" DataSource="FrmInventoryCheck.Comment_StocktakingBillProduct"/>
- <Events>
- <ClickPreview>
- PrintReport(dgProduct.CurrentView,"FrmInventoryCheck","FrmInventoryCheck");
- </ClickPreview>
- <ClickFilter>
- ;
- </ClickFilter>
- <ClickNOFilter>
- ;
- </ClickNOFilter>
- <ClickRefresh>
- Empty();
- <Lable name="btnActionClick"/>
- </ClickRefresh>
- </Events>
- </IKExtendGrid>
- <IKButton name="btnSearch">
- <Events>
- <Click>
- <Lable name="btnActionClick"/>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnEmpty">
- <Events>
- <Click>
- Empty();
- tbProduct1.CValue="";
- tbProduct2.CValue="";
- cbTypeFrom.Text="";
- cbTypeTo.Text="";
- dtStart.Checked=False;
- dtEnd.Checked=False;
- </Click>
- </Events>
- </IKButton>
- </Controls>
- <ChildForms>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo=""
- MappingName="产品">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn" />
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="FrmInventoryCheck" Type="Child">
- <GetSchema CmdType="Text" CmdText="
- Select Top 0 No_StocktakingBill,Date_StocktakingBill,No_Product,Name_Product,Type_Product,B.Name_Location,StockQty_StocktakingBillProduct,Quantity_StocktakingBillProduct,(StockQty_StocktakingBillProduct-Quantity_StocktakingBillProduct) As Quantity_Difference,Comment_StocktakingBillProduct
- From StocktakingBill
- Join StocktakingBillProduct On StocktakingBill.ID_StocktakingBill=StocktakingBillProduct.ID_StocktakingBill
- Join Product ON Product.ID_Product=StocktakingBillProduct.ID_Product
- Join Location A On A.ID_Location=StocktakingBill.ID_Location
- Join Location B On B.ID_Location=StocktakingBillProduct.ID_Location
- "/>
-
- </Table>
- </Tables>
- <Search>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
- <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef From TypeDef Where Type_TypeDef=8 Order By Name_TypeDef ">
- <Tables>
- <Table name="Type"/>
- </Tables>
- </SearchType>
- <SearchLocation CmdType="Text" CmdText="Select Name_Location,ID_Location from Location where Level_Location = 0">
- <Tables>
- <Table name="Location"/>
- </Tables>
- </SearchLocation>
- <SearchInventoryCheck CmdType="Text" CmdText="
- declare @sqlCmd nvarchar(2000)
- set @sqlCmd=N'Select No_StocktakingBill,Date_StocktakingBill,No_Product,Name_Product,Type_Product,B.Name_Location,StockQty_StocktakingBillProduct,Quantity_StocktakingBillProduct,(Quantity_StocktakingBillProduct-StockQty_StocktakingBillProduct) As Quantity_Difference,Comment_StocktakingBillProduct
- From StocktakingBill
- Join StocktakingBillProduct On StocktakingBill.ID_StocktakingBill=StocktakingBillProduct.ID_StocktakingBill
- Join Product ON Product.ID_Product=StocktakingBillProduct.ID_Product
- Join Location A On A.ID_Location=StocktakingBill.ID_Location
- Join Location B On B.ID_Location=StocktakingBillProduct.ID_Location
- Where StocktakingBill.ID_Assessor Is Not Null And A.Name_Location IN '+@SqlLocation
- If(@StartDate_StocktakingBill Is Not Null)
- set @sqlCmd=@sqlCmd+N' And DateDiff(day,'+nchar(39)+convert(nvarchar(64),@StartDate_StocktakingBill)+nchar(39)+N', StocktakingBill.Date_StocktakingBill) >= 0 '
- if(@EndDate_StocktakingBill Is Not Null)
- set @sqlCmd=@sqlCmd+N' And DateDiff(day,'+nchar(39)+convert(nvarchar(64),@EndDate_StocktakingBill)+nchar(39)+N', StocktakingBill.Date_StocktakingBill) <= 0 '
- if(@StartNo_Product Is Not Null)
- set @sqlCmd=@sqlCmd+N' And No_Product >= '+nchar(39)+@StartNo_Product+nchar(39)
- if(@EndNo_Product Is Not Null)
- set @sqlCmd=@sqlCmd+N' And No_Product <= '+nchar(39)+@EndNo_Product+nchar(39)
- if(@StartType_Product Is Not Null)
- set @sqlCmd=@sqlCmd+N' And Type_Product >= '+nchar(39)+@StartType_Product+nchar(39)
- if(@EndType_Product Is Not Null)
- set @sqlCmd=@sqlCmd+N' And Type_Product <= '+nchar(39)+@EndType_Product+nchar(39)
- set @sqlCmd=@sqlCmd+N' Order By No_Product'
- --print @sqlCmd
- --print @SqlLocation
- execute sp_executesql @sqlCmd
- ">
- <Params>
- <Param name="@StartNo_Product" type="Product.No_Product" Index="0" />
- <Param name="@EndNo_Product" type="Product.No_Product" Index="1" />
- <Param name="@StartType_Product" type="Product.No_Product" Index="2" />
- <Param name="@EndType_Product" type="Product.No_Product" Index="3" />
- <Param name="@StartDate_StocktakingBill" type="StocktakingBill.Date_StocktakingBill" Index="4" />
- <Param name="@EndDate_StocktakingBill" type="StocktakingBill.Date_StocktakingBill" Index="5" />
- <Param name="@SqlLocation" type="PurchaseInDepotBill.Comment_PurchaseInDepotBill" Index="6" />
- </Params>
- <Tables>
- <Table name="FrmInventoryCheck" />
- </Tables>
- </SearchInventoryCheck>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
-
- NewInstance();
- </Search>
- <btnActionClick>
- @sqlLocation="(";
- @empty=true;
- @first=true;
- for(@i=1;@i < CLB_Location.GetItemsCount();@i++){
- if(CLB_Location.GetItemChecked(@i)){
- @empty=false;
- if(@first==true){
- @sqlLocation=@sqlLocation+"'"+CLB_Location.GetSelectedName(@i)+"'";
- @first=false;
- }else{
- @sqlLocation=@sqlLocation+","+"'"+CLB_Location.GetSelectedName(@i)+"'";
- }
- }
- }
- @sqlLocation=@sqlLocation+") ";
- if(@empty==true)
- {
- MessageBox("请选择仓库!",@Title);
- return;
- }
- @StartNo_Product=DBNull();
- @EndNo_Product=DBNull();
- @StartType_Product=DBNull();
- @EndType_Product=DBNull();
- @StartDate_StocktakingBill=DBNull();
- @EndDate_StocktakingBill=DBNull();
-
- if(tbProduct1.CValue!="")
- @StartNo_Product=tbProduct1.CValue;
- if(tbProduct2.CValue!="")
- @EndNo_Product=tbProduct2.CValue;
- if(cbTypeFrom.Text!="")
- @StartType_Product=cbTypeFrom.Text;
- if(cbTypeTo.Text!="")
- @EndType_Product=cbTypeTo.Text;
- if(dtStart.Checked)
- @StartDate_StocktakingBill=dtStart.Value;
- if(dtEnd.Checked)
- @EndDate_StocktakingBill=dtEnd.Value;
- Search("SearchInventoryCheck",@StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,@StartDate_StocktakingBill,@EndDate_StocktakingBill,@sqlLocation);
- </btnActionClick>
- </Lables>
- </Form>
- </Forms>
-
-
-
|