123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmPriceSetting">
- <Client>
- <Events>
- <Load><![CDATA[
- @Title="产品价格设定";
- GetSchema();
- Search("SearchUnit");
- Search("SearchType");
- ChangeMode("Search");
- ]]></Load>
- <EndLoad><![CDATA[
- ikDataGridEx1.ReadOnlyWithCheckbox(true);
- ]]></EndLoad>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search"/>
- </Search>
- </Mode>
- <Controls>
- <IKTextButton name="tbNo">
- <Events>
- <Click>
- @Temp = ShowSearchBox("ProductSearch","INFOMATION",tbNo.CValue);
- if(@Temp != "")
- tbNo.CValue = @Temp;
- </Click>
- </Events>
- </IKTextButton>
-
- <IKComboBoxEx name="cbUnit" />
- <IKComboBoxEx name="cbType" />
- <IKDataGridEx name="ikDataGridEx1" DataSource="Product" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Product.No_Product"/>
- <DataColumn Index="1" DataSource="Product.Name_Product"/>
- <DataColumn Index="2" DataSource="Product.Type_Product"/>
- <DataColumn Index="3" DataSource="Product.Unit_Product"/>
- <DataColumn Index="4" DataSource="Product.Price_Product"/>
- <DataColumn Index="5" DataSource="Product.LowSalePrice_Product"/>
- <DataColumn Index="6" DataSource="Product.Comment_Product"/>
- </IKDataGridEx>
- <IKButton name="btnSearch">
- <Events>
- <Click>
- Empty();
- @No_Product=DBNull();
- @Name_Product=DBNull();
- if(tbNo.CValue!="")
- @No_Product=tbNo.CValue;
- if(txtName.CValue!="")
- @Name_Product=txtName.CValue;
- @Unit_Product=cbUnit.Text;
- @Type_Product=cbType.Text;
- Search("SearchProducts",@No_Product,@Name_Product,@Unit_Product,@Type_Product);
- if(RowCount("#Product")>0)
- {
- btnClear.Enabled=true;
- btnOK.Enabled=true;
- }
- else
- {
- btnClear.Enabled=false;
- btnOK.Enabled=false;
- }
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnClear">
- <Events>
- <Click>
- Empty();
- btnClear.Enabled=false;
- btnOK.Enabled=false;
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnOK">
- <Events>
- <Click>
- <!--SuspendLayout();
- for(@i=0;@i < RowCount("#Product");@i++)
- {
- SetPosition("#Product",@i);
- #Product.Price_Product=txtPrice.CValue;
- #Product.LowSalePrice_Product=txtLowSalePrice.CValue;
- }
- ResumeLayout();-->
- ikDataGridEx1.SetDefaultSelectedColoumn("Price_Product",txtPrice.CValue, false);
- ikDataGridEx1.SetDefaultSelectedColoumn("LowSalePrice_Product",txtLowSalePrice.CValue,false);
- Update();
- </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="Product" Type="Parent">
- <GetSchema CmdType="Text" CmdText="
- SELECT TOP 0 * From Product
- "/>
- <Update CmdType="Text" CmdText=" UPDATE Product
- SET Price_Product = @Price_Product,
- LowSalePrice_Product = @LowSalePrice_Product
- WHERE ID_Product = @ID_Product">
- <Params>
- <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
- <Param name="@Price_Product" type="Product.Price_Product" sourceColumn="Price_Product" />
- <Param name="@LowSalePrice_Product" type="Product.LowSalePrice_Product" sourceColumn="LowSalePrice_Product" />
- </Params>
- </Update>
- </Table>
- </Tables>
- <Search>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
- <SearchProducts CmdType="Text" CmdText="
- declare @sqlCmd nvarchar(4000)
- set @sqlCmd=N'Select * From Product Where 1=1 '
- if(@No_Product Is Not Null)
- set @sqlCmd=@sqlCmd+N' And No_Product='+nchar(39)+@No_Product+nchar(39)
- if(@Name_Product Is Not Null)
- set @sqlCmd=@sqlCmd+N' And Name_Product='+nchar(39)+@Name_Product+nchar(39)
- if(@Unit_Product!='全部')
- set @sqlCmd=@sqlCmd+N' And Unit_Product='+nchar(39)+@Unit_Product+nchar(39)
- if(@Type_Product!='全部')
- set @sqlCmd=@sqlCmd+N' And Type_Product='+nchar(39)+@Type_Product+nchar(39)
- execute sp_executesql @sqlCmd
- ">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0"/>
- <Param name="@Name_Product" type="Product.Name_Product" Index="1"/>
- <Param name="@Unit_Product" type="Product.Unit_Product" Index="2"/>
- <Param name="@Type_Product" type="Product.Type_Product" Index="3"/>
- </Params>
- <Tables>
- <Table name="Product" />
- </Tables>
- </SearchProducts>
- <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef From TypeDef Where Type_TypeDef=8 Order By Name_TypeDef ">
- <Tables>
- <Table name="Type"/>
- </Tables>
- </SearchType>
- <SearchUnit CmdType="Text" CmdText=" SELECT Name_TypeDef From TypeDef Where Type_TypeDef=7 Order By Name_TypeDef ">
- <Tables>
- <Table name="Unit"/>
- </Tables>
- </SearchUnit>
- </Search>
- </Server>
- <Lables>
- <Search>
- SuspendLayout();
- cbType.Items.Add("全部");
- cbUnit.Items.Add("全部");
-
- for(@i=0;@i<RowCount("#Type");@i++)
- {
- SetPosition("#Type",@i);
- cbType.Items.Add(#Type.Name_TypeDef);
- }
- for(@i=0;@i<RowCount("#Unit");@i++)
- {
- SetPosition("#Unit",@i);
- cbUnit.Items.Add(#Unit.Name_TypeDef);
- }
- cbType.Text="全部";
- cbUnit.Text="全部";
- btnClear.Enabled=false;
- btnOK.Enabled=false;
- ResumeLayout();
- </Search>
- </Lables>
- </Form>
- </Forms>
-
-
-
|