FrmCustomerReqInfo.xml 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmCustomerReqInfo">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="客户需求商品";
  9. GetSchema();
  10. ChangeMode("Search");
  11. dgProduct.NoMember="No_CustomerReq";
  12. Search("SearchUnit");
  13. Search("SearchType");
  14. Search("SearchProperty");
  15. Search("SearchManuMethod");
  16. Search("SearchMaterial");
  17. Search("SearchProcess");
  18. Search("SearchContinuity");
  19. Search("SearchOil");
  20. ]]>
  21. </Load>
  22. <Closing>
  23. ;
  24. </Closing>
  25. <Closed>
  26. ;
  27. </Closed>
  28. </Events>
  29. <Mode>
  30. <Search>
  31. <Lable name="Search" />
  32. </Search>
  33. <New>
  34. <Lable name="New" />
  35. </New>
  36. <View>
  37. <Lable name="View" />
  38. </View>
  39. <Modify>
  40. <Lable name="Modify" />
  41. </Modify>
  42. </Mode>
  43. <Controls>
  44. <IKDateTimePicker name="timeMake" DataSource="CustomerReqInfo.CreateDate_CustomerReqInfo" />
  45. <IKTextButton name="cbCreateNo" DataSource="CustomerReqInfo.No_CustomerReqInfo">
  46. <Events>
  47. <Enter>
  48. <![CDATA[
  49. if(cbCreateNo.ReadOnly == false)
  50. {
  51. if(cbCreateNo.CValue != StringEmpty())
  52. {
  53. UpdateForm(false, "");
  54. if(Search("SearchCustomerReqInfoWithNo", cbCreateNo.CValue))
  55. {
  56. if(!GetRight("客户基本资料","全权查看"))
  57. {
  58. if(!Equals(#CustomerReqInfo.CustomerID_Creator,GetLoginUserID()))
  59. {
  60. @EnterNo=cbCreateNo.CValue;
  61. ChangeMode("Search");
  62. cbCreateNo.CValue=@EnterNo;
  63. MessageBox("您没有查看此客户需求商品的权限!",@Title);
  64. return;
  65. }
  66. }
  67. ChangeMode("View");
  68. }
  69. else
  70. {
  71. MessageBox("该档案不存在!",@Title);
  72. }
  73. }
  74. else
  75. {
  76. MessageBox("请输入建档编号!",@Title);
  77. }
  78. }
  79. ]]>
  80. </Enter>
  81. <Click>
  82. ShowSearchBox("BillSearch","NODEPOT", "cbCreateNo",cbCreateNo.CValue);
  83. </Click>
  84. </Events>
  85. </IKTextButton>
  86. <IKTextButton name="tbNo" DataSource="CustomerReqInfo.No_Customer">
  87. <Events>
  88. <Enter>
  89. <![CDATA[
  90. UpdateForm(false,"");
  91. if(tbNo.CValue != StringEmpty())
  92. {
  93. if(!Search("SearchCustomer",tbNo.CValue))
  94. {
  95. MessageBox("该客户不存在!",@Title);
  96. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbNo.CValue);
  97. if(@temp!= "")
  98. {
  99. tbNo.CValue = @temp;
  100. ActiveControlEvent("tbNo", "Enter");
  101. }
  102. }
  103. else
  104. {
  105. if (!Equals(#Customer.SuspendDate_Customer,DBNull()))
  106. {
  107. MessageBox("该客户已停用!",@Title);
  108. }
  109. #CustomerReqInfo.ID_Customer = #Customer.ID_Customer;
  110. #CustomerReqInfo.No_Customer = #Customer.No_Customer;
  111. #CustomerReqInfo.ShortName_Customer = #Customer.ShortName_Customer;
  112. #CustomerReqInfo.Type_Customer = #Customer.Type_Customer;
  113. #CustomerReqInfo.Name_Customer = #Customer.Name_Customer;
  114. #CustomerReqInfo.PostalCode_Customer = #Customer.PostalCode_Customer;
  115. #CustomerReqInfo.Linkman_CustomerReqInfo = "";
  116. #CustomerReqInfo.Telephone_CustomerReqInfo = "";
  117. #CustomerReqInfo.Fax_CustomerReqInfo = "";
  118. #CustomerReqInfo.SendAddr_CustomerReqInfo = #Customer.SendAddr_Customer;
  119. }
  120. }
  121. else
  122. {
  123. MessageBox("请输入客户编号!",@Title);
  124. #CustomerReqInfo.ID_Customer = GuidEmpty();
  125. #CustomerReqInfo.No_Customer = "";
  126. #CustomerReqInfo.ShortName_Customer = "";
  127. #CustomerReqInfo.Type_Customer = "";
  128. #CustomerReqInfo.Name_Customer = "";
  129. #CustomerReqInfo.PostalCode_Customer = "";
  130. #CustomerReqInfo.Linkman_CustomerReqInfo = "";
  131. #CustomerReqInfo.Telephone_CustomerReqInfo = "";
  132. #CustomerReqInfo.Fax_CustomerReqInfo = "";
  133. #CustomerReqInfo.SendAddr_CustomerReqInfo ="";
  134. }
  135. UpdateForm(true,"");
  136. ]]>
  137. </Enter>
  138. <Click>
  139. <![CDATA[
  140. if (tbNo.ReadOnly == false)
  141. {
  142. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbNo.CValue);
  143. if( @temp == "" )
  144. return;
  145. tbNo.CValue = @temp;
  146. ActiveControlEvent("tbNo", "Enter");
  147. }
  148. ]]>
  149. </Click>
  150. </Events>
  151. </IKTextButton>
  152. <IKTextBox name="txtShortName" DataSource="CustomerReqInfo.ShortName_Customer" />
  153. <IKTextBox name="txtType" DataSource="CustomerReqInfo.Type_Customer" />
  154. <IKTextBox name="txtName" DataSource="CustomerReqInfo.Name_Customer" />
  155. <IKTextBox name="txtPostalCode" DataSource="CustomerReqInfo.PostalCode_Customer" />
  156. <IKTextBox name="txtCreator" DataSource="CustomerReqInfo.Name_User" />
  157. <IKComboBoxEx name="cbName" DisplaySource="CustomerReqInfo.Linkman_CustomerReqInfo" ValueSource="CustomerReqInfo.ID_Linkman"
  158. DataSource="Linkman" DisplayMember="Name_Linkman" ValueMember="ID_Linkman">
  159. <Events>
  160. <Reload>
  161. UpdateForm(false, "cbName");
  162. Search("SearchLinkman",tbNo.CValue);
  163. UpdateForm(true, "cbName");
  164. </Reload>
  165. </Events>
  166. </IKComboBoxEx>
  167. <IKComboBoxEx name="cbTelephone" DisplaySource="CustomerReqInfo.Telephone_CustomerReqInfo" ValueSource="CustomerReqInfo.ID_Telephone"
  168. DataSource="Telephone" DisplayMember="No_Telephone" ValueMember="ID_Telephone">
  169. <Events>
  170. <Reload>
  171. UpdateForm(false, "cbTelephone");
  172. Search("SearchTelephone",tbNo.CValue);
  173. UpdateForm(true, "cbTelephone");
  174. </Reload>
  175. </Events>
  176. </IKComboBoxEx>
  177. <IKComboBoxEx name="cbFax" DisplaySource="CustomerReqInfo.Fax_CustomerReqInfo" ValueSource="CustomerReqInfo.ID_Fax"
  178. DataSource="Fax" DisplayMember="No_Fax" ValueMember="ID_Fax">
  179. <Events>
  180. <Reload>
  181. UpdateForm(false, "cbFax");
  182. Search("SearchFax",tbNo.CValue);
  183. UpdateForm(true, "cbFax");
  184. </Reload>
  185. </Events>
  186. </IKComboBoxEx>
  187. <IKTextBox name="txtSendAddr" DataSource="CustomerReqInfo.SendAddr_CustomerReqInfo" />
  188. <IKTextBox name="txtComment" DataSource="CustomerReqInfo.Comment_CustomerReqInfo" />
  189. <IKDataGridEx name="dgProduct" DataSource="CustomerReqProduct" TableStyleIndex="0">
  190. <DataColumn Index="0" DataSource="CustomerReqProduct.No_CustomerReq"/>
  191. <DataColumn Index="1" DataSource="CustomerReqProduct.No_CustomerReqProduct">
  192. <IKDataGridTextButtonColumn>
  193. <Events>
  194. <Click>
  195. ShowSearchBox("ProductSearch","INFOMATION",#CustomerReqProduct.No_CustomerReqProduct);
  196. </Click>
  197. </Events>
  198. </IKDataGridTextButtonColumn>
  199. </DataColumn>
  200. <DataColumn Index="2" DataSource="CustomerReqProduct.Name_CustomerReqProduct" />
  201. <DataColumn Index="3" DataSource="CustomerReqProduct.Factory_CustomerReqProduct" />
  202. <DataColumn Index="4" DataSource="CustomerReqProduct.Quantity_CustomerReqProduct" />
  203. <DataColumn Index="5" DataSource="CustomerReqProduct.Unit_CustomerReqProduct">
  204. <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Unit_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Unit_CustomerReqProduct"
  205. DataSourceEx="Unit" DisplayMemberEx="Unit_Product" ValueMemberEx="Unit_Product">
  206. <Events>
  207. <Reload>
  208. Search("SearchUnit");
  209. SetDataGridColumnDataSource(5,"dgProduct");
  210. </Reload>
  211. </Events>
  212. </IKDataGridComboBoxColumn>
  213. </DataColumn>
  214. <DataColumn Index="6" DataSource="CustomerReqProduct.Price_CustomerReqProduct" />
  215. <DataColumn Index="7" DataSource="CustomerReqProduct.Type_CustomerReqProduct">
  216. <!--<IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Type_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Type_CustomerReqProduct"
  217. DataSourceEx="Type" DisplayMemberEx="Type_Product" ValueMemberEx="Type_Product">
  218. <Events>
  219. <Reload>
  220. Search("SearchType");
  221. SetDataGridColumnDataSource(7,"dgProduct");
  222. </Reload>
  223. </Events>
  224. </IKDataGridComboBoxColumn>-->
  225. </DataColumn>
  226. <DataColumn Index="8" DataSource="CustomerReqProduct.Property_CustomerReqProduct">
  227. <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Property_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Property_CustomerReqProduct"
  228. DataSourceEx="Property" DisplayMemberEx="Property_Product" ValueMemberEx="Property_Product">
  229. <Events>
  230. <Reload>
  231. Search("SearchProperty");
  232. SetDataGridColumnDataSource(8,"dgProduct");
  233. </Reload>
  234. </Events>
  235. </IKDataGridComboBoxColumn>
  236. </DataColumn>
  237. <DataColumn Index="9" DataSource="CustomerReqProduct.ManuMethod_CustomerReqProduct">
  238. <!--<IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.ManuMethod_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.ManuMethod_CustomerReqProduct"
  239. DataSourceEx="ManuMethod" DisplayMemberEx="ManuMethod_Product" ValueMemberEx="ManuMethod_Product">
  240. <Events>
  241. <Reload>
  242. Search("SearchManuMethod");
  243. SetDataGridColumnDataSource(9,"dgProduct");
  244. </Reload>
  245. </Events>
  246. </IKDataGridComboBoxColumn>-->
  247. </DataColumn>
  248. <DataColumn Index="10" DataSource="CustomerReqProduct.Material_CustomerReqProduct">
  249. <!--<IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Material_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Material_CustomerReqProduct"
  250. DataSourceEx="Material" DisplayMemberEx="Material_CustomerReqProduct" ValueMemberEx="Material_CustomerReqProduct">
  251. <Events>
  252. <Reload>
  253. Search("SearchMaterial");
  254. SetDataGridColumnDataSource(10,"dgProduct");
  255. </Reload>
  256. </Events>
  257. </IKDataGridComboBoxColumn>-->
  258. </DataColumn>
  259. <DataColumn Index="11" DataSource="CustomerReqProduct.Process_CustomerReqProduct">
  260. <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Process_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Process_CustomerReqProduct"
  261. DataSourceEx="Process" DisplayMemberEx="Process_CustomerReqProduct" ValueMemberEx="Process_CustomerReqProduct">
  262. <Events>
  263. <Reload>
  264. Search("SearchProcess");
  265. SetDataGridColumnDataSource(11,"dgProduct");
  266. </Reload>
  267. </Events>
  268. </IKDataGridComboBoxColumn>
  269. </DataColumn>
  270. <DataColumn Index="12" DataSource="CustomerReqProduct.Continuity_CustomerReqProduct">
  271. <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Continuity_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Continuity_CustomerReqProduct"
  272. DataSourceEx="Continuity" DisplayMemberEx="Continuity_CustomerReqProduct" ValueMemberEx="Continuity_CustomerReqProduct">
  273. <Events>
  274. <Reload>
  275. Search("SearchContinuity");
  276. SetDataGridColumnDataSource(12,"dgProduct");
  277. </Reload>
  278. </Events>
  279. </IKDataGridComboBoxColumn>
  280. </DataColumn>
  281. <DataColumn Index="13" DataSource="CustomerReqProduct.Oil_CustomerReqProduct">
  282. <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Oil_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Oil_CustomerReqProduct"
  283. DataSourceEx="Oil" DisplayMemberEx="Oil_CustomerReqProduct" ValueMemberEx="Oil_CustomerReqProduct">
  284. <Events>
  285. <Reload>
  286. Search("SearchOil");
  287. SetDataGridColumnDataSource(13,"dgProduct");
  288. </Reload>
  289. </Events>
  290. </IKDataGridComboBoxColumn>
  291. </DataColumn>
  292. <DataColumn Index="14" DataSource="CustomerReqProduct.TrackInside_CustomerReqProduct" />
  293. <DataColumn Index="15" DataSource="CustomerReqProduct.Rate_CustomerReqProduct" />
  294. <DataColumn Index="16" DataSource="CustomerReqProduct.Depth_CustomerReqProduct" />
  295. <DataColumn Index="17" DataSource="CustomerReqProduct.PutInQuantity_CustomerReqProduct" />
  296. <DataColumn Index="18" DataSource="CustomerReqProduct.Comment_CustomerReqProduct" />
  297. </IKDataGridEx>
  298. <IKFormToolBar name="toolBar">
  299. <Events>
  300. <ClickFirst>
  301. if(Search("SearchFirst", cbCreateNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
  302. {
  303. ChangeMode("View");
  304. }
  305. </ClickFirst>
  306. <ClickPrev>
  307. if(Search("SearchPrevious", cbCreateNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
  308. {
  309. ChangeMode("View");
  310. }
  311. </ClickPrev>
  312. <ClickNext>
  313. if(Search("SearchNext", cbCreateNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
  314. {
  315. ChangeMode("View");
  316. }
  317. </ClickNext>
  318. <ClickLast>
  319. if(Search("SearchLast", cbCreateNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
  320. {
  321. ChangeMode("View");
  322. }
  323. </ClickLast>
  324. <ClickEmpty>
  325. ChangeMode("Search");
  326. </ClickEmpty>
  327. <ClickNew>
  328. <![CDATA[
  329. @NextNo = GetNextAutoNumber(true);
  330. if (!Equals(@NextNo, ""))
  331. {
  332. ChangeMode("New");
  333. #CustomerReqInfo.No_CustomerReqInfo = @NextNo;
  334. UpdateForm(true, "cbCreateNo");
  335. }
  336. ]]>
  337. </ClickNew>
  338. <ClickSubmit>
  339. <Lable name="SubmitButtonClick" />
  340. </ClickSubmit>
  341. <ClickModify>
  342. ChangeMode("Modify");
  343. <Lable name="CountSum" />
  344. </ClickModify>
  345. <ClickDelete>
  346. Delete();
  347. ChangeMode("Search");
  348. </ClickDelete>
  349. <ClickImport>
  350. ;
  351. </ClickImport>
  352. <ClickExport>
  353. ;
  354. </ClickExport>
  355. <ClickClose>
  356. ;
  357. </ClickClose>
  358. <ClickPrint>
  359. PrintReport();
  360. </ClickPrint>
  361. <ClickExpand>
  362. if(toolBar.ExpandForm==true)
  363. {
  364. pnRight.Visible=true;<!--PanelRight is not existed-->
  365. }
  366. else
  367. {
  368. pnRight.Visible=false;
  369. }
  370. </ClickExpand>
  371. </Events>
  372. </IKFormToolBar>
  373. </Controls>
  374. <Tables>
  375. <Table name="CustomerReqProduct">
  376. <Events>
  377. <ColumnsChanged>
  378. <No_CustomerReqProduct>
  379. <![CDATA[
  380. if (!Equals(#CustomerReqProduct.No_CustomerReqProduct,"") && !Equals(#CustomerReqProduct.No_CustomerReqProduct,DBNull()))
  381. {
  382. if (Search("SearchProductWithNo",#CustomerReqProduct.No_CustomerReqProduct))
  383. {
  384. #CustomerReqProduct.Name_CustomerReqProduct = #Product.Name_Product;
  385. #CustomerReqProduct.Unit_CustomerReqProduct = #Product.Unit_Product;
  386. #CustomerReqProduct.Type_CustomerReqProduct = #Product.Type_Product;
  387. #CustomerReqProduct.Property_CustomerReqProduct = #Product.Property_Product;
  388. }
  389. }
  390. ]]>
  391. </No_CustomerReqProduct>
  392. </ColumnsChanged>
  393. </Events>
  394. </Table>
  395. </Tables>
  396. <LockInfomation LockID="ID_CustomerReqInfo" LockNO="No_CustomerReqInfo" LockSearchFunction="SearchCustomerReqInfoWithNo" />
  397. <ChildForms>
  398. <ChildForm name="BillSearch" DataSource="CustomerReqInfo" SearchFunction="SearchAllBill" SearchFunctionCondition="SearchCustomerCondition"
  399. SearchFunctionByNo="SearchCustomerReqInfoWithNo">
  400. <DataColumn Index="0" MappingName="#CustomerReqInfo.No_CustomerReqInfo" HeaderText="建档编号" Width="90"
  401. ColumnType="IKDataGridTextBoxColumn" />
  402. <DataColumn Index="1" MappingName="#CustomerReqInfo.CreateDate_CustomerReqInfo" HeaderText="建档日期"
  403. Width="90" ColumnType="IKDataGridTextBoxColumn" />
  404. <DataColumn Index="2" MappingName="#CustomerReqInfo.No_Customer" HeaderText="客户编号" Width="75"
  405. ColumnType="IKDataGridTextBoxColumn" />
  406. <DataColumn Index="3" MappingName="#CustomerReqInfo.Type_Customer" HeaderText="客户类型" Width="75"
  407. ColumnType="IKDataGridTextBoxColumn" />
  408. <DataColumn Index="4" MappingName="#CustomerReqInfo.ShortName_Customer" HeaderText="客户名称" Width="75"
  409. ColumnType="IKDataGridTextBoxColumn" />
  410. <DataColumn Index="5" MappingName="#CustomerReqInfo.Comment_CustomerReqInfo" HeaderText="备注"
  411. Width="75" ColumnType="IKDataGridTextBoxColumn" />
  412. </ChildForm>
  413. <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition"
  414. SearchFunctionByNo="" MappingName="客户">
  415. <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn" />
  416. <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90"
  417. ColumnType="IKDataGridTextBoxColumn" />
  418. <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn" />
  419. <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn" />
  420. <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75"
  421. ColumnType="IKDataGridBoolColumn" />
  422. <DataColumn Index="5" MappingName="#Customer.Zone_Customer" HeaderText="地区" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  423. <DataColumn Index="6" MappingName="#Customer.SendAddr_Customer" HeaderText="送货地址" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  424. </ChildForm>
  425. <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo=""
  426. MappingName="产品" ReturnDataSource="CustomerReqProduct" ShowCheckBox="true">
  427. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"
  428. ReturnMappingName="#CustomerReqProduct.No_CustomerReqProduct" />
  429. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  430. </ChildForm>
  431. <ChildForm name="InputSearchProduct" DataSource="Product" SearchFunction="SearchAllProduct"
  432. SearchFunctionByNo="" MappingName="产品">
  433. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  434. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn" />
  435. </ChildForm>
  436. </ChildForms>
  437. <FormatString>
  438. <Format name="SearchCustomerCondition">
  439. if(GetRight("客户基本资料","全权查看"))
  440. {
  441. FormatString("");
  442. }
  443. else
  444. {
  445. FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
  446. }
  447. </Format>
  448. </FormatString>
  449. </Client>
  450. <Server>
  451. <Tables>
  452. <Table name="CustomerReqInfo" Type="Parent">
  453. <GetSchema CmdType="Text" CmdText="SELECT TOP 0 CustomerReqInfo.*,Linkman.ID_Linkman,ID_Telephone,ID_Fax, Name_User, No_Customer,Name_Customer, ShortName_Customer,Type_Customer, PostalCode_Customer FROM CustomerReqInfo
  454. LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
  455. LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
  456. LEFT JOIN Linkman ON Linkman.ID_Person = CustomerReqInfo.ID_Customer
  457. LEFT JOIN Telephone ON Telephone.ID_Person = CustomerReqInfo.ID_Customer
  458. LEFT JOIN Fax ON Fax.ID_Person = CustomerReqInfo.ID_Customer" />
  459. <New CmdType="Text" CmdText="INSERT INTO CustomerReqInfo(ID_CustomerReqInfo, No_CustomerReqInfo, CreateDate_CustomerReqInfo, ID_Customer, Linkman_CustomerReqInfo, Telephone_CustomerReqInfo, Fax_CustomerReqInfo, SendAddr_CustomerReqInfo, Comment_CustomerReqInfo, ID_Creator)
  460. VALUES(@ID_CustomerReqInfo, @No_CustomerReqInfo, @CreateDate_CustomerReqInfo, @ID_Customer, @Linkman_CustomerReqInfo, @Telephone_CustomerReqInfo, @Fax_CustomerReqInfo, @SendAddr_CustomerReqInfo, @Comment_CustomerReqInfo, @ID_Creator)">
  461. <Params>
  462. <Param name="@ID_CustomerReqInfo" type="CustomerReqInfo.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
  463. <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" sourceColumn="No_CustomerReqInfo" />
  464. <Param name="@CreateDate_CustomerReqInfo" type="CustomerReqInfo.CreateDate_CustomerReqInfo"
  465. sourceColumn="CreateDate_CustomerReqInfo" />
  466. <Param name="@ID_Customer" type="CustomerReqInfo.ID_Customer" sourceColumn="ID_Customer" />
  467. <Param name="@Linkman_CustomerReqInfo" type="CustomerReqInfo.Linkman_CustomerReqInfo" sourceColumn="Linkman_CustomerReqInfo" />
  468. <Param name="@Telephone_CustomerReqInfo" type="CustomerReqInfo.Telephone_CustomerReqInfo"
  469. sourceColumn="Telephone_CustomerReqInfo" />
  470. <Param name="@Fax_CustomerReqInfo" type="CustomerReqInfo.Fax_CustomerReqInfo" sourceColumn="Fax_CustomerReqInfo" />
  471. <Param name="@SendAddr_CustomerReqInfo" type="CustomerReqInfo.SendAddr_CustomerReqInfo"
  472. sourceColumn="SendAddr_CustomerReqInfo" />
  473. <Param name="@Comment_CustomerReqInfo" type="CustomerReqInfo.Comment_CustomerReqInfo" sourceColumn="Comment_CustomerReqInfo" />
  474. <Param name="@ID_Creator" type="CustomerReqInfo.ID_Creator" sourceColumn="ID_Creator" />
  475. </Params>
  476. </New>
  477. <Update CmdType="Text" CmdText="UPDATE CustomerReqInfo SET
  478. No_CustomerReqInfo = @No_CustomerReqInfo,
  479. CreateDate_CustomerReqInfo = @CreateDate_CustomerReqInfo,
  480. ID_Customer = @ID_Customer,
  481. Linkman_CustomerReqInfo = @Linkman_CustomerReqInfo,
  482. Telephone_CustomerReqInfo = @Telephone_CustomerReqInfo,
  483. Fax_CustomerReqInfo = @Fax_CustomerReqInfo,
  484. SendAddr_CustomerReqInfo = @SendAddr_CustomerReqInfo,
  485. Comment_CustomerReqInfo = @Comment_CustomerReqInfo,
  486. ID_Creator = @ID_Creator
  487. WHERE ID_CustomerReqInfo = @ID_CustomerReqInfo">
  488. <Params>
  489. <Param name="@ID_CustomerReqInfo" type="CustomerReqInfo.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
  490. <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" sourceColumn="No_CustomerReqInfo" />
  491. <Param name="@CreateDate_CustomerReqInfo" type="CustomerReqInfo.CreateDate_CustomerReqInfo"
  492. sourceColumn="CreateDate_CustomerReqInfo" />
  493. <Param name="@ID_Customer" type="CustomerReqInfo.ID_Customer" sourceColumn="ID_Customer" />
  494. <Param name="@Linkman_CustomerReqInfo" type="CustomerReqInfo.Linkman_CustomerReqInfo" sourceColumn="Linkman_CustomerReqInfo" />
  495. <Param name="@Telephone_CustomerReqInfo" type="CustomerReqInfo.Telephone_CustomerReqInfo"
  496. sourceColumn="Telephone_CustomerReqInfo" />
  497. <Param name="@Fax_CustomerReqInfo" type="CustomerReqInfo.Fax_CustomerReqInfo" sourceColumn="Fax_CustomerReqInfo" />
  498. <Param name="@SendAddr_CustomerReqInfo" type="CustomerReqInfo.SendAddr_CustomerReqInfo"
  499. sourceColumn="SendAddr_CustomerReqInfo" />
  500. <Param name="@Comment_CustomerReqInfo" type="CustomerReqInfo.Comment_CustomerReqInfo" sourceColumn="Comment_CustomerReqInfo" />
  501. <Param name="@ID_Creator" type="CustomerReqInfo.ID_Creator" sourceColumn="ID_Creator" />
  502. </Params>
  503. </Update>
  504. <Delete CmdType="Text" CmdText="DELETE CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo
  505. DELETE CustomerReqInfo WHERE CustomerReqInfo.ID_CustomerReqInfo = @ID_CustomerReqInfo">
  506. <Params>
  507. <Param name="@ID_CustomerReqInfo" type="CustomerReqInfo.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
  508. </Params>
  509. </Delete>
  510. </Table>
  511. <Table name="CustomerReqProduct" Type="Child">
  512. <GetSchema CmdType="Text" CmdText="SELECT TOP 0 CustomerReqProduct.* FROM CustomerReqProduct" />
  513. <New CmdType="Text" CmdText="Insert Into dbo.CustomerReqProduct (ID_CustomerReqProduct, ID_CustomerReqInfo, No_CustomerReq, No_CustomerReqProduct, Name_CustomerReqProduct, Type_CustomerReqProduct, Property_CustomerReqProduct, Quantity_CustomerReqProduct, Unit_CustomerReqProduct, Comment_CustomerReqProduct, Price_CustomerReqProduct, TrackInside_CustomerReqProduct, ManuMethod_CustomerReqProduct, Material_CustomerReqProduct, Continuity_CustomerReqProduct, Process_CustomerReqProduct, Factory_CustomerReqProduct, Rate_CustomerReqProduct, Depth_CustomerReqProduct, PutInQuantity_CustomerReqProduct, Oil_CustomerReqProduct)
  514. Values(@ID_CustomerReqProduct, @ID_CustomerReqInfo, @No_CustomerReq, @No_CustomerReqProduct, @Name_CustomerReqProduct, @Type_CustomerReqProduct, @Property_CustomerReqProduct, @Quantity_CustomerReqProduct, @Unit_CustomerReqProduct, @Comment_CustomerReqProduct, @Price_CustomerReqProduct, @TrackInside_CustomerReqProduct, @ManuMethod_CustomerReqProduct, @Material_CustomerReqProduct, @Continuity_CustomerReqProduct, @Process_CustomerReqProduct, @Factory_CustomerReqProduct, @Rate_CustomerReqProduct, @Depth_CustomerReqProduct, @PutInQuantity_CustomerReqProduct, @Oil_CustomerReqProduct)">
  515. <Params>
  516. <Param name="@No_CustomerReq" type="CustomerReqProduct.No_CustomerReq" sourceColumn="No_CustomerReq" />
  517. <Param name="@ID_CustomerReqProduct" type="CustomerReqProduct.ID_CustomerReqProduct" sourceColumn="ID_CustomerReqProduct" />
  518. <Param name="@ID_CustomerReqInfo" type="CustomerReqProduct.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
  519. <Param name="@No_CustomerReqProduct" type="CustomerReqProduct.No_CustomerReqProduct" sourceColumn="No_CustomerReqProduct" />
  520. <Param name="@Name_CustomerReqProduct" type="CustomerReqProduct.Name_CustomerReqProduct"
  521. sourceColumn="Name_CustomerReqProduct" />
  522. <Param name="@Type_CustomerReqProduct" type="CustomerReqProduct.Type_CustomerReqProduct"
  523. sourceColumn="Type_CustomerReqProduct" />
  524. <Param name="@Property_CustomerReqProduct" type="CustomerReqProduct.Property_CustomerReqProduct"
  525. sourceColumn="Property_CustomerReqProduct" />
  526. <Param name="@Quantity_CustomerReqProduct" type="CustomerReqProduct.Quantity_CustomerReqProduct"
  527. sourceColumn="Quantity_CustomerReqProduct" />
  528. <Param name="@Unit_CustomerReqProduct" type="CustomerReqProduct.Unit_CustomerReqProduct"
  529. sourceColumn="Unit_CustomerReqProduct" />
  530. <Param name="@Comment_CustomerReqProduct" type="CustomerReqProduct.Comment_CustomerReqProduct"
  531. sourceColumn="Comment_CustomerReqProduct" />
  532. <Param name="@Price_CustomerReqProduct" type="CustomerReqProduct.Price_CustomerReqProduct"
  533. sourceColumn="Price_CustomerReqProduct" />
  534. <Param name="@TrackInside_CustomerReqProduct" type="CustomerReqProduct.TrackInside_CustomerReqProduct"
  535. sourceColumn="TrackInside_CustomerReqProduct" />
  536. <Param name="@ManuMethod_CustomerReqProduct" type="CustomerReqProduct.ManuMethod_CustomerReqProduct"
  537. sourceColumn="ManuMethod_CustomerReqProduct" />
  538. <Param name="@Material_CustomerReqProduct" type="CustomerReqProduct.Material_CustomerReqProduct"
  539. sourceColumn="Material_CustomerReqProduct" />
  540. <Param name="@Continuity_CustomerReqProduct" type="CustomerReqProduct.Continuity_CustomerReqProduct"
  541. sourceColumn="Continuity_CustomerReqProduct" />
  542. <Param name="@Process_CustomerReqProduct" type="CustomerReqProduct.Process_CustomerReqProduct"
  543. sourceColumn="Process_CustomerReqProduct" />
  544. <Param name="@Factory_CustomerReqProduct" type="CustomerReqProduct.Factory_CustomerReqProduct"
  545. sourceColumn="Factory_CustomerReqProduct" />
  546. <Param name="@Rate_CustomerReqProduct" type="CustomerReqProduct.Rate_CustomerReqProduct"
  547. sourceColumn="Rate_CustomerReqProduct" />
  548. <Param name="@Depth_CustomerReqProduct" type="CustomerReqProduct.Depth_CustomerReqProduct"
  549. sourceColumn="Depth_CustomerReqProduct" />
  550. <Param name="@PutInQuantity_CustomerReqProduct" type="CustomerReqProduct.PutInQuantity_CustomerReqProduct"
  551. sourceColumn="PutInQuantity_CustomerReqProduct" />
  552. <Param name="@Oil_CustomerReqProduct" type="CustomerReqProduct.Oil_CustomerReqProduct"
  553. sourceColumn="Oil_CustomerReqProduct" />
  554. </Params>
  555. </New>
  556. <Update CmdType="Text" CmdText="Update dbo.CustomerReqProduct
  557. Set ID_CustomerReqInfo = @ID_CustomerReqInfo,
  558. No_CustomerReq = @No_CustomerReq,
  559. No_CustomerReqProduct = @No_CustomerReqProduct,
  560. Name_CustomerReqProduct = @Name_CustomerReqProduct,
  561. Type_CustomerReqProduct = @Type_CustomerReqProduct,
  562. Property_CustomerReqProduct = @Property_CustomerReqProduct,
  563. Quantity_CustomerReqProduct = @Quantity_CustomerReqProduct,
  564. Unit_CustomerReqProduct = @Unit_CustomerReqProduct,
  565. Comment_CustomerReqProduct = @Comment_CustomerReqProduct,
  566. Price_CustomerReqProduct = @Price_CustomerReqProduct,
  567. TrackInside_CustomerReqProduct = @TrackInside_CustomerReqProduct,
  568. ManuMethod_CustomerReqProduct = @ManuMethod_CustomerReqProduct,
  569. Material_CustomerReqProduct = @Material_CustomerReqProduct,
  570. Continuity_CustomerReqProduct = @Continuity_CustomerReqProduct,
  571. Process_CustomerReqProduct = @Process_CustomerReqProduct,
  572. Factory_CustomerReqProduct = @Factory_CustomerReqProduct,
  573. Rate_CustomerReqProduct = @Rate_CustomerReqProduct,
  574. Depth_CustomerReqProduct = @Depth_CustomerReqProduct,
  575. PutInQuantity_CustomerReqProduct = @PutInQuantity_CustomerReqProduct,
  576. Oil_CustomerReqProduct = @Oil_CustomerReqProduct
  577. Where ID_CustomerReqProduct = @ID_CustomerReqProduct">
  578. <Params>
  579. <Param name="@No_CustomerReq" type="CustomerReqProduct.No_CustomerReq" sourceColumn="No_CustomerReq" />
  580. <Param name="@ID_CustomerReqProduct" type="CustomerReqProduct.ID_CustomerReqProduct" sourceColumn="ID_CustomerReqProduct" />
  581. <Param name="@ID_CustomerReqInfo" type="CustomerReqProduct.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
  582. <Param name="@No_CustomerReqProduct" type="CustomerReqProduct.No_CustomerReqProduct" sourceColumn="No_CustomerReqProduct" />
  583. <Param name="@Name_CustomerReqProduct" type="CustomerReqProduct.Name_CustomerReqProduct"
  584. sourceColumn="Name_CustomerReqProduct" />
  585. <Param name="@Type_CustomerReqProduct" type="CustomerReqProduct.Type_CustomerReqProduct"
  586. sourceColumn="Type_CustomerReqProduct" />
  587. <Param name="@Property_CustomerReqProduct" type="CustomerReqProduct.Property_CustomerReqProduct"
  588. sourceColumn="Property_CustomerReqProduct" />
  589. <Param name="@Quantity_CustomerReqProduct" type="CustomerReqProduct.Quantity_CustomerReqProduct"
  590. sourceColumn="Quantity_CustomerReqProduct" />
  591. <Param name="@Unit_CustomerReqProduct" type="CustomerReqProduct.Unit_CustomerReqProduct"
  592. sourceColumn="Unit_CustomerReqProduct" />
  593. <Param name="@Comment_CustomerReqProduct" type="CustomerReqProduct.Comment_CustomerReqProduct"
  594. sourceColumn="Comment_CustomerReqProduct" />
  595. <Param name="@Price_CustomerReqProduct" type="CustomerReqProduct.Price_CustomerReqProduct"
  596. sourceColumn="Price_CustomerReqProduct" />
  597. <Param name="@TrackInside_CustomerReqProduct" type="CustomerReqProduct.TrackInside_CustomerReqProduct"
  598. sourceColumn="TrackInside_CustomerReqProduct" />
  599. <Param name="@ManuMethod_CustomerReqProduct" type="CustomerReqProduct.ManuMethod_CustomerReqProduct"
  600. sourceColumn="ManuMethod_CustomerReqProduct" />
  601. <Param name="@Material_CustomerReqProduct" type="CustomerReqProduct.Material_CustomerReqProduct"
  602. sourceColumn="Material_CustomerReqProduct" />
  603. <Param name="@Continuity_CustomerReqProduct" type="CustomerReqProduct.Continuity_CustomerReqProduct"
  604. sourceColumn="Continuity_CustomerReqProduct" />
  605. <Param name="@Process_CustomerReqProduct" type="CustomerReqProduct.Process_CustomerReqProduct"
  606. sourceColumn="Process_CustomerReqProduct" />
  607. <Param name="@Factory_CustomerReqProduct" type="CustomerReqProduct.Factory_CustomerReqProduct"
  608. sourceColumn="Factory_CustomerReqProduct" />
  609. <Param name="@Rate_CustomerReqProduct" type="CustomerReqProduct.Rate_CustomerReqProduct"
  610. sourceColumn="Rate_CustomerReqProduct" />
  611. <Param name="@Depth_CustomerReqProduct" type="CustomerReqProduct.Depth_CustomerReqProduct"
  612. sourceColumn="Depth_CustomerReqProduct" />
  613. <Param name="@PutInQuantity_CustomerReqProduct" type="CustomerReqProduct.PutInQuantity_CustomerReqProduct"
  614. sourceColumn="PutInQuantity_CustomerReqProduct" />
  615. <Param name="@Oil_CustomerReqProduct" type="CustomerReqProduct.Oil_CustomerReqProduct"
  616. sourceColumn="Oil_CustomerReqProduct" />
  617. </Params>
  618. </Update>
  619. <Delete CmdType="Text" CmdText="DELETE CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqProduct = @ID_CustomerReqProduct">
  620. <Params>
  621. <Param name="@ID_CustomerReqProduct" type="CustomerReqProduct.ID_CustomerReqProduct" sourceColumn="ID_CustomerReqProduct" />
  622. </Params>
  623. </Delete>
  624. </Table>
  625. </Tables>
  626. <Search>
  627. <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer,Customer.ID_Creator,Customer.Zone_Customer,Customer.SendAddr_Customer FROM Customer ">
  628. <Tables>
  629. <Table name="AllCustomer" />
  630. </Tables>
  631. </SearchAllCustomer>
  632. <SearchAllBill CmdType="Text" CmdText=" SELECT CustomerReqInfo.*,Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer,Customer.ID_Creator FROM CustomerReqInfo
  633. LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer">
  634. <Tables>
  635. <Table name="AllBill" />
  636. </Tables>
  637. </SearchAllBill>
  638. <SearchAllProduct CmdType="Text" CmdText=" SELECT Product.No_Product,Product.Name_Product FROM Product
  639. ">
  640. <Tables>
  641. <Table name="AllBill" />
  642. </Tables>
  643. </SearchAllProduct>
  644. <SearchCustomerReqInfoWithNo CmdType="Text" CmdText=" DECLARE @ID_CustomerReqInfo UNIQUEIDENTIFIER
  645. SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @No_CustomerReqInfo
  646. SELECT CustomerReqInfo.*, Name_User, Customer.ID_Creator as CustomerID_Creator,Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer FROM CustomerReqInfo
  647. LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
  648. LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
  649. WHERE CustomerReqInfo.No_CustomerReqInfo = @No_CustomerReqInfo
  650. SELECT CustomerReqProduct.* FROM CustomerReqProduct
  651. WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo
  652. order by No_CustomerReq">
  653. <Params>
  654. <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
  655. </Params>
  656. <Tables>
  657. <Table name="CustomerReqInfo" />
  658. <Table name="CustomerReqProduct" />
  659. </Tables>
  660. </SearchCustomerReqInfoWithNo>
  661. <SearchCustomer CmdType="Text" CmdText="SELECT * FROM Customer
  662. LEFT JOIN Linkman ON Linkman.ID_Person = Customer.ID_Customer
  663. WHERE No_Customer = @No_Customer">
  664. <Params>
  665. <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
  666. </Params>
  667. <Tables>
  668. <Table name="Customer" />
  669. </Tables>
  670. </SearchCustomer>
  671. <SearchLinkman CmdType="Text" CmdText="DECLARE @ID_Customer UNIQUEIDENTIFIER
  672. SELECT @ID_Customer = ID_Customer FROM Customer WHERE No_Customer = @No_Customer
  673. SELECT Name_Linkman,ID_Linkman FROM Linkman WHERE ID_Person = @ID_Customer">
  674. <Params>
  675. <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
  676. </Params>
  677. <Tables>
  678. <Table name="Linkman" />
  679. </Tables>
  680. </SearchLinkman>
  681. <SearchTelephone CmdType="Text" CmdText="DECLARE @ID_Customer UNIQUEIDENTIFIER
  682. SELECT @ID_Customer = ID_Customer FROM Customer WHERE No_Customer = @No_Customer
  683. SELECT No_Telephone,ID_Telephone FROM Telephone WHERE ID_Person = @ID_Customer">
  684. <Params>
  685. <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
  686. </Params>
  687. <Tables>
  688. <Table name="Telephone" />
  689. </Tables>
  690. </SearchTelephone>
  691. <SearchFax CmdType="Text" CmdText="DECLARE @ID_Customer UNIQUEIDENTIFIER
  692. SELECT @ID_Customer = ID_Customer FROM Customer WHERE No_Customer = @No_Customer
  693. SELECT No_Fax,ID_Fax FROM Fax WHERE ID_Person = @ID_Customer">
  694. <Params>
  695. <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
  696. </Params>
  697. <Tables>
  698. <Table name="Fax" />
  699. </Tables>
  700. </SearchFax>
  701. <SearchUnit CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Unit_Product FROM TypeDef WHERE Type_TypeDef = '7'">
  702. <Tables>
  703. <Table name="Unit" />
  704. </Tables>
  705. </SearchUnit>
  706. <SearchType CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Type_Product FROM TypeDef WHERE Type_TypeDef = '8'">
  707. <Tables>
  708. <Table name="Type" />
  709. </Tables>
  710. </SearchType>
  711. <SearchProperty CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Property_Product FROM TypeDef WHERE Type_TypeDef = '10'">
  712. <Tables>
  713. <Table name="Property" />
  714. </Tables>
  715. </SearchProperty>
  716. <SearchFirst CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
  717. SET @NextNo = @No_CustomerReqInfo
  718. SELECT TOP 1 @NextNo = CustomerReqInfo.No_CustomerReqInfo FROM CustomerReqInfo
  719. inner Join Customer On Customer.ID_Customer=CustomerReqInfo.ID_Customer
  720. where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  721. ORDER BY CustomerReqInfo.No_CustomerReqInfo
  722. DECLARE @ID_CustomerReqInfo uniqueidentifier
  723. SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @NextNo
  724. SELECT CustomerReqInfo.*, Name_User, Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer,Customer.ID_Creator FROM CustomerReqInfo
  725. LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
  726. LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
  727. WHERE CustomerReqInfo.No_CustomerReqInfo = @NextNo
  728. SELECT CustomerReqProduct.* FROM CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo order by No_CustomerReq ">
  729. <Params>
  730. <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
  731. <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
  732. </Params>
  733. <Tables>
  734. <Table name="CustomerReqInfo" />
  735. <Table name="CustomerReqProduct" />
  736. </Tables>
  737. </SearchFirst>
  738. <SearchPrevious CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
  739. SET @NextNo = @No_CustomerReqInfo
  740. SELECT TOP 1 @NextNo = CustomerReqInfo.No_CustomerReqInfo FROM CustomerReqInfo
  741. inner Join Customer On Customer.ID_Customer=CustomerReqInfo.ID_Customer
  742. WHERE CustomerReqInfo.No_CustomerReqInfo &lt; @No_CustomerReqInfo and Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  743. ORDER BY CustomerReqInfo.No_CustomerReqInfo Desc
  744. DECLARE @ID_CustomerReqInfo uniqueidentifier
  745. SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @NextNo
  746. SELECT CustomerReqInfo.*, Name_User, Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer,Customer.ID_Creator FROM CustomerReqInfo
  747. LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
  748. LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
  749. WHERE CustomerReqInfo.No_CustomerReqInfo = @NextNo
  750. SELECT CustomerReqProduct.* FROM CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo order by No_CustomerReq">
  751. <Params>
  752. <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
  753. <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
  754. </Params>
  755. <Tables>
  756. <Table name="CustomerReqInfo" />
  757. <Table name="CustomerReqProduct" />
  758. </Tables>
  759. </SearchPrevious>
  760. <SearchNext CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
  761. SET @NextNo = @No_CustomerReqInfo
  762. SELECT TOP 1 @NextNo = CustomerReqInfo.No_CustomerReqInfo FROM CustomerReqInfo
  763. inner Join Customer On Customer.ID_Customer=CustomerReqInfo.ID_Customer
  764. WHERE CustomerReqInfo.No_CustomerReqInfo &gt; @No_CustomerReqInfo
  765. and Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  766. ORDER BY CustomerReqInfo.No_CustomerReqInfo
  767. DECLARE @ID_CustomerReqInfo uniqueidentifier
  768. SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @NextNo
  769. SELECT CustomerReqInfo.*, Name_User, Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer,Customer.ID_Creator FROM CustomerReqInfo
  770. LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
  771. LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
  772. WHERE CustomerReqInfo.No_CustomerReqInfo = @NextNo
  773. SELECT CustomerReqProduct.* FROM CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo order by No_CustomerReq">
  774. <Params>
  775. <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
  776. <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
  777. </Params>
  778. <Tables>
  779. <Table name="CustomerReqInfo" />
  780. <Table name="CustomerReqProduct" />
  781. </Tables>
  782. </SearchNext>
  783. <SearchLast CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
  784. SET @NextNo = @No_CustomerReqInfo
  785. SELECT TOP 1 @NextNo = CustomerReqInfo.No_CustomerReqInfo FROM CustomerReqInfo
  786. inner Join Customer On Customer.ID_Customer=CustomerReqInfo.ID_Customer
  787. where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  788. ORDER BY CustomerReqInfo.No_CustomerReqInfo DESC
  789. DECLARE @ID_CustomerReqInfo uniqueidentifier
  790. SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @NextNo
  791. SELECT CustomerReqInfo.*, Name_User, Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer,Customer.ID_Creator FROM CustomerReqInfo
  792. LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
  793. LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
  794. WHERE CustomerReqInfo.No_CustomerReqInfo = @NextNo
  795. SELECT CustomerReqProduct.* FROM CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo order by No_CustomerReq">
  796. <Params>
  797. <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
  798. <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
  799. </Params>
  800. <Tables>
  801. <Table name="CustomerReqInfo" />
  802. <Table name="CustomerReqProduct" />
  803. </Tables>
  804. </SearchLast>
  805. <SearchProductWithNo CmdType="Text" CmdText=" SELECT ID_Product, Name_Product, Unit_Product, Type_Product,Property_Product
  806. FROM Product
  807. WHERE No_Product = @No_Product">
  808. <Params>
  809. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  810. </Params>
  811. <Tables>
  812. <Table name="Product" />
  813. </Tables>
  814. </SearchProductWithNo>
  815. <SearchManuMethod CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS ManuMethod_Product FROM TypeDef WHERE Type_TypeDef = '28' ">
  816. <Tables>
  817. <Table name="ManuMethod" />
  818. </Tables>
  819. </SearchManuMethod>
  820. <SearchMaterial CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Material_CustomerReqProduct FROM TypeDef WHERE Type_TypeDef = '29' ">
  821. <Tables>
  822. <Table name="Material" />
  823. </Tables>
  824. </SearchMaterial>
  825. <SearchProcess CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Process_CustomerReqProduct FROM TypeDef WHERE Type_TypeDef = '30' ">
  826. <Tables>
  827. <Table name="Process" />
  828. </Tables>
  829. </SearchProcess>
  830. <SearchContinuity CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Continuity_CustomerReqProduct FROM TypeDef WHERE Type_TypeDef = '31' ">
  831. <Tables>
  832. <Table name="Continuity" />
  833. </Tables>
  834. </SearchContinuity>
  835. <SearchOil CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Oil_CustomerReqProduct FROM TypeDef WHERE Type_TypeDef = '32' ">
  836. <Tables>
  837. <Table name="Oil" />
  838. </Tables>
  839. </SearchOil>
  840. </Search>
  841. </Server>
  842. <Lables>
  843. <Search>
  844. Empty();
  845. NewInstance();
  846. timeMake.Enabled = false;
  847. cbCreateNo.ReadOnly = false;
  848. txtCreator.ReadOnly = true;
  849. tbNo.ReadOnly = true;
  850. txtShortName.ReadOnly = true;
  851. txtType.ReadOnly = true;
  852. txtName.ReadOnly = true;
  853. txtPostalCode.ReadOnly = true;
  854. cbName.Enabled = false;
  855. cbTelephone.Enabled = false;
  856. cbFax.Enabled = false;
  857. txtSendAddr.ReadOnly = true;
  858. txtComment.ReadOnly = true;
  859. dgProduct.ReadOnly = true;
  860. toolBar.EnableSubmit=false;
  861. toolBar.EnableModify=false;
  862. toolBar.EnableDelete=false;
  863. toolBar.EnableNew=GetRight(@Title,"新增");
  864. UpdateForm(true, "");
  865. cbCreateNo.Focus();
  866. @Status=0;
  867. </Search>
  868. <New>
  869. Empty();
  870. NewInstance();
  871. timeMake.Enabled = true;
  872. cbCreateNo.ReadOnly = true;
  873. txtCreator.ReadOnly = true;
  874. tbNo.ReadOnly = false;
  875. txtShortName.ReadOnly = true;
  876. txtType.ReadOnly = true;
  877. txtName.ReadOnly = true;
  878. txtPostalCode.ReadOnly = true;
  879. cbName.Enabled = true;
  880. cbTelephone.Enabled = true;
  881. cbFax.Enabled = true;
  882. txtSendAddr.ReadOnly = false;
  883. txtComment.ReadOnly = false;
  884. dgProduct.ReadOnly = false;
  885. toolBar.EnableSubmit=GetRight(@Title,"新增");
  886. toolBar.EnableModify=false;
  887. toolBar.EnableDelete=false;
  888. toolBar.EnableNew=false;
  889. #CustomerReqInfo.CreateDate_CustomerReqInfo = DateTimeNow();
  890. #CustomerReqInfo.ID_Creator = GetLoginUserID();
  891. #CustomerReqInfo.ID_CustomerReqInfo = NewGuid();
  892. #CustomerReqInfo.Name_User = GetCurrentUser();
  893. UpdateForm(true, "");
  894. tbNo.Focus();
  895. @Status=1;
  896. </New>
  897. <View>
  898. timeMake.Enabled = false;
  899. cbCreateNo.ReadOnly = true;
  900. txtCreator.ReadOnly = true;
  901. tbNo.ReadOnly = true;
  902. txtShortName.ReadOnly = true;
  903. txtType.ReadOnly = true;
  904. txtName.ReadOnly = true;
  905. txtPostalCode.ReadOnly = true;
  906. cbName.Enabled = false;
  907. cbTelephone.Enabled = false;
  908. cbFax.Enabled = false;
  909. txtSendAddr.ReadOnly = true;
  910. txtComment.ReadOnly = true;
  911. dgProduct.ReadOnly = true;
  912. toolBar.EnableSubmit=false;
  913. toolBar.EnableModify=GetRight(@Title,"修改");
  914. toolBar.EnableNew = GetRight(@Title,"新增");
  915. toolBar.EnableDelete=GetRight(@Title,"删除");
  916. UpdateForm(true, "");
  917. @Status=2;
  918. </View>
  919. <Modify>
  920. timeMake.Enabled = true;
  921. cbCreateNo.ReadOnly = true;
  922. txtCreator.ReadOnly = true;
  923. tbNo.ReadOnly = false;
  924. txtShortName.ReadOnly = true;
  925. txtType.ReadOnly = true;
  926. txtName.ReadOnly = true;
  927. txtPostalCode.ReadOnly = true;
  928. cbName.Enabled = true;
  929. cbTelephone.Enabled = true;
  930. cbFax.Enabled = true;
  931. txtSendAddr.ReadOnly = false;
  932. txtComment.ReadOnly = false;
  933. dgProduct.ReadOnly = false;
  934. toolBar.EnableSubmit=GetRight(@Title,"修改");
  935. toolBar.EnableModify=false;
  936. toolBar.EnableDelete=false;
  937. toolBar.EnableNew=false;
  938. #CustomerReqInfo.CreateDate_CustomerReqInfo = DateTimeNow();
  939. #CustomerReqInfo.ID_Creator = GetLoginUserID();
  940. UpdateForm(true, "");
  941. tbNo.Focus();
  942. @Status=3;
  943. </Modify>
  944. <SubmitButtonClick>
  945. <![CDATA[
  946. if(!Search("SearchCustomer",tbNo.CValue) || !Equals(#CustomerReqInfo.ID_Customer,#Customer.ID_Customer))
  947. {
  948. MessageBox("请输入有效客户编号,并按回车确认!",@Title);
  949. tbNo.Focus();
  950. return;
  951. }
  952. if (RowCount("#CustomerReqProduct") == 0)
  953. {
  954. MessageBox("请输入需求商品!",@Title);
  955. dgProduct.Focus();
  956. return;
  957. }
  958. UpdateForm(false, "");
  959. SuspendLayout();
  960. for(@i=0;@i<RowCount("#CustomerReqProduct");@i=@i+1)
  961. {
  962. SetPosition("#CustomerReqProduct",@i);
  963. if(#CustomerReqProduct.No_CustomerReqProduct == "")
  964. {
  965. dgProduct.CurrentRowIndex=@i;
  966. MessageBox("请输入产品编号!",@Title);
  967. dgProduct.Focus();
  968. ResumeLayout();
  969. return;
  970. }
  971. if(#CustomerReqProduct.Name_CustomerReqProduct == "")
  972. {
  973. dgProduct.CurrentRowIndex=@i;
  974. MessageBox("请输入产品编名称!",@Title);
  975. dgProduct.Focus();
  976. ResumeLayout();
  977. return;
  978. }
  979. if(#CustomerReqProduct.Quantity_CustomerReqProduct <= 0)
  980. {
  981. dgProduct.CurrentRowIndex=@i;
  982. MessageBox("需求数量不能小于等于0!",@Title);
  983. dgProduct.Focus();
  984. ResumeLayout();
  985. return;
  986. }
  987. if(#CustomerReqProduct.Unit_CustomerReqProduct == "")
  988. {
  989. dgProduct.CurrentRowIndex=@i;
  990. MessageBox("请输入基本单位!",@Title);
  991. dgProduct.Focus();
  992. ResumeLayout();
  993. return;
  994. }
  995. if(Equals(#CustomerReqProduct.ID_CustomerReqProduct,GuidEmpty()))
  996. {
  997. #CustomerReqProduct.ID_CustomerReqProduct = NewGuid();
  998. }
  999. #CustomerReqProduct.ID_CustomerReqInfo = #CustomerReqInfo.ID_CustomerReqInfo;
  1000. Register_Set("1",#CustomerReqProduct.No_CustomerReqProduct);
  1001. for(@j=@i+1;@j<=RowCount("#CustomerReqProduct")-1;@j=@j+1)
  1002. {
  1003. SetPosition("#CustomerReqProduct",@j);
  1004. if(Equals(Register_Get("1"),#CustomerReqProduct.No_CustomerReqProduct))
  1005. {
  1006. dgProduct.CurrentRowIndex=@j;
  1007. MessageBox("单据中已存在该需求商品,请检查!",@Title);
  1008. Register_Remove("1");
  1009. ResumeLayout();
  1010. return;
  1011. }
  1012. }
  1013. }
  1014. Register_Remove("1");
  1015. ResumeLayout();
  1016. if(@Status==1)
  1017. {
  1018. #CustomerReqInfo.No_CustomerReqInfo = New("#CustomerReqInfo.No_CustomerReqInfo",timeMake.CValue);
  1019. }
  1020. else if(@Status==3)
  1021. {
  1022. Update();
  1023. }
  1024. ChangeMode("View");
  1025. ]]>
  1026. </SubmitButtonClick>
  1027. </Lables>
  1028. </Form>
  1029. </Forms>