FrmProduct.xml1 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmProduct">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="产品基本资料";
  9. @HaveSearchProductList=false;
  10. GetSchema();
  11. Search("SearchSystemSetting");
  12. @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
  13. Search("SearchCessOut");
  14. @cessout = #System.CessOut_SystemSetting;
  15. ChangeMode("Search");
  16. RecordHistoryRead("FrmProduct");
  17. ikLabel2.Visible = GetFieldRight(@Title,"成本","查看");
  18. cbCostCurrency.Visible = ikLabel2.Visible;
  19. txtCost.Visible = ikLabel2.Visible;
  20. Search("SearchIsMain");
  21. ]]>
  22. </Load>
  23. <Closing>
  24. RecordHistoryWrite("FrmProduct","dtStart","dtEnd","ckNearly","tbNearly"
  25. ,"ckPriceQuery","ckIndent","ckSaleBill","ckSaleRtn","ckPQuery","ckpurchase","ckInventory","ckSaleOut","ckPurchIn");
  26. </Closing>
  27. <Closed>
  28. ;
  29. </Closed>
  30. </Events>
  31. <Mode>
  32. <Search>
  33. <Lable name="Search" />
  34. </Search>
  35. <New>
  36. <Lable name="New" />
  37. </New>
  38. <View>
  39. <Lable name="View" />
  40. </View>
  41. <Modify>
  42. <Lable name="Modify" />
  43. </Modify>
  44. </Mode>
  45. <Controls>
  46. <IKTextButton name="tbNo" DataSource="Product.No_Product">
  47. <Events>
  48. <Enter>
  49. <![CDATA[
  50. if(tbNo.ReadOnly == false)
  51. {
  52. if(tbNo.CValue != StringEmpty())
  53. {
  54. UpdateForm(false, "");
  55. Empty("#ExchangeHistory");
  56. if(Search("SearchProductWithNo", tbNo.CValue))
  57. {
  58. ChangeMode("View");
  59. }
  60. else
  61. {
  62. if(GetRight(@Title,"新增"))
  63. {
  64. #Product.CostCurrency_Product = "RMB";
  65. ChangeMode("New");
  66. txtBarCode.CValue = tbNo.CValue;
  67. }
  68. else
  69. MessageBox("您没有新增产品基本资料的权限!",@Title);
  70. }
  71. }
  72. else
  73. {
  74. MessageBox("请输入产品编号!",@Title);
  75. }
  76. }
  77. ]]>
  78. </Enter>
  79. <Click>
  80. @Temp = ShowSearchBox("ProductSearch","INFOMATION",tbNo.CValue);
  81. if(@Temp != StringEmpty())
  82. {
  83. tbNo.CValue = @Temp;
  84. UpdateForm(false, "");
  85. Empty("#ExchangeHistory");
  86. if(Search("SearchProductWithNo", tbNo.CValue))
  87. {
  88. ChangeMode("View");
  89. }
  90. }
  91. </Click>
  92. </Events>
  93. </IKTextButton>
  94. <IKTextBox name="txtName" DataSource="Product.Name_Product">
  95. <Events>
  96. <Enter>
  97. <![CDATA[
  98. if(txtInvoiceName.CValue=="")
  99. {
  100. txtInvoiceName.CValue=txtName.CValue;
  101. }
  102. ]]>
  103. </Enter>
  104. <Leave>
  105. <![CDATA[
  106. if(txtInvoiceName.CValue=="")
  107. {
  108. txtInvoiceName.CValue=txtName.CValue;
  109. }
  110. ]]>
  111. </Leave>
  112. </Events>
  113. </IKTextBox>
  114. <IKTextBox name="txtBarCode" DataSource="Product.BarCode_Product"></IKTextBox>
  115. <IKTextBox name="txtInvoiceName" DataSource="Product.InvoiceName_Product"></IKTextBox>
  116. <IKTextBox name="txtLowSalePriceCurrency" DataSource="Product.LowSalePriceCurrency_Product"></IKTextBox>
  117. <IKTextBox name="txtCreator" DataSource="Product.CreatorName_Product"></IKTextBox><!--CreatorName_Product isn't DB's Field-->
  118. <IKTextBox name="txtComment" DataSource="Product.Comment_Product"></IKTextBox>
  119. <IKComboBoxEx name="cbUnit" DisplaySource="Product.Unit_Product"
  120. DataSource="Unit" DisplayMember="Result" >
  121. <Events>
  122. <Reload>
  123. UpdateForm(false, "cbUnit");
  124. Search("SearchUnit");
  125. UpdateForm(true, "cbUnit");
  126. </Reload>
  127. </Events>
  128. </IKComboBoxEx>
  129. <IKComboBoxEx name="cbType" DisplaySource="Product.Type_Product" DataSource="Type" DisplayMember="Result">
  130. <Events>
  131. <Reload>
  132. UpdateForm(false, "cbType");
  133. Search("SearchType");
  134. UpdateForm(true, "cbType");
  135. </Reload>
  136. </Events>
  137. </IKComboBoxEx>
  138. <IKComboBoxEx name="txtProperty" DisplaySource="Product.Property_Product" DataSource="Property" DisplayMember="Result">
  139. <Events>
  140. <Reload>
  141. UpdateForm(false, "txtProperty");
  142. Search("SearchProperty");
  143. UpdateForm(true, "txtProperty");
  144. </Reload>
  145. </Events>
  146. </IKComboBoxEx>
  147. <IKComboBoxEx name="txtSource" DisplaySource="Product.Source_Product" DataSource="Source" DisplayMember="Result">
  148. <Events>
  149. <Reload>
  150. UpdateForm(false, "txtSource");
  151. Search("SearchSource");
  152. UpdateForm(true, "txtSource");
  153. </Reload>
  154. </Events>
  155. </IKComboBoxEx>
  156. <IKComboBoxEx name="cbOperationPrincipal" ValueSource="Product.ID_OperationPrincipal" DisplaySource="Product.OperationPrincipal_Product" NoSource="Product.OperationPrincipalNo_Product"
  157. ValueMember="ID_Employee" DataSource="OperationPrincipal" DisplayMember="Result" NoMember="No_Employee">
  158. <Events>
  159. <Reload>
  160. UpdateForm(false, "cbOperationPrincipal");
  161. Search("SearchOperationPrincipal");
  162. UpdateForm(true, "cbOperationPrincipal");
  163. </Reload>
  164. </Events>
  165. </IKComboBoxEx>
  166. <IKComboBoxEx name="cbPurchasePrincipal" ValueSource="Product.ID_PurchasePrincipal" DisplaySource="Product.PurchasePrincipal_Product" NoSource="Product.PurchasePrincipalNo_Product"
  167. ValueMember="ID_Employee" DataSource="PurchasePrincipal" DisplayMember="Result" NoMember="No_Employee">
  168. <Events>
  169. <Reload>
  170. UpdateForm(false, "cbPurchasePrincipal");
  171. Search("SearchPurchasePrincipal");
  172. UpdateForm(true, "cbPurchasePrincipal");
  173. </Reload>
  174. </Events>
  175. </IKComboBoxEx>
  176. <IKComboBoxEx name="cbCurrency" DisplaySource="Product.Currency_Product" DataSource="Product">
  177. </IKComboBoxEx>
  178. <IKNumericTextBox name="txtPrice" DataSource="Product.Price_Product">
  179. <Events>
  180. <Leave>
  181. <![CDATA[
  182. if(txtPrice.ReadOnly==false)
  183. {
  184. if(txtPrice.CValue==TypeConvert("Decimal","0.00"))
  185. txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
  186. else
  187. txtMaxDiscount.CValue=txtLowSalePrice.CValue/txtPrice.CValue*100;
  188. }
  189. ]]>
  190. </Leave>
  191. </Events>
  192. </IKNumericTextBox>
  193. <IKNumericTextBox name="txtLowSalePrice" DataSource="Product.LowSalePrice_Product">
  194. <Events>
  195. <Leave>
  196. <![CDATA[
  197. if(txtLowSalePrice.ReadOnly==false)
  198. {
  199. if(txtPrice.CValue==TypeConvert("Decimal","0.00"))
  200. txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
  201. else
  202. txtMaxDiscount.CValue=txtLowSalePrice.CValue/txtPrice.CValue*100;
  203. }
  204. ]]>
  205. </Leave>
  206. </Events>
  207. </IKNumericTextBox>
  208. <IKNumericTextBox name="txtMaxStocks" DataSource="Product.MaxStocks_Product"></IKNumericTextBox>
  209. <IKNumericTextBox name="txtSafetyStocks" DataSource="Product.SafetyQty_Product"></IKNumericTextBox>
  210. <IKDateTimeText name="dttCreateDate" DataSource="Product.CreateDate_Product"></IKDateTimeText>
  211. <IKComboBoxEx name="cbCostCurrency" ValueSource="Product.CostCurrency_Product" DisplaySource="Product.CostCurrency_Product"></IKComboBoxEx>
  212. <IKNumericTextBox name="txtCost" DataSource="Product.Cost_Product"></IKNumericTextBox>
  213. <IKTextBox name="txtMender" DataSource="Product.LastModUser_ProductName"></IKTextBox>
  214. <IKDateTimeText name="dttMendeDate" DataSource="Product.LastModDate_Product"></IKDateTimeText>
  215. <IKDateTimePause name="dtpSuspend" DataSource="Product.SuspendDate_Product"></IKDateTimePause>
  216. <IKDataGridEx name="dgSupplier" DataSource="ProductSupplier" TableStyleIndex="0">
  217. <DataColumn Index="0" DataSource="ProductSupplier.No_Supplier">
  218. <IKDataGridTextButtonColumn>
  219. <Events>
  220. <Click>
  221. @temp = ShowSearchBox("SupplierSearch","INFOMATION",#ProductSupplier.No_Supplier);
  222. if (@temp != "")
  223. {
  224. #ProductSupplier.No_Supplier = @temp;
  225. }
  226. </Click>
  227. </Events>
  228. </IKDataGridTextButtonColumn>
  229. </DataColumn>
  230. <DataColumn Index="1" DataSource="ProductSupplier.ShortName_Supplier" />
  231. <DataColumn Index="2" DataSource="ProductSupplier.IsMainStr_ProductSupplier" >
  232. <IKDataGridComboBoxColumn DisplaySourceEx="ProductSupplier.IsMainStr_ProductSupplier" ValueSourceEx="ProductSupplier.IsMain_ProductSupplier" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
  233. <Events>
  234. <Reload>
  235. Search("SearchIsMain");
  236. SetDataGridColumnDataSource(2,"dgSupplier");
  237. </Reload>
  238. </Events>
  239. </IKDataGridComboBoxColumn>
  240. </DataColumn>
  241. <DataColumn Index="3" DataSource="ProductSupplier.Comment_ProductSupplier" />
  242. </IKDataGridEx>
  243. <IKDataGridEx name="dgSpecification" DataSource="ProductSpecification" TableStyleIndex="0">
  244. <DataColumn Index="0" DataSource="ProductSpecification.Comment_ProductSpecification" />
  245. </IKDataGridEx>
  246. <IKDataGridEx name="dgHistory" DataSource="ExchangeHistory" TableStyleIndex="0">
  247. <DataColumn Index="0" DataSource="ExchangeHistory.Date" />
  248. <DataColumn Index="1" DataSource="ExchangeHistory.Name_Bill" />
  249. <DataColumn Index="2" DataSource="ExchangeHistory.No_Bill" />
  250. <DataColumn Index="3" DataSource="ExchangeHistory.No_CustomerOrSupprier" />
  251. <DataColumn Index="4" DataSource="ExchangeHistory.shortname" />
  252. <DataColumn Index="5" DataSource="ExchangeHistory.num" />
  253. <DataColumn Index="6" DataSource="ExchangeHistory.price" />
  254. <DataColumn Index="7" DataSource="ExchangeHistory.TaxCurrency" />
  255. <DataColumn Index="8" DataSource="ExchangeHistory.Comment" />
  256. <Events>
  257. <RowHeaderDoubleClick>
  258. DgDoubleClick(#ExchangeHistory.Name_Bill,#ExchangeHistory.No_Bill);
  259. </RowHeaderDoubleClick>
  260. </Events>
  261. </IKDataGridEx>
  262. <IKButton name="btSearch">
  263. <Events>
  264. <Click>
  265. <![CDATA[
  266. Empty("#ExchangeHistory");
  267. @cktn = 0;
  268. @Right=TypeConvert("String",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
  269. @RightIndentBill=GetFieldRight("订货单","特价单","查看");
  270. @RightSaleBill=GetFieldRight("销货单","特价单","查看");
  271. @StartTime = DBNull();
  272. @EndTime = DBNull();
  273. if(dtStart.Checked==true)
  274. @StartTime = dtStart.CValue;
  275. if(dtEnd.Checked==true)
  276. @EndTime = dtEnd.CValue;
  277. if(ckNearly.Checked==true)
  278. {
  279. @tbNearly=tbNearly.CValue;
  280. }
  281. if(ckPriceQuery.Checked == true)
  282. {
  283. @cktn = 1;
  284. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  285. {
  286. MergeTable("#searchAllBill","#ExchangeHistory");
  287. }
  288. }
  289. if(ckIndent.Checked == true)
  290. {
  291. @cktn = 2;
  292. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  293. {
  294. MergeTable("#searchAllBill","#ExchangeHistory");
  295. }
  296. }
  297. if(ckSaleBill.Checked == true)
  298. {
  299. @cktn = 3;
  300. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  301. {
  302. MergeTable("#searchAllBill","#ExchangeHistory");
  303. }
  304. }
  305. if(ckSaleRtn.Checked==true)
  306. {
  307. @cktn = 4;
  308. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  309. {
  310. MergeTable("#searchAllBill","#ExchangeHistory");
  311. }
  312. }
  313. if(ckSaleOut.Checked==true)
  314. {
  315. @cktn = 5;
  316. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  317. {
  318. MergeTable("#searchAllBill","#ExchangeHistory");
  319. }
  320. }
  321. if(ckPQuery.Checked==true)
  322. {
  323. @cktn = 6;
  324. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  325. {
  326. MergeTable("#searchAllBill","#ExchangeHistory");
  327. }
  328. }
  329. if(ckpurchase.Checked==true)
  330. {
  331. @cktn = 7;
  332. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  333. {
  334. MergeTable("#searchAllBill","#ExchangeHistory");
  335. }
  336. }
  337. if(ckInventory.Checked==true)
  338. {
  339. @cktn = 8;
  340. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  341. {
  342. MergeTable("#searchAllBill","#ExchangeHistory");
  343. }
  344. }
  345. if(ckPurchIn.Checked==true)
  346. {
  347. @cktn = 9;
  348. if(Search("searchAllBill",tbNo.CValue,GetCurrentUser(),@cktn,@StartTime,@EndTime))
  349. {
  350. MergeTable("#searchAllBill","#ExchangeHistory");
  351. }
  352. }
  353. if(RowCount("#ExchangeHistory") == 0)
  354. MessageBox("不存在符合查询条件的记录!");
  355. ]]></Click>
  356. </Events>
  357. </IKButton>
  358. <IKDataGridEx name="dgProduct" DataSource="ProductList" TableStyleIndex="0">
  359. <DataColumn Index="0" DataSource="ProductList.No_Product" />
  360. <DataColumn Index="1" DataSource="ProductList.Name_Product" />
  361. <Events>
  362. <RowHeaderDoubleClick>
  363. if(Search("SearchProductWithNo",#ProductList.No_Product))
  364. {
  365. ChangeMode("View");
  366. }
  367. </RowHeaderDoubleClick>
  368. </Events>
  369. </IKDataGridEx>
  370. <IKCheckBox name="ckDisplay" DataSource="Product.IsDisplay">
  371. <Events>
  372. <CheckedChanged>
  373. if(ckDisplay.Checked)
  374. Search("SearchAllProductList");
  375. else
  376. Search("SearchProductList");
  377. </CheckedChanged>
  378. </Events>
  379. </IKCheckBox>
  380. <IKFormToolBar name="toolBar">
  381. <Events>
  382. <ClickFirst>
  383. if(Search("SearchProductFirst", tbNo.CValue))
  384. {
  385. Empty("#ExchangeHistory");
  386. ChangeMode("View");
  387. }
  388. </ClickFirst>
  389. <ClickPrev>
  390. if(Search("SearchProductPrevious", tbNo.CValue))
  391. {
  392. Empty("#ExchangeHistory");
  393. ChangeMode("View");
  394. }
  395. </ClickPrev>
  396. <ClickNext>
  397. if(Search("SearchProductNext", tbNo.CValue))
  398. {
  399. Empty("#ExchangeHistory");
  400. ChangeMode("View");
  401. }
  402. </ClickNext>
  403. <ClickLast>
  404. if(Search("SearchProductLast", tbNo.CValue))
  405. {
  406. Empty("#ExchangeHistory");
  407. ChangeMode("View");
  408. }
  409. </ClickLast>
  410. <ClickNew>
  411. ;
  412. </ClickNew>
  413. <ClickEmpty>
  414. ChangeMode("Search");
  415. </ClickEmpty>
  416. <ClickSubmit>
  417. <Lable name="SubmitButtonClick" />
  418. </ClickSubmit>
  419. <ClickModify>
  420. ChangeMode("Modify");
  421. </ClickModify>
  422. <ClickDelete>
  423. Delete(); ChangeMode("Search");
  424. </ClickDelete>
  425. <ClickPrint>
  426. PrintReport();
  427. </ClickPrint>
  428. <ClickAudit>
  429. ;
  430. </ClickAudit>
  431. <ClickUnAudit>
  432. ;
  433. </ClickUnAudit>
  434. <ClickImport>
  435. ;
  436. </ClickImport>
  437. <ClickExport>
  438. ;
  439. </ClickExport>
  440. <ClickClose>
  441. ;
  442. </ClickClose>
  443. <ClickPrintBarCode>
  444. PrintBarCode("BarCodeProductSearch",#Product.No_Product,#Product.No_Product);
  445. </ClickPrintBarCode>
  446. <ClickExpand>
  447. if(toolBar.ExpandForm==true)
  448. {
  449. pnRight.Visible=true;<!--PanelRight is not existed-->
  450. if(!@HaveSearchProductList)
  451. {
  452. Search("SearchProductList");
  453. @HaveSearchProductList=true;
  454. }
  455. }
  456. else
  457. {
  458. pnRight.Visible=false;
  459. }
  460. </ClickExpand>
  461. </Events>
  462. </IKFormToolBar>
  463. </Controls>
  464. <Tables>
  465. <Table name="ProductSupplier">
  466. <Events>
  467. <ColumnsChanged>
  468. <No_Supplier>
  469. if(Search("GetSupplierNameByNo",#ProductSupplier.No_Supplier))
  470. {
  471. #ProductSupplier.ShortName_Supplier=#Supplier.ShortName_Supplier;
  472. #ProductSupplier.ID_Supplier=#Supplier.ID_Supplier;
  473. if(!Equals(#Supplier.SuspendDate_Supplier,DBNull()))
  474. MessageBox("该供应商已停用!",@Title);
  475. }
  476. else
  477. {
  478. MessageBox("该供应商不存在!",@Title);
  479. #ProductSupplier.ShortName_Supplier="";
  480. #ProductSupplier.ID_Supplier=GuidEmpty();
  481. @temp = ShowSearchBox("SupplierSearch","INFOMATION",#ProductSupplier.No_Supplier);
  482. if(@temp != "")
  483. {
  484. #ProductSupplier.No_Supplier = @temp;
  485. }
  486. }
  487. </No_Supplier>
  488. </ColumnsChanged>
  489. </Events>
  490. </Table>
  491. </Tables>
  492. <LockInfomation LockID="ID_Product" LockNO="No_Product" LockSearchFunction="SearchProductWithNo"/>
  493. <ChildForms>
  494. <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="SearchProductWithNo" MappingName="基本资料">
  495. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  496. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  497. <DataColumn Index="2" MappingName="#Product.Type_Product" HeaderText="产品类型" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  498. <DataColumn Index="3" MappingName="#Product.Price_Product" HeaderText="标准售价" Width="120" ColumnType="IKDataGridTextBoxColumn" Format="F2"/>
  499. <DataColumn Index="4" MappingName="#Product.LowSalePrice_Product" HeaderText="最低售价" Width="120" ColumnType="IKDataGridTextBoxColumn" Format="F2"/>
  500. <DataColumn Index="5" MappingName="#Product.SafetyQty_Product" HeaderText="安全存量" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  501. </ChildForm>
  502. <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="" MappingName="供应商">
  503. <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextButtonColumn"/>
  504. <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  505. </ChildForm>
  506. <ChildForm name="BarCodeProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="基本资料">
  507. <DataColumn Index="0" MappingName="#Product.BarCode_Product" HeaderText="产品条码" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  508. <DataColumn Index="1" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  509. <DataColumn Index="2" MappingName="#Product.Name_Product" HeaderText="产品名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  510. </ChildForm>
  511. </ChildForms>
  512. </Client>
  513. <Server>
  514. <Tables>
  515. <Table name="Product" Type="Parent">
  516. <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 Product.*,'' as OperationPrincipalNo_Product,'' as OperationPrincipal_Product,'' as PurchasePrincipal_Product,'' as PurchasePrincipalNo_Product,A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName,Convert(bit,1) As IsDisplay
  517. FROM Product
  518. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  519. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product"/>
  520. <New CmdType="Text" CmdText="INSERT INTO Product (ID_Product, No_Product, Name_Product, Unit_Product, InvoiceName_Product, Type_Product, Currency_Product, Price_Product, LowSalePriceCurrency_Product, LowSalePrice_Product, SafetyQty_Product, MaxStocks_Product, CostCurrency_Product, Cost_Product, Property_Product, Source_Product, ID_OperationPrincipal, ID_PurchasePrincipal, CreateDate_Product, ID_Creator, Comment_Product, SuspendDate_Product,LastModDate_Product,LastModUser_Product,BarCode_Product)
  521. VALUES(@ID_Product, @No_Product, @Name_Product, @Unit_Product, @InvoiceName_Product, @Type_Product, @Currency_Product, @Price_Product, @LowSalePriceCurrency_Product, @LowSalePrice_Product, @SafetyQty_Product, @MaxStocks_Product, @CostCurrency_Product, @Cost_Product, @Property_Product, @Source_Product, @ID_OperationPrincipal, @ID_PurchasePrincipal, @CreateDate_Product, @ID_Creator, @Comment_Product, @SuspendDate_Product,@LastModDate_Product,@LastModUser_Product,@BarCode_Product)">
  522. <Params>
  523. <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
  524. <Param name="@No_Product" type="Product.No_Product" sourceColumn="No_Product" />
  525. <Param name="@Name_Product" type="Product.Name_Product" sourceColumn="Name_Product" />
  526. <Param name="@Unit_Product" type="Product.Unit_Product" sourceColumn="Unit_Product" />
  527. <Param name="@InvoiceName_Product" type="Product.InvoiceName_Product" sourceColumn="InvoiceName_Product" />
  528. <Param name="@Type_Product" type="Product.Type_Product" sourceColumn="Type_Product" />
  529. <Param name="@Currency_Product" type="Product.Currency_Product" sourceColumn="Currency_Product" />
  530. <Param name="@Price_Product" type="Product.Price_Product" sourceColumn="Price_Product" />
  531. <Param name="@LowSalePriceCurrency_Product" type="Product.LowSalePriceCurrency_Product" sourceColumn="LowSalePriceCurrency_Product" />
  532. <Param name="@LowSalePrice_Product" type="Product.LowSalePrice_Product" sourceColumn="LowSalePrice_Product" />
  533. <Param name="@SafetyQty_Product" type="Product.SafetyQty_Product" sourceColumn="SafetyQty_Product" />
  534. <Param name="@MaxStocks_Product" type="Product.MaxStocks_Product" sourceColumn="MaxStocks_Product" />
  535. <Param name="@CostCurrency_Product" type="Product.CostCurrency_Product" sourceColumn="CostCurrency_Product" />
  536. <Param name="@Cost_Product" type="Product.Cost_Product" sourceColumn="Cost_Product" />
  537. <Param name="@Property_Product" type="Product.Property_Product" sourceColumn="Property_Product" />
  538. <Param name="@Source_Product" type="Product.Source_Product" sourceColumn="Source_Product" />
  539. <Param name="@ID_OperationPrincipal" type="Product.ID_OperationPrincipal" sourceColumn="ID_OperationPrincipal" />
  540. <Param name="@ID_PurchasePrincipal" type="Product.ID_PurchasePrincipal" sourceColumn="ID_PurchasePrincipal" />
  541. <Param name="@CreateDate_Product" type="Product.CreateDate_Product" sourceColumn="CreateDate_Product" />
  542. <Param name="@ID_Creator" type="Product.ID_Creator" sourceColumn="ID_Creator" />
  543. <Param name="@Comment_Product" type="Product.Comment_Product" sourceColumn="Comment_Product" />
  544. <Param name="@SuspendDate_Product" type="Product.SuspendDate_Product" sourceColumn="SuspendDate_Product" />
  545. <Param name="@LastModDate_Product" type="Product.LastModDate_Product" sourceColumn="LastModDate_Product" />
  546. <Param name="@LastModUser_Product" type="Product.LastModUser_Product" sourceColumn="LastModUser_Product" />
  547. <Param name="@BarCode_Product" type="Product.BarCode_Product" sourceColumn="BarCode_Product" />
  548. </Params>
  549. </New>
  550. <Update CmdType="Text" CmdText="UPDATE Product SET LastModDate_Product=@LastModDate_Product,LastModUser_Product=@LastModUser_Product,Name_Product = @Name_Product, Unit_Product = @Unit_Product, InvoiceName_Product = @InvoiceName_Product, Type_Product = @Type_Product, Currency_Product = @Currency_Product, Price_Product = @Price_Product, LowSalePriceCurrency_Product = @LowSalePriceCurrency_Product, LowSalePrice_Product = @LowSalePrice_Product, SafetyQty_Product = @SafetyQty_Product, MaxStocks_Product = @MaxStocks_Product, CostCurrency_Product = @CostCurrency_Product, Cost_Product = @Cost_Product, Property_Product = @Property_Product, Source_Product = @Source_Product, ID_OperationPrincipal = @ID_OperationPrincipal, ID_PurchasePrincipal = @ID_PurchasePrincipal, CreateDate_Product = @CreateDate_Product, ID_Creator = @ID_Creator, Comment_Product = @Comment_Product, SuspendDate_Product = @SuspendDate_Product,BarCode_Product = @BarCode_Product WHERE ID_Product = @ID_Product">
  551. <Params>
  552. <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
  553. <Param name="@Name_Product" type="Product.Name_Product" sourceColumn="Name_Product" />
  554. <Param name="@Unit_Product" type="Product.Unit_Product" sourceColumn="Unit_Product" />
  555. <Param name="@InvoiceName_Product" type="Product.InvoiceName_Product" sourceColumn="InvoiceName_Product" />
  556. <Param name="@Type_Product" type="Product.Type_Product" sourceColumn="Type_Product" />
  557. <Param name="@Currency_Product" type="Product.Currency_Product" sourceColumn="Currency_Product" />
  558. <Param name="@Price_Product" type="Product.Price_Product" sourceColumn="Price_Product" />
  559. <Param name="@LowSalePriceCurrency_Product" type="Product.LowSalePriceCurrency_Product" sourceColumn="LowSalePriceCurrency_Product" />
  560. <Param name="@LowSalePrice_Product" type="Product.LowSalePrice_Product" sourceColumn="LowSalePrice_Product" />
  561. <Param name="@SafetyQty_Product" type="Product.SafetyQty_Product" sourceColumn="SafetyQty_Product" />
  562. <Param name="@MaxStocks_Product" type="Product.MaxStocks_Product" sourceColumn="MaxStocks_Product" />
  563. <Param name="@CostCurrency_Product" type="Product.CostCurrency_Product" sourceColumn="CostCurrency_Product" />
  564. <Param name="@Cost_Product" type="Product.Cost_Product" sourceColumn="Cost_Product" />
  565. <Param name="@Property_Product" type="Product.Property_Product" sourceColumn="Property_Product" />
  566. <Param name="@Source_Product" type="Product.Source_Product" sourceColumn="Source_Product" />
  567. <Param name="@ID_OperationPrincipal" type="Product.ID_OperationPrincipal" sourceColumn="ID_OperationPrincipal" />
  568. <Param name="@ID_PurchasePrincipal" type="Product.ID_PurchasePrincipal" sourceColumn="ID_PurchasePrincipal" />
  569. <Param name="@CreateDate_Product" type="Product.CreateDate_Product" sourceColumn="CreateDate_Product" />
  570. <Param name="@ID_Creator" type="Product.ID_Creator" sourceColumn="ID_Creator" />
  571. <Param name="@Comment_Product" type="Product.Comment_Product" sourceColumn="Comment_Product" />
  572. <Param name="@SuspendDate_Product" type="Product.SuspendDate_Product" sourceColumn="SuspendDate_Product" />
  573. <Param name="@LastModDate_Product" type="Product.LastModDate_Product" sourceColumn="LastModDate_Product" />
  574. <Param name="@LastModUser_Product" type="Product.LastModUser_Product" sourceColumn="LastModUser_Product" />
  575. <Param name="@BarCode_Product" type="Product.BarCode_Product" sourceColumn="BarCode_Product" />
  576. </Params>
  577. </Update>
  578. <Delete CmdType="Text" CmdText="DELETE ProductSupplier WHERE ProductSupplier.ID_Product = @ID_Product
  579. DELETE ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product
  580. DELETE Product WHERE Product.ID_Product = @ID_Product">
  581. <Params>
  582. <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
  583. </Params>
  584. </Delete>
  585. <FKErrorReport ErrorMessage="该产品已被引用,删除失败!" />
  586. <UNIQUEErrorReport ErrorMessage="该产品编号或条码已存在,提交失败!" />
  587. </Table>
  588. <Table name="ProductSupplier" Type="Child">
  589. <GetSchema CmdType="Text" CmdText="SELECT TOP 0 ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,'' As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier"/>
  590. <New CmdType="Text" CmdText=" INSERT INTO ProductSupplier (ID_ProductSupplier, ID_Product, ID_Supplier, IsMain_ProductSupplier, Comment_ProductSupplier)
  591. VALUES (@ID_ProductSupplier, @ID_Product, @ID_Supplier, @IsMain_ProductSupplier, @Comment_ProductSupplier)">
  592. <Params>
  593. <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
  594. <Param name="@ID_Product" type="ProductSupplier.ID_Product" sourceColumn="ID_Product" />
  595. <Param name="@ID_Supplier" type="ProductSupplier.ID_Supplier" sourceColumn="ID_Supplier" />
  596. <Param name="@IsMain_ProductSupplier" type="ProductSupplier.IsMain_ProductSupplier" sourceColumn="IsMain_ProductSupplier" />
  597. <Param name="@Comment_ProductSupplier" type="ProductSupplier.Comment_ProductSupplier" sourceColumn="Comment_ProductSupplier" />
  598. </Params>
  599. </New>
  600. <Update CmdType="Text" CmdText="UPDATE ProductSupplier SET ID_Supplier = @ID_Supplier, IsMain_ProductSupplier = @IsMain_ProductSupplier, Comment_ProductSupplier = @Comment_ProductSupplier WHERE ID_ProductSupplier = @ID_ProductSupplier">
  601. <Params>
  602. <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
  603. <Param name="@ID_Supplier" type="ProductSupplier.ID_Supplier" sourceColumn="ID_Supplier" />
  604. <Param name="@IsMain_ProductSupplier" type="ProductSupplier.IsMain_ProductSupplier" sourceColumn="IsMain_ProductSupplier" />
  605. <Param name="@Comment_ProductSupplier" type="ProductSupplier.Comment_ProductSupplier" sourceColumn="Comment_ProductSupplier" />
  606. </Params>
  607. </Update>
  608. <Delete CmdType="Text" CmdText="DELETE ProductSupplier WHERE ProductSupplier.ID_ProductSupplier = @ID_ProductSupplier">
  609. <Params>
  610. <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
  611. </Params>
  612. </Delete>
  613. </Table>
  614. <Table name="ProductSpecification" Type="Child">
  615. <GetSchema CmdType="Text" CmdText="SELECT TOP 0 * FROM ProductSpecification"/>
  616. <New CmdType="Text" CmdText=" INSERT INTO ProductSpecification (ID_ProductSpecification, ID_Product, No_ProductSpecification, Comment_ProductSpecification)
  617. VALUES(@ID_ProductSpecification, @ID_Product,@No_ProductSpecification, @Comment_ProductSpecification)">
  618. <Params>
  619. <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
  620. <Param name="@ID_Product" type="ProductSpecification.ID_Product" sourceColumn="ID_Product" />
  621. <Param name="@No_ProductSpecification" type="ProductSpecification.No_ProductSpecification" sourceColumn="No_ProductSpecification" />
  622. <Param name="@Comment_ProductSpecification" type="ProductSpecification.Comment_ProductSpecification" sourceColumn="Comment_ProductSpecification" />
  623. </Params>
  624. </New>
  625. <Update CmdType="Text" CmdText="UPDATE ProductSpecification SET No_ProductSpecification = @No_ProductSpecification, Comment_ProductSpecification = @Comment_ProductSpecification WHERE ID_ProductSpecification = @ID_ProductSpecification">
  626. <Params>
  627. <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
  628. <Param name="@No_ProductSpecification" type="ProductSpecification.No_ProductSpecification" sourceColumn="No_ProductSpecification" />
  629. <Param name="@Comment_ProductSpecification" type="ProductSpecification.Comment_ProductSpecification" sourceColumn="Comment_ProductSpecification" />
  630. </Params>
  631. </Update>
  632. <Delete CmdType="Text" CmdText="DELETE ProductSpecification WHERE ProductSpecification.ID_ProductSpecification = @ID_ProductSpecification">
  633. <Params>
  634. <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
  635. </Params>
  636. </Delete>
  637. </Table>
  638. <Table name="Supplier" Type="Other">
  639. <GetSchema CmdType="Text" CmdText="SELECT top 0 Supplier.ID_Supplier,Supplier.No_Supplier, Supplier.ShortName_Supplier FROM Supplier" />
  640. </Table>
  641. <Table name="ProductList" Type="Other">
  642. <GetSchema CmdType="Text" CmdText="SELECT Top 0 Product.No_Product,Product.Name_Product FROM Product" />
  643. </Table>
  644. <Table name="ExchangeHistory" Type="Other">
  645. <GetSchema CmdType="Text" CmdText="SELECT Top 0 Date_SaleBill as Date,convert(nvarchar(64),'') as Name_Bill,
  646. convert(nvarchar(64),'') as No_Bill,convert(nvarchar(64),'') as No_CustomerOrSupprier,convert(nvarchar(64),'')as shortname,
  647. convert(decimal,0.00) as num,convert(decimal,0.00)as price,convert(nvarchar(64),'') as TaxCurrency,convert(nvarchar(200),'')as Comment
  648. FROM SaleBill" />
  649. </Table>
  650. </Tables>
  651. <Search>
  652. <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product,BarCode_Product,Type_Product, Price_Product, LowSalePrice_Product, SafetyQty_Product FROM Product ">
  653. <Tables>
  654. <Table name="AllProduct" />
  655. </Tables>
  656. </SearchAllProduct>
  657. <SearchProductList CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product Where SuspendDate_Product Is Null">
  658. <Tables>
  659. <Table name="ProductList" />
  660. </Tables>
  661. </SearchProductList>
  662. <SearchAllProductList CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product">
  663. <Tables>
  664. <Table name="ProductList" />
  665. </Tables>
  666. </SearchAllProductList>
  667. <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
  668. <Tables>
  669. <Table name="AllSupplier" />
  670. </Tables>
  671. </SearchAllSupplier>
  672. <SearchProductWithNo CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
  673. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product,A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  674. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  675. FROM Product
  676. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  677. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  678. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  679. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  680. where Product.No_Product = @No_Product
  681. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @No_Product
  682. SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
  683. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  684. <Params>
  685. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  686. </Params>
  687. <Tables>
  688. <Table name="Product" />
  689. <Table name="ProductSupplier" />
  690. <Table name="ProductSpecification" />
  691. </Tables>
  692. </SearchProductWithNo>
  693. <SearchUnit CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 7">
  694. <Tables>
  695. <Table name="Unit" />
  696. </Tables>
  697. </SearchUnit>
  698. <SearchType CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 8">
  699. <Tables>
  700. <Table name="Type" />
  701. </Tables>
  702. </SearchType>
  703. <SearchProperty CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 10">
  704. <Tables>
  705. <Table name="Property" />
  706. </Tables>
  707. </SearchProperty>
  708. <SearchSource CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 11">
  709. <Tables>
  710. <Table name="Source" />
  711. </Tables>
  712. </SearchSource>
  713. <SearchOperationPrincipal CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.Name_Employee AS Result,No_Employee FROM Employee order by No_Employee">
  714. <Tables>
  715. <Table name="OperationPrincipal" />
  716. </Tables>
  717. </SearchOperationPrincipal>
  718. <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
  719. <Tables>
  720. <Table name="SystemSetting"/>
  721. </Tables>
  722. </SearchSystemSetting>
  723. <SearchPurchasePrincipal CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.Name_Employee AS Result,No_Employee FROM Employee order by No_Employee">
  724. <Tables>
  725. <Table name="PurchasePrincipal" />
  726. </Tables>
  727. </SearchPurchasePrincipal>
  728. <GetSupplierNameByNo CmdType="Text" CmdText="SELECT Supplier.ID_Supplier, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.SuspendDate_Supplier FROM Supplier WHERE No_Supplier = @No_Supplier">
  729. <Params>
  730. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
  731. </Params>
  732. <Tables>
  733. <Table name="Supplier" />
  734. </Tables>
  735. </GetSupplierNameByNo>
  736. <SearchIsMain CmdType="Text" CmdText=" Create Table #IsMain
  737. (
  738. Result nvarchar(64),
  739. Value bit
  740. )
  741. Insert into #IsMain Values('是',1)
  742. Insert into #IsMain Values('否',0)
  743. Select * From #IsMain
  744. Drop Table #IsMain">
  745. <Tables>
  746. <Table name="IsMain" />
  747. </Tables>
  748. </SearchIsMain>
  749. <SearchProductFirst CmdType="Text" CmdText=" DECLARE @ID_Product uniqueidentifier
  750. DECLARE @NextNo nvarchar(64)
  751. SET @NextNo = @No_Product
  752. SELECT TOP 1 @NextNo = Product.No_Product FROM Product ORDER BY Product.No_Product
  753. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  754. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  755. FROM Product
  756. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  757. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  758. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  759. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  760. where Product.No_Product = @NextNo
  761. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
  762. SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
  763. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  764. <Params>
  765. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  766. </Params>
  767. <Tables>
  768. <Table name="Product" />
  769. <Table name="ProductSupplier" />
  770. <Table name="ProductSpecification" />
  771. </Tables>
  772. </SearchProductFirst>
  773. <SearchProductPrevious CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
  774. DECLARE @NextNo nvarchar(64)
  775. SET @NextNo = @No_Product
  776. SELECT TOP 1 @NextNo = Product.No_Product FROM Product WHERE Product.No_Product &lt; @No_Product ORDER BY Product.No_Product Desc
  777. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  778. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  779. FROM Product
  780. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  781. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  782. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  783. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  784. where Product.No_Product = @NextNo
  785. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
  786. SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
  787. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  788. <Params>
  789. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  790. </Params>
  791. <Tables>
  792. <Table name="Product" />
  793. <Table name="ProductSupplier" />
  794. <Table name="ProductSpecification" />
  795. </Tables>
  796. </SearchProductPrevious>
  797. <SearchProductNext CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
  798. DECLARE @NextNo nvarchar(64)
  799. SET @NextNo = @No_Product
  800. SELECT TOP 1 @NextNo = Product.No_Product FROM Product WHERE Product.No_Product &gt; @No_Product ORDER BY Product.No_Product
  801. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  802. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  803. FROM Product
  804. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  805. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  806. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  807. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  808. where Product.No_Product = @NextNo
  809. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
  810. SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
  811. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  812. <Params>
  813. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  814. </Params>
  815. <Tables>
  816. <Table name="Product" />
  817. <Table name="ProductSupplier" />
  818. <Table name="ProductSpecification" />
  819. </Tables>
  820. </SearchProductNext>
  821. <SearchProductLast CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
  822. DECLARE @NextNo nvarchar(64)
  823. SET @NextNo = @No_Product
  824. SELECT TOP 1 @NextNo = Product.No_Product FROM Product ORDER BY Product.No_Product DESC
  825. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  826. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  827. FROM Product
  828. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  829. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  830. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  831. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  832. where Product.No_Product = @NextNo
  833. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
  834. SELECT ProductSupplier.*, Supplier.No_Supplier AS No_Supplier,Supplier.ShortName_Supplier AS ShortName_Supplier,Case When ProductSupplier.IsMain_ProductSupplier = 1 Then '是' Else '否' End As IsMainStr_ProductSupplier FROM ProductSupplier INNER JOIN Supplier ON ProductSupplier.ID_Supplier = Supplier.ID_Supplier WHERE ProductSupplier.ID_Product = @ID_Product
  835. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  836. <Params>
  837. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  838. </Params>
  839. <Tables>
  840. <Table name="Product" />
  841. <Table name="ProductSupplier" />
  842. <Table name="ProductSpecification" />
  843. </Tables>
  844. </SearchProductLast>
  845. <SearchCessOut CmdType="Text" CmdText=" SELECT SystemSetting.CessOut_SystemSetting FROM SystemSetting">
  846. <Tables>
  847. <Table name="System" />
  848. </Tables>
  849. </SearchCessOut>
  850. <searchAllBill CmdType="Text" CmdText=" Declare @ID_Product Uniqueidentifier
  851. Select @ID_Product = ID_Product From Product Where No_Product =@No_Product
  852. SELECT * FROM
  853. (SELECT Top 0 convert(datetime,'') as Date,convert(nvarchar(64),'') as Name_Bill,
  854. convert(nvarchar(64),'') as No_Bill,convert(nvarchar(64),'') as No_CustomerOrSupprier,convert(nvarchar(64),'')as shortname,
  855. convert(decimal,0.00) as num,convert(decimal,0.00)as price,convert(nvarchar(200),'')as Comment,SaleBill.ID_Assessor as ID_Assessor,convert(nvarchar(64),'') as No_Product,convert(nvarchar(64),'') as TaxCurrency
  856. FROM SaleBill
  857. Union all
  858. select PriceQueryBill.Date_PriceQueryBill as Date
  859. ,convert(nvarchar(64),'报价单') as Name_Bill
  860. ,PriceQueryBill.No_PriceQueryBill as No_Bill
  861. ,Customer.No_Customer as No_CustomerOrSupprier
  862. ,Customer.ShortName_Customer as shortname
  863. ,PriceQueryBillProduct.Quantity_PriceQueryBillProduct as num,
  864. PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct as price,
  865. PriceQueryBillProduct.Comment_PriceQueryBillProduct as Comment,
  866. PriceQueryBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product
  867. ,PriceQueryBill.TaxCurrency_PriceQueryBill as TaxCurrency
  868. From PriceQueryBill
  869. join PriceQueryBillProduct on PriceQueryBill.ID_PriceQueryBill = PriceQueryBillProduct.ID_PriceQueryBill
  870. left join Customer on Customer.ID_Customer=PriceQueryBill.ID_Customer
  871. left join Product on PriceQueryBillProduct.ID_Product = Product.ID_Product
  872. where Customer.ID_Creator IS NOT NULL
  873. AND Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
  874. and PriceQueryBill.ID_Assessor is not null
  875. And @cktn =1
  876. union all
  877. select IndentBill.Date_IndentBill as Date,convert(nvarchar(64),'订货单') as Name_Bill,IndentBill.No_IndentBill as No_Bill,
  878. Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
  879. IndentBillProduct.Quantity_IndentBillProduct as num,
  880. IndentBillProduct.UnitPrice_IndentBillProduct as price,
  881. IndentBillProduct.Comment_IndentBillProduct as Comment,
  882. IndentBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,IndentBill.TaxCurrency_IndentBill as TaxCurrency
  883. from IndentBill
  884. join IndentBillProduct on IndentBill.ID_IndentBill=IndentBillProduct.ID_IndentBill
  885. left join Customer on Customer.ID_Customer=IndentBill.ID_Customer
  886. left join Product on IndentBillProduct.ID_Product = Product.ID_Product
  887. where Customer.ID_Creator is not null
  888. and IndentBill.ID_Assessor is not null
  889. AND Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
  890. And @cktn =2
  891. Union all
  892. select SaleBill.Date_SaleBill as Date,convert(nvarchar(64),'销货单') as Name_Bill,SaleBill.No_SaleBill as No_Bill,
  893. Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
  894. SaleBillProduct.Quantity_SaleBillProduct as num,
  895. SaleBillProduct.UnitPrice_SaleBillProduct as price,
  896. SaleBillProduct.Comment_SaleBillProduct as Comment,
  897. SaleBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,SaleBill.TaxCurrency_SaleBill as TaxCurrency
  898. from SaleBill
  899. join SaleBillProduct on SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill
  900. left join Customer on Customer.ID_Customer=SaleBill.ID_Customer
  901. left join Product on SaleBillProduct.ID_Product = Product.ID_Product
  902. where Customer.ID_Creator is not null
  903. AND Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
  904. And SaleBill.ID_Assessor is not null
  905. And @cktn =3
  906. Union all
  907. select SaleRtnBill.Date_SaleRtnBill as Date,convert(nvarchar(64),'销售退货单') as Name_Bill,SaleRtnBill.No_SaleRtnBill as No_Bill,
  908. Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
  909. SaleRtnBillProduct.Quantity_SaleRtnBillProduct as num,
  910. SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct as price,
  911. SaleRtnBillProduct.Comment_SaleRtnBillProduct as Comment,
  912. SaleRtnBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,SaleRtnBill.TaxCurrency_SaleRtnBill as TaxCurrency
  913. from SaleRtnBill
  914. join SaleRtnBillProduct on SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
  915. left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
  916. left join Product on SaleRtnBillProduct.ID_Product = Product.ID_Product
  917. where Customer.ID_Creator is not null
  918. AND Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
  919. and SaleRtnBill.ID_Assessor is not null
  920. And @cktn =4
  921. Union all
  922. select SaleOutDepotBill.Date_SaleOutDepotBill as Date,convert(nvarchar(64),'销货出库单') as Name_Bill,SaleOutDepotBill.No_SaleOutDepotBill as No_Bill,
  923. Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
  924. SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct as num,
  925. isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0.00) as price,
  926. SaleOutDepotBillProduct.Comment_SaleOutDepotBillProduct as Comment,
  927. SaleOutDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
  928. from SaleOutDepotBill
  929. join SaleOutDepotBillProduct on SaleOutDepotBill.ID_SaleOutDepotBill=SaleOutDepotBillProduct.ID_SaleOutDepotBill And SaleOutDepotBillProduct.ID_Product = @ID_Product
  930. left join Customer on Customer.ID_Customer=SaleOutDepotBill.ID_Customer
  931. left join Product on SaleOutDepotBillProduct.ID_Product = Product.ID_Product And SaleOutDepotBillProduct.ID_Product = @ID_Product
  932. left join SaleBillProduct on SaleBillProduct.ID_Product = @ID_Product And SaleOutDepotBillProduct.Type_FromBill=21
  933. and SaleOutDepotBillProduct.No_FromBill=(select SaleBill.No_SaleBill from SaleBill where SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill)
  934. and SaleOutDepotBillProduct.No_FromBillProduct=SaleBillProduct.No_SaleBillProduct
  935. where Customer.No_Customer in ( Select No_Customer From Customer Where ID_RegionalLeader in(Select ID_RegionalLeader From Principal Left join Employee on Employee.ID_Employee = Principal.ID_Employee Where Name_Employee = @Name_Employee))
  936. and SaleOutDepotBill.ID_Assessor is not null
  937. And @cktn =5
  938. Union all
  939. select PurchaseQueryBill.Date_PurchaseQueryBill as Date,convert(nvarchar(64),'询价单') as Name_Bill,PurchaseQueryBill.No_PurchaseQueryBill as No_Bill,
  940. Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
  941. PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct as num,
  942. PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct as price,
  943. PurchaseQueryBillProduct.Comment_PurchaseQueryBillProduct as Comment,
  944. PurchaseQueryBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,PurchaseQueryBill.TaxCurrency_PurchaseQueryBill as TaxCurrency
  945. from PurchaseQueryBill
  946. join PurchaseQueryBillProduct on PurchaseQueryBill.ID_PurchaseQueryBill=PurchaseQueryBillProduct.ID_PurchaseQueryBill
  947. left join Supplier on Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  948. left join Product on PurchaseQueryBillProduct.ID_Product = Product.ID_Product
  949. Where PurchaseQueryBill.ID_Assessor is not null
  950. And @cktn =6
  951. Union all
  952. select PurchaseOrderBill.Date_PurchaseOrderBill as Date,convert(nvarchar(64),'采购订单') as Name_Bill,PurchaseOrderBill.No_PurchaseOrderBill as No_Bill,
  953. Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
  954. PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct as num,
  955. PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct as price,
  956. PurchaseOrderBillProduct.Comment_PurchaseOrderBillProduct as Comment,
  957. PurchaseOrderBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,PurchaseOrderBill.TaxCurrency_PurchaseOrderBill as TaxCurrency
  958. from PurchaseOrderBill
  959. join PurchaseOrderBillProduct on PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill
  960. left join Supplier on Supplier.ID_Supplier=PurchaseOrderBill.ID_Supplier
  961. left join Product on PurchaseOrderBillProduct.ID_Product = Product.ID_Product
  962. Where PurchaseOrderBill.ID_Assessor is not null
  963. And @cktn =7
  964. Union all
  965. select ModifyDepotBill.Date_ModifyDepotBill as Date,convert(nvarchar(64),('库存异动作业'+'('+ModName_ModifyTypeSettings+')')) as Name_Bill,ModifyDepotBill.No_ModifyDepotBill as No_Bill,'' as No_CustomerOrSupprier,
  966. shortname= case when ModName_ModifyTypeSettings='销退入库' or ModName_ModifyTypeSettings='借出' or ModName_ModifyTypeSettings='借出归还' or ModName_ModifyTypeSettings='借入' or ModName_ModifyTypeSettings='借入归还' then ModifyDepotBill.Comment_ModifyDepotBill else '' end,
  967. ModifyDepotBillProduct.Quantity_ModifyDepotBillProduct as num,0 as price,ModifyDepotBillProduct.Comment_ModifyDepotBillProduct as Comment,
  968. ModifyDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
  969. from ModifyDepotBill
  970. join ModifyDepotBillProduct on ModifyDepotBill.ID_ModifyDepotBill=ModifyDepotBillProduct.ID_ModifyDepotBill
  971. left join Product on ModifyDepotBillProduct.ID_Product = Product.ID_Product
  972. LEFT JOIN ModifyTypeSettings ON ModifyTypeSettings.ID_ModifyTypeSettings = ModifyDepotBill.Style_ModifyDepotBill
  973. Where ModifyDepotBill.ID_Assessor is not null
  974. And @cktn =8
  975. Union all
  976. select PurchaseInDepotBill.Date_PurchaseInDepotBill as Date,convert(nvarchar(64),'采购入库单') as Name_Bill,PurchaseInDepotBill.No_PurchaseInDepotBill as No_Bill,
  977. Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
  978. PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct as num,
  979. isnull(PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct,0.00) as price,
  980. PurchaseInDepotBillProduct.Comment_PurchaseInDepotBillProduct as Comment,
  981. PurchaseInDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
  982. from PurchaseInDepotBill
  983. join PurchaseInDepotBillProduct on PurchaseInDepotBill.ID_PurchaseInDepotBill=PurchaseInDepotBillProduct.ID_PurchaseInDepotBill
  984. left join Supplier on Supplier.ID_Supplier=PurchaseInDepotBill.ID_Supplier
  985. left join Product on PurchaseInDepotBillProduct.ID_Product = Product.ID_Product
  986. left join PurchaseOrderBillProduct on PurchaseInDepotBillProduct.Type_FromBill=41
  987. and PurchaseInDepotBillProduct.No_FromBill=(select PurchaseOrderBill.No_PurchaseOrderBill from PurchaseOrderBill where PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill)
  988. and PurchaseInDepotBillProduct.No_FromBillProduct=PurchaseOrderBillProduct.No_PurchaseOrderBillProduct
  989. Where PurchaseInDepotBill.ID_Assessor is not null
  990. And @cktn =9
  991. )A
  992. where A.No_Product = @No_Product
  993. AND A.Date Between isnull(DateAdd(day,DateDiff(day,0,@StartTime),0),A.Date)
  994. AND Isnull(DateAdd(day,DateDiff(day,0,@EndTime),1),A.Date)
  995. Order By Date desc
  996. ">
  997. <Params>
  998. <Param name="@No_Product" type="Customer.No_Customer" />
  999. <Param name="@Name_Employee" type="Employee.Name_Employee" />
  1000. <Param name="@cktn" type="Customer.DunDate_Customer" />
  1001. <Param name="@StartTime" type="PurchaseInDepotBill.Date_PurchaseInDepotBill" />
  1002. <Param name="@EndTime" type="PurchaseInDepotBill.Date_PurchaseInDepotBill" />
  1003. </Params>
  1004. <Tables>
  1005. <Table name="searchAllBill" />
  1006. </Tables>
  1007. </searchAllBill>
  1008. </Search>
  1009. </Server>
  1010. <Lables>
  1011. <Search>
  1012. Empty();
  1013. Empty("#ExchangeHistory");
  1014. NewInstance();
  1015. tbNo.ReadOnly=false;
  1016. txtName.ReadOnly=true;
  1017. txtBarCode.ReadOnly=true;
  1018. cbUnit.Enabled=false;
  1019. txtInvoiceName.ReadOnly=true;
  1020. cbType.Enabled=false;
  1021. cbCurrency.Enabled=false;
  1022. #Product.Currency_Product=@SysCurrency;
  1023. #Product.LowSalePriceCurrency_Product=#Product.Currency_Product;
  1024. txtPrice.ReadOnly=true;
  1025. txtLowSalePrice.ReadOnly=true;
  1026. txtProperty.Enabled=false;
  1027. txtSource.Enabled=false;
  1028. cbOperationPrincipal.Enabled=false;
  1029. cbPurchasePrincipal.Enabled=false;
  1030. txtMaxStocks.ReadOnly=true;
  1031. txtSafetyStocks.ReadOnly=true;
  1032. txtComment.ReadOnly=true;
  1033. dtpSuspend.Enabled=false;
  1034. dgSupplier.ReadOnly=true;
  1035. dgSpecification.ReadOnly=true;
  1036. cbCostCurrency.Enabled=false;
  1037. txtCost.ReadOnly=true;
  1038. toolBar.EnableSubmit=false;
  1039. toolBar.EnableModify=false;
  1040. toolBar.EnableDelete=false;
  1041. toolBar.EnablePrint=false;
  1042. toolBar.EnablePrintBarCode=true;
  1043. #Product.CreateDate_Product=DBNull();
  1044. #Product.SuspendDate_Product=DBNull();
  1045. #Product.LastModUser_Product=DBNull();
  1046. #Product.LastModDate_Product=DBNull();
  1047. txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
  1048. if(ckDisplay.Checked)
  1049. #Product.IsDisplay=1;
  1050. else
  1051. #Product.IsDisplay=0;
  1052. UpdateForm(true, "");
  1053. tbNo.Focus();
  1054. @Status=0;
  1055. </Search>
  1056. <New>
  1057. tbNo.ReadOnly=true;
  1058. txtName.ReadOnly=false;
  1059. txtBarCode.ReadOnly=false;
  1060. cbUnit.Enabled=true;
  1061. txtInvoiceName.ReadOnly=false;
  1062. cbType.Enabled=true;
  1063. txtPrice.ReadOnly=false;
  1064. txtLowSalePrice.ReadOnly=false;
  1065. txtProperty.Enabled=true;
  1066. txtSource.Enabled=true;
  1067. cbOperationPrincipal.Enabled=true;
  1068. cbPurchasePrincipal.Enabled=true;
  1069. txtMaxStocks.ReadOnly=false;
  1070. txtSafetyStocks.ReadOnly=false;
  1071. txtComment.ReadOnly=false;
  1072. dtpSuspend.Enabled=true;
  1073. dgSupplier.ReadOnly=false;
  1074. dgSpecification.ReadOnly=false;
  1075. cbCostCurrency.Enabled=false;
  1076. txtCost.ReadOnly=true;
  1077. toolBar.EnableSubmit=GetRight(@Title,"新增");
  1078. toolBar.EnableModify=false;
  1079. toolBar.EnableDelete=false;
  1080. toolBar.EnablePrint=false;
  1081. toolBar.EnablePrintBarCode=false;
  1082. #Product.No_Product=tbNo.CValue;
  1083. #Product.CreatorName_Product=GetCurrentUser();
  1084. #Product.ID_Product=NewGuid();
  1085. #Product.ID_Creator=GetLoginUserID();
  1086. #Product.CreateDate_Product=DateTimeNow();
  1087. #Product.SuspendDate_Product=DBNull();
  1088. #Product.LastModUser_Product=DBNull();
  1089. #Product.LastModDate_Product=DBNull();
  1090. #Product.ID_OperationPrincipal=DBNull();
  1091. #Product.ID_PurchasePrincipal=DBNull();
  1092. if(ckDisplay.Checked)
  1093. #Product.IsDisplay=1;
  1094. else
  1095. #Product.IsDisplay=0;
  1096. UpdateForm(true, "");
  1097. txtName.Focus();
  1098. @Status=1;
  1099. </New>
  1100. <View>
  1101. tbNo.ReadOnly=false;
  1102. txtName.ReadOnly=true;
  1103. txtBarCode.ReadOnly=true;
  1104. cbUnit.Enabled=false;
  1105. txtInvoiceName.ReadOnly=true;
  1106. cbType.Enabled=false;
  1107. txtPrice.ReadOnly=true;
  1108. txtLowSalePrice.ReadOnly=true;
  1109. txtProperty.Enabled=false;
  1110. txtSource.Enabled=false;
  1111. cbOperationPrincipal.Enabled=false;
  1112. cbPurchasePrincipal.Enabled=false;
  1113. txtMaxStocks.ReadOnly=true;
  1114. txtSafetyStocks.ReadOnly=true;
  1115. txtComment.ReadOnly=true;
  1116. dtpSuspend.Enabled=false;
  1117. dgSupplier.ReadOnly=true;
  1118. dgSpecification.ReadOnly=true;
  1119. cbCostCurrency.Enabled=false;
  1120. txtCost.ReadOnly=true;
  1121. toolBar.EnableSubmit=false;
  1122. toolBar.EnableModify=GetRight(@Title,"修改");
  1123. toolBar.EnableDelete=GetRight(@Title,"删除");
  1124. toolBar.EnablePrint=GetRight(@Title,"打印");
  1125. toolBar.EnablePrintBarCode=true;
  1126. if(#Product.Price_Product!=TypeConvert("Decimal","0.00"))
  1127. txtMaxDiscount.CValue=#Product.LowSalePrice_Product/#Product.Price_Product*100;
  1128. else
  1129. txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
  1130. if(ckDisplay.Checked)
  1131. #Product.IsDisplay=1;
  1132. else
  1133. #Product.IsDisplay=0;
  1134. UpdateForm(true, "");
  1135. @Status=2;
  1136. </View>
  1137. <Modify>
  1138. tbNo.ReadOnly=true;
  1139. txtName.ReadOnly=false;
  1140. txtBarCode.ReadOnly=false;
  1141. cbUnit.Enabled=true;
  1142. txtInvoiceName.ReadOnly=false;
  1143. cbType.Enabled=true;
  1144. txtPrice.ReadOnly=false;
  1145. txtLowSalePrice.ReadOnly=false;
  1146. txtProperty.Enabled=true;
  1147. txtSource.Enabled=true;
  1148. cbOperationPrincipal.Enabled=true;
  1149. cbPurchasePrincipal.Enabled=true;
  1150. txtMaxStocks.ReadOnly=false;
  1151. txtSafetyStocks.ReadOnly=false;
  1152. txtComment.ReadOnly=false;
  1153. dtpSuspend.Enabled=true;
  1154. dgSupplier.ReadOnly=false;
  1155. dgSpecification.ReadOnly=false;
  1156. cbCostCurrency.Enabled=false;
  1157. txtCost.ReadOnly=true;
  1158. toolBar.EnableSubmit=GetRight(@Title,"新增");
  1159. toolBar.EnableModify=false;
  1160. toolBar.EnableDelete=GetRight(@Title,"删除");
  1161. toolBar.EnablePrint=false;
  1162. toolBar.EnablePrintBarCode=false;
  1163. #Product.LastModUser_ProductName=GetCurrentUser();
  1164. #Product.LastModUser_Product=GetLoginUserID();
  1165. #Product.LastModDate_Product=DateTimeNow();
  1166. if(ckDisplay.Checked)
  1167. #Product.IsDisplay=1;
  1168. else
  1169. #Product.IsDisplay=0;
  1170. UpdateForm(true, "");
  1171. txtName.Focus();
  1172. @Status=3;
  1173. </Modify>
  1174. <SubmitButtonClick>
  1175. <![CDATA[
  1176. if(txtName.CValue=="")
  1177. {
  1178. MessageBox("请输入产品名称!",@Title);
  1179. txtName.Focus();
  1180. return;
  1181. }
  1182. if(StringLength(txtBarCode.CValue) > 27)
  1183. {
  1184. MessageBox("条码长度不得超过27!",@Title);
  1185. txtBarCode.Focus();
  1186. return;
  1187. }
  1188. if(cbUnit.SelectedName=="")
  1189. {
  1190. tbDetail.SelectedIndex=0;
  1191. MessageBox("请输入基本单位!",@Title);
  1192. cbUnit.Focus();
  1193. return;
  1194. }
  1195. if(txtInvoiceName.CValue=="")
  1196. {
  1197. tbDetail.SelectedIndex=0;
  1198. MessageBox("请输入发票名称!",@Title);
  1199. txtInvoiceName.Focus();
  1200. return;
  1201. }
  1202. if(cbType.SelectedName=="")
  1203. {
  1204. tbDetail.SelectedIndex=0;
  1205. MessageBox("请输入产品大类!",@Title);
  1206. cbType.Focus();
  1207. return;
  1208. }
  1209. if(txtProperty.SelectedName=="")
  1210. {
  1211. tbDetail.SelectedIndex=0;
  1212. MessageBox("请输入产品性质!",@Title);
  1213. txtProperty.Focus();
  1214. return;
  1215. }
  1216. if(txtPrice.CValue>TypeConvert("Decimal","100000000000.00"))
  1217. {
  1218. MessageBox("标准售价不可以高于100000000000.00!",@Title);
  1219. txtPrice.Focus();
  1220. return;
  1221. }
  1222. if(txtLowSalePrice.CValue>txtPrice.CValue)
  1223. {
  1224. MessageBox("最低售价不可以高于标准售价!",@Title);
  1225. txtLowSalePrice.Focus();
  1226. return;
  1227. }
  1228. if(txtSafetyStocks.CValue>txtMaxStocks.CValue)
  1229. {
  1230. MessageBox("安全存量不可以高于最大库存量!",@Title);
  1231. txtSafetyStocks.Focus();
  1232. return;
  1233. }
  1234. UpdateForm(false, "");
  1235. if(@Status==1)
  1236. {
  1237. SuspendLayout();
  1238. for(@i=RowCount("#ProductSupplier")-1;@i>=0;@i=@i-1)
  1239. {
  1240. SetPosition("#ProductSupplier", @i);
  1241. if(Equals(#ProductSupplier.ID_ProductSupplier,GuidEmpty()))
  1242. #ProductSupplier.ID_ProductSupplier = NewGuid();
  1243. if(Equals(#ProductSupplier.ID_Supplier, GuidEmpty()))
  1244. {
  1245. dgSupplier.CurrentRowIndex=@i;
  1246. tbDetail.SelectedIndex=1;
  1247. MessageBox("该供应商不存在",@Title);
  1248. ResumeLayout();
  1249. return;
  1250. }
  1251. #ProductSupplier.ID_Product = #Product.ID_Product;
  1252. }
  1253. for(@i=RowCount("#ProductSpecification")-1;@i>=0;@i=@i-1)
  1254. {
  1255. SetPosition("#ProductSpecification", @i);
  1256. if(Equals(#ProductSpecification.ID_ProductSpecification,GuidEmpty()))
  1257. #ProductSpecification.ID_ProductSpecification = NewGuid();
  1258. #ProductSpecification.ID_Product = #Product.ID_Product;
  1259. }
  1260. ResumeLayout();
  1261. New();
  1262. }
  1263. else if(@Status == 3)
  1264. {
  1265. SuspendLayout();
  1266. for(@i=RowCount("#ProductSupplier")-1;@i>=0;@i=@i-1)
  1267. {
  1268. SetPosition("#ProductSupplier", @i);
  1269. if(Equals(#ProductSupplier.ID_ProductSupplier,GuidEmpty()))
  1270. #ProductSupplier.ID_ProductSupplier = NewGuid();
  1271. if(Equals(#ProductSupplier.ID_Supplier, GuidEmpty()))
  1272. {
  1273. dgSupplier.CurrentRowIndex=@i;
  1274. tbDetail.SelectedIndex=1;
  1275. MessageBox("该供应商不存在",@Title);
  1276. ResumeLayout();
  1277. return;
  1278. }
  1279. #ProductSupplier.ID_Product = #Product.ID_Product;
  1280. }
  1281. for(@i=RowCount("#ProductSpecification")-1;@i>=0;@i=@i-1)
  1282. {
  1283. SetPosition("#ProductSpecification", @i);
  1284. if(Equals(#ProductSpecification.ID_ProductSpecification,GuidEmpty()))
  1285. #ProductSpecification.ID_ProductSpecification = NewGuid();
  1286. #ProductSpecification.ID_Product = #Product.ID_Product;
  1287. }
  1288. ResumeLayout();
  1289. #Product.LastModDate_Product=DateTimeNow();
  1290. Update();
  1291. }
  1292. ChangeMode("View");
  1293. ]]>
  1294. </SubmitButtonClick>
  1295. </Lables>
  1296. </Form>
  1297. </Forms>