FrmNoMaintenance.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmNoMaintenance">
  4. <Client>
  5. <Events>
  6. <Load><![CDATA[
  7. @Title="资料编码维护";
  8. GetSchema();
  9. ChangeMode("Search");
  10. ]]></Load>
  11. <Closing>
  12. ;
  13. </Closing>
  14. <Closed>
  15. ;
  16. </Closed>
  17. </Events>
  18. <Mode>
  19. <Search>
  20. <Lable name="Search"/>
  21. </Search>
  22. </Mode>
  23. <Controls>
  24. <IKComboBoxEx name="cbType"/>
  25. <IKDataGridEx name="dgBasicInfo" DataSource="Total" TableStyleIndex="0">
  26. <DataColumn Index="0" DataSource="Total.No"/>
  27. <DataColumn Index="1" DataSource="Total.NoNew"/>
  28. <DataColumn Index="2" DataSource="Total.Name"/>
  29. <DataColumn Index="3" DataSource="Total.CreateDate"/>
  30. <DataColumn Index="4" DataSource="Total.Creator"/>
  31. <DataColumn Index="5" DataSource="Total.SuspendDate"/>
  32. <DataColumn Index="6" DataSource="Total.Comment"/>
  33. </IKDataGridEx>
  34. <IKButton name="btnSearch">
  35. <Events>
  36. <Click>
  37. @str=txtNo.CValue;
  38. @str=Replace(@str,"%","_");
  39. @str=Replace(@str,"*","%");
  40. Search("SearchTotal",@str,cbType.Text);
  41. if(RowCount("#Total")&gt;0)
  42. {
  43. btnClear.Enabled=true;
  44. btnReplace.Enabled=true;
  45. btnOK.Enabled=false;
  46. }
  47. </Click>
  48. </Events>
  49. </IKButton>
  50. <IKButton name="btnClose">
  51. <Events>
  52. <Click>
  53. Close();
  54. </Click>
  55. </Events>
  56. </IKButton>
  57. <IKButton name="btnClear">
  58. <Events>
  59. <Click>
  60. Empty();
  61. txtNo.CValue = "";
  62. txtNewNo.CValue="";
  63. btnClear.Enabled=false;
  64. btnReplace.Enabled=false;
  65. btnOK.Enabled=false;
  66. </Click>
  67. </Events>
  68. </IKButton>
  69. <IKButton name="btnReplace">
  70. <Events>
  71. <Click>
  72. if(txtNewNo.CValue=="")
  73. {
  74. MessageBox("请输入新编码号码!",@Title);
  75. return;
  76. }
  77. if(!IsMatch(txtNo.CValue,txtNewNo.CValue))
  78. {
  79. MessageBox("新编码格式与原编码格式不匹配!",@Title);
  80. return;
  81. }
  82. SuspendLayout();
  83. for(@i=0;@i &lt; RowCount("#Total");@i++)
  84. {
  85. SetPosition("#Total",@i);
  86. #Total.NoNew=ReplaceEx(txtNo.CValue,txtNewNo.CValue,#Total.No);
  87. }
  88. ResumeLayout();
  89. btnOK.Enabled=true;
  90. </Click>
  91. </Events>
  92. </IKButton>
  93. <IKButton name="btnOK">
  94. <Events>
  95. <Click>
  96. Update();
  97. btnReplace.Enabled=false;
  98. btnOK.Enabled=false;
  99. </Click>
  100. </Events>
  101. </IKButton>
  102. </Controls>
  103. </Client>
  104. <Server>
  105. <Tables>
  106. <Table name="Total" Type="Association">
  107. <GetSchema CmdType="Text" CmdText="
  108. SELECT Top 0 newID() As ID,Convert(nvarchar(64),'') As No,Convert(nvarchar(64),'') As NoNew,Convert(nvarchar(64),'') As Name,Convert(datetime,'') As CreateDate,
  109. Convert(nvarchar(64),'') As Creator,Convert(datetime,'') As SuspendDate,Convert(nvarchar(64),'') As Comment,Convert(int,0) As Type
  110. "/>
  111. <Update CmdType="Text" CmdText="
  112. if(@Type=0)
  113. Update Supplier Set No_Supplier=@NoNew Where ID_Supplier=@ID
  114. if(@Type=1)
  115. Update Transporter Set No_Transporter=@NoNew Where ID_Transporter=@ID
  116. if(@Type=2)
  117. Update Customer Set No_Customer=@NoNew Where ID_Customer=@ID
  118. if(@Type=3)
  119. Update Product Set No_Product=@NoNew Where ID_Product=@ID
  120. ">
  121. <Params>
  122. <Param name="@ID" type="Department.ID_Department" sourceColumn="ID" />
  123. <Param name="@NoNew" type="Department.No_Department" sourceColumn="NoNew" />
  124. <Param name="@Type" type="SaleInvoice.Type_SaleInvoice" sourceColumn="Type" />
  125. </Params>
  126. </Update>
  127. <UNIQUEErrorReport ErrorMessage="该编码已经存在!"/>
  128. </Table>
  129. </Tables>
  130. <Search>
  131. <SearchTotal CmdType="Text" CmdText="
  132. if(@Type='供应商')
  133. Select ID_Supplier As ID,No_Supplier As No,Name_Supplier As Name,CreateDate_Supplier As CreateDate,AppUser.Name_User As Creator,SuspendDate_Supplier As SuspendDate,Comment_Supplier As Comment ,Type=0 From Supplier
  134. Left Join AppUser On AppUser.ID_User=Supplier.ID_Creator Where No_Supplier Like @No
  135. else if(@Type='运输商')
  136. Select ID_Transporter As ID,No_Transporter As No,Name_Transporter As Name,CreateDate_Transporter As CreateDate,AppUser.Name_User As Creator,SuspendDate_Transporter As SuspendDate,Comment_Transporter As Comment,Type=1 From Transporter
  137. Left Join AppUser On AppUser.ID_User=Transporter.Creator_Transporter Where No_Transporter Like @No
  138. else if(@Type='客户')
  139. Select ID_Customer As ID,No_Customer As No,Name_Customer As Name,CreateDate_Customer As CreateDate,AppUser.Name_User As Creator,SuspendDate_Customer As SuspendDate,Comment_Customer As Comment,Type=2 From Customer
  140. Left Join AppUser On AppUser.ID_User=Customer.ID_Creator Where No_Customer Like @No
  141. else if(@Type='产品')
  142. Select ID_Product As ID,No_Product As No,Name_Product As Name,CreateDate_Product As CreateDate,AppUser.Name_User As Creator,SuspendDate_Product As SuspendDate,Comment_Product As Comment,Type=3 From Product
  143. Left Join AppUser On AppUser.ID_User=Product.ID_Creator Where No_Product Like @No
  144. ">
  145. <Params>
  146. <Param name="@No" type="Product.No_Product" Index="0"/>
  147. <Param name="@Type" type="Product.Name_Product" Index="1"/>
  148. </Params>
  149. <Tables>
  150. <Table name="Total" />
  151. </Tables>
  152. </SearchTotal>
  153. </Search>
  154. </Server>
  155. <Lables>
  156. <Search>
  157. cbType.Text="供应商";
  158. btnClear.Enabled=false;
  159. btnReplace.Enabled=false;
  160. btnOK.Enabled=false;
  161. </Search>
  162. </Lables>
  163. </Form>
  164. </Forms>