FrmPriceSetting.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmPriceSetting">
  4. <Client>
  5. <Events>
  6. <Load><![CDATA[
  7. @Title="产品价格设定";
  8. GetSchema();
  9. Search("SearchUnit");
  10. Search("SearchType");
  11. ChangeMode("Search");
  12. ]]></Load>
  13. <EndLoad><![CDATA[
  14. ikDataGridEx1.ReadOnlyWithCheckbox(true);
  15. ]]></EndLoad>
  16. <Closing>
  17. ;
  18. </Closing>
  19. <Closed>
  20. ;
  21. </Closed>
  22. </Events>
  23. <Mode>
  24. <Search>
  25. <Lable name="Search"/>
  26. </Search>
  27. </Mode>
  28. <Controls>
  29. <IKTextButton name="tbNo">
  30. <Events>
  31. <Click>
  32. @Temp = ShowSearchBox("ProductSearch","INFOMATION",tbNo.CValue);
  33. if(@Temp != "")
  34. tbNo.CValue = @Temp;
  35. </Click>
  36. </Events>
  37. </IKTextButton>
  38. <IKComboBoxEx name="cbUnit" />
  39. <IKComboBoxEx name="cbType" />
  40. <IKDataGridEx name="ikDataGridEx1" DataSource="Product" TableStyleIndex="0">
  41. <DataColumn Index="0" DataSource="Product.No_Product"/>
  42. <DataColumn Index="1" DataSource="Product.Name_Product"/>
  43. <DataColumn Index="2" DataSource="Product.Type_Product"/>
  44. <DataColumn Index="3" DataSource="Product.Unit_Product"/>
  45. <DataColumn Index="4" DataSource="Product.Price_Product"/>
  46. <DataColumn Index="5" DataSource="Product.LowSalePrice_Product"/>
  47. <DataColumn Index="6" DataSource="Product.Comment_Product"/>
  48. </IKDataGridEx>
  49. <IKButton name="btnSearch">
  50. <Events>
  51. <Click>
  52. Empty();
  53. @No_Product=DBNull();
  54. @Name_Product=DBNull();
  55. if(tbNo.CValue!="")
  56. @No_Product=tbNo.CValue;
  57. if(txtName.CValue!="")
  58. @Name_Product=txtName.CValue;
  59. @Unit_Product=cbUnit.Text;
  60. @Type_Product=cbType.Text;
  61. Search("SearchProducts",@No_Product,@Name_Product,@Unit_Product,@Type_Product);
  62. if(RowCount("#Product")&gt;0)
  63. {
  64. btnClear.Enabled=true;
  65. btnOK.Enabled=true;
  66. }
  67. else
  68. {
  69. btnClear.Enabled=false;
  70. btnOK.Enabled=false;
  71. }
  72. </Click>
  73. </Events>
  74. </IKButton>
  75. <IKButton name="btnClear">
  76. <Events>
  77. <Click>
  78. Empty();
  79. btnClear.Enabled=false;
  80. btnOK.Enabled=false;
  81. </Click>
  82. </Events>
  83. </IKButton>
  84. <IKButton name="btnOK">
  85. <Events>
  86. <Click>
  87. <!--SuspendLayout();
  88. for(@i=0;@i &lt; RowCount("#Product");@i++)
  89. {
  90. SetPosition("#Product",@i);
  91. #Product.Price_Product=txtPrice.CValue;
  92. #Product.LowSalePrice_Product=txtLowSalePrice.CValue;
  93. }
  94. ResumeLayout();-->
  95. ikDataGridEx1.SetDefaultSelectedColoumn("Price_Product",txtPrice.CValue, false);
  96. ikDataGridEx1.SetDefaultSelectedColoumn("LowSalePrice_Product",txtLowSalePrice.CValue,false);
  97. Update();
  98. </Click>
  99. </Events>
  100. </IKButton>
  101. </Controls>
  102. <ChildForms>
  103. <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="基本资料">
  104. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="基本资料编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  105. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="基本资料名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  106. </ChildForm>
  107. </ChildForms>
  108. </Client>
  109. <Server>
  110. <Tables>
  111. <Table name="Product" Type="Parent">
  112. <GetSchema CmdType="Text" CmdText="
  113. SELECT TOP 0 * From Product
  114. "/>
  115. <Update CmdType="Text" CmdText=" UPDATE Product
  116. SET Price_Product = @Price_Product,
  117. LowSalePrice_Product = @LowSalePrice_Product
  118. WHERE ID_Product = @ID_Product">
  119. <Params>
  120. <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
  121. <Param name="@Price_Product" type="Product.Price_Product" sourceColumn="Price_Product" />
  122. <Param name="@LowSalePrice_Product" type="Product.LowSalePrice_Product" sourceColumn="LowSalePrice_Product" />
  123. </Params>
  124. </Update>
  125. </Table>
  126. </Tables>
  127. <Search>
  128. <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
  129. <Tables>
  130. <Table name="AllProduct" />
  131. </Tables>
  132. </SearchAllProduct>
  133. <SearchProducts CmdType="Text" CmdText="
  134. declare @sqlCmd nvarchar(4000)
  135. set @sqlCmd=N'Select * From Product Where 1=1 '
  136. if(@No_Product Is Not Null)
  137. set @sqlCmd=@sqlCmd+N' And No_Product='+nchar(39)+@No_Product+nchar(39)
  138. if(@Name_Product Is Not Null)
  139. set @sqlCmd=@sqlCmd+N' And Name_Product='+nchar(39)+@Name_Product+nchar(39)
  140. if(@Unit_Product!='全部')
  141. set @sqlCmd=@sqlCmd+N' And Unit_Product='+nchar(39)+@Unit_Product+nchar(39)
  142. if(@Type_Product!='全部')
  143. set @sqlCmd=@sqlCmd+N' And Type_Product='+nchar(39)+@Type_Product+nchar(39)
  144. execute sp_executesql @sqlCmd
  145. ">
  146. <Params>
  147. <Param name="@No_Product" type="Product.No_Product" Index="0"/>
  148. <Param name="@Name_Product" type="Product.Name_Product" Index="1"/>
  149. <Param name="@Unit_Product" type="Product.Unit_Product" Index="2"/>
  150. <Param name="@Type_Product" type="Product.Type_Product" Index="3"/>
  151. </Params>
  152. <Tables>
  153. <Table name="Product" />
  154. </Tables>
  155. </SearchProducts>
  156. <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef From TypeDef Where Type_TypeDef=8 Order By Name_TypeDef ">
  157. <Tables>
  158. <Table name="Type"/>
  159. </Tables>
  160. </SearchType>
  161. <SearchUnit CmdType="Text" CmdText=" SELECT Name_TypeDef From TypeDef Where Type_TypeDef=7 Order By Name_TypeDef ">
  162. <Tables>
  163. <Table name="Unit"/>
  164. </Tables>
  165. </SearchUnit>
  166. </Search>
  167. </Server>
  168. <Lables>
  169. <Search>
  170. SuspendLayout();
  171. cbType.Items.Add("全部");
  172. cbUnit.Items.Add("全部");
  173. for(@i=0;@i&lt;RowCount("#Type");@i++)
  174. {
  175. SetPosition("#Type",@i);
  176. cbType.Items.Add(#Type.Name_TypeDef);
  177. }
  178. for(@i=0;@i&lt;RowCount("#Unit");@i++)
  179. {
  180. SetPosition("#Unit",@i);
  181. cbUnit.Items.Add(#Unit.Name_TypeDef);
  182. }
  183. cbType.Text="全部";
  184. cbUnit.Text="全部";
  185. btnClear.Enabled=false;
  186. btnOK.Enabled=false;
  187. ResumeLayout();
  188. </Search>
  189. </Lables>
  190. </Form>
  191. </Forms>