FrmProduct.xml 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322
  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. <DataColumn Index="6" MappingName="#Product.Comment_Product" HeaderText="备注" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  502. </ChildForm>
  503. <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="" MappingName="供应商">
  504. <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextButtonColumn"/>
  505. <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  506. </ChildForm>
  507. <ChildForm name="BarCodeProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="基本资料">
  508. <DataColumn Index="0" MappingName="#Product.BarCode_Product" HeaderText="产品条码" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  509. <DataColumn Index="1" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  510. <DataColumn Index="2" MappingName="#Product.Name_Product" HeaderText="产品名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  511. </ChildForm>
  512. </ChildForms>
  513. </Client>
  514. <Server>
  515. <Tables>
  516. <Table name="Product" Type="Parent">
  517. <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
  518. FROM Product
  519. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  520. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product"/>
  521. <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)
  522. 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)">
  523. <Params>
  524. <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
  525. <Param name="@No_Product" type="Product.No_Product" sourceColumn="No_Product" />
  526. <Param name="@Name_Product" type="Product.Name_Product" sourceColumn="Name_Product" />
  527. <Param name="@Unit_Product" type="Product.Unit_Product" sourceColumn="Unit_Product" />
  528. <Param name="@InvoiceName_Product" type="Product.InvoiceName_Product" sourceColumn="InvoiceName_Product" />
  529. <Param name="@Type_Product" type="Product.Type_Product" sourceColumn="Type_Product" />
  530. <Param name="@Currency_Product" type="Product.Currency_Product" sourceColumn="Currency_Product" />
  531. <Param name="@Price_Product" type="Product.Price_Product" sourceColumn="Price_Product" />
  532. <Param name="@LowSalePriceCurrency_Product" type="Product.LowSalePriceCurrency_Product" sourceColumn="LowSalePriceCurrency_Product" />
  533. <Param name="@LowSalePrice_Product" type="Product.LowSalePrice_Product" sourceColumn="LowSalePrice_Product" />
  534. <Param name="@SafetyQty_Product" type="Product.SafetyQty_Product" sourceColumn="SafetyQty_Product" />
  535. <Param name="@MaxStocks_Product" type="Product.MaxStocks_Product" sourceColumn="MaxStocks_Product" />
  536. <Param name="@CostCurrency_Product" type="Product.CostCurrency_Product" sourceColumn="CostCurrency_Product" />
  537. <Param name="@Cost_Product" type="Product.Cost_Product" sourceColumn="Cost_Product" />
  538. <Param name="@Property_Product" type="Product.Property_Product" sourceColumn="Property_Product" />
  539. <Param name="@Source_Product" type="Product.Source_Product" sourceColumn="Source_Product" />
  540. <Param name="@ID_OperationPrincipal" type="Product.ID_OperationPrincipal" sourceColumn="ID_OperationPrincipal" />
  541. <Param name="@ID_PurchasePrincipal" type="Product.ID_PurchasePrincipal" sourceColumn="ID_PurchasePrincipal" />
  542. <Param name="@CreateDate_Product" type="Product.CreateDate_Product" sourceColumn="CreateDate_Product" />
  543. <Param name="@ID_Creator" type="Product.ID_Creator" sourceColumn="ID_Creator" />
  544. <Param name="@Comment_Product" type="Product.Comment_Product" sourceColumn="Comment_Product" />
  545. <Param name="@SuspendDate_Product" type="Product.SuspendDate_Product" sourceColumn="SuspendDate_Product" />
  546. <Param name="@LastModDate_Product" type="Product.LastModDate_Product" sourceColumn="LastModDate_Product" />
  547. <Param name="@LastModUser_Product" type="Product.LastModUser_Product" sourceColumn="LastModUser_Product" />
  548. <Param name="@BarCode_Product" type="Product.BarCode_Product" sourceColumn="BarCode_Product" />
  549. </Params>
  550. </New>
  551. <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">
  552. <Params>
  553. <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
  554. <Param name="@Name_Product" type="Product.Name_Product" sourceColumn="Name_Product" />
  555. <Param name="@Unit_Product" type="Product.Unit_Product" sourceColumn="Unit_Product" />
  556. <Param name="@InvoiceName_Product" type="Product.InvoiceName_Product" sourceColumn="InvoiceName_Product" />
  557. <Param name="@Type_Product" type="Product.Type_Product" sourceColumn="Type_Product" />
  558. <Param name="@Currency_Product" type="Product.Currency_Product" sourceColumn="Currency_Product" />
  559. <Param name="@Price_Product" type="Product.Price_Product" sourceColumn="Price_Product" />
  560. <Param name="@LowSalePriceCurrency_Product" type="Product.LowSalePriceCurrency_Product" sourceColumn="LowSalePriceCurrency_Product" />
  561. <Param name="@LowSalePrice_Product" type="Product.LowSalePrice_Product" sourceColumn="LowSalePrice_Product" />
  562. <Param name="@SafetyQty_Product" type="Product.SafetyQty_Product" sourceColumn="SafetyQty_Product" />
  563. <Param name="@MaxStocks_Product" type="Product.MaxStocks_Product" sourceColumn="MaxStocks_Product" />
  564. <Param name="@CostCurrency_Product" type="Product.CostCurrency_Product" sourceColumn="CostCurrency_Product" />
  565. <Param name="@Cost_Product" type="Product.Cost_Product" sourceColumn="Cost_Product" />
  566. <Param name="@Property_Product" type="Product.Property_Product" sourceColumn="Property_Product" />
  567. <Param name="@Source_Product" type="Product.Source_Product" sourceColumn="Source_Product" />
  568. <Param name="@ID_OperationPrincipal" type="Product.ID_OperationPrincipal" sourceColumn="ID_OperationPrincipal" />
  569. <Param name="@ID_PurchasePrincipal" type="Product.ID_PurchasePrincipal" sourceColumn="ID_PurchasePrincipal" />
  570. <Param name="@CreateDate_Product" type="Product.CreateDate_Product" sourceColumn="CreateDate_Product" />
  571. <Param name="@ID_Creator" type="Product.ID_Creator" sourceColumn="ID_Creator" />
  572. <Param name="@Comment_Product" type="Product.Comment_Product" sourceColumn="Comment_Product" />
  573. <Param name="@SuspendDate_Product" type="Product.SuspendDate_Product" sourceColumn="SuspendDate_Product" />
  574. <Param name="@LastModDate_Product" type="Product.LastModDate_Product" sourceColumn="LastModDate_Product" />
  575. <Param name="@LastModUser_Product" type="Product.LastModUser_Product" sourceColumn="LastModUser_Product" />
  576. <Param name="@BarCode_Product" type="Product.BarCode_Product" sourceColumn="BarCode_Product" />
  577. </Params>
  578. </Update>
  579. <Delete CmdType="Text" CmdText="DELETE ProductSupplier WHERE ProductSupplier.ID_Product = @ID_Product
  580. DELETE ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product
  581. DELETE Product WHERE Product.ID_Product = @ID_Product">
  582. <Params>
  583. <Param name="@ID_Product" type="Product.ID_Product" sourceColumn="ID_Product" />
  584. </Params>
  585. </Delete>
  586. <FKErrorReport ErrorMessage="该产品已被引用,删除失败!" />
  587. <UNIQUEErrorReport ErrorMessage="该产品编号或条码已存在,提交失败!" />
  588. </Table>
  589. <Table name="ProductSupplier" Type="Child">
  590. <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"/>
  591. <New CmdType="Text" CmdText=" INSERT INTO ProductSupplier (ID_ProductSupplier, ID_Product, ID_Supplier, IsMain_ProductSupplier, Comment_ProductSupplier)
  592. VALUES (@ID_ProductSupplier, @ID_Product, @ID_Supplier, @IsMain_ProductSupplier, @Comment_ProductSupplier)">
  593. <Params>
  594. <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
  595. <Param name="@ID_Product" type="ProductSupplier.ID_Product" sourceColumn="ID_Product" />
  596. <Param name="@ID_Supplier" type="ProductSupplier.ID_Supplier" sourceColumn="ID_Supplier" />
  597. <Param name="@IsMain_ProductSupplier" type="ProductSupplier.IsMain_ProductSupplier" sourceColumn="IsMain_ProductSupplier" />
  598. <Param name="@Comment_ProductSupplier" type="ProductSupplier.Comment_ProductSupplier" sourceColumn="Comment_ProductSupplier" />
  599. </Params>
  600. </New>
  601. <Update CmdType="Text" CmdText="UPDATE ProductSupplier SET ID_Supplier = @ID_Supplier, IsMain_ProductSupplier = @IsMain_ProductSupplier, Comment_ProductSupplier = @Comment_ProductSupplier WHERE ID_ProductSupplier = @ID_ProductSupplier">
  602. <Params>
  603. <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
  604. <Param name="@ID_Supplier" type="ProductSupplier.ID_Supplier" sourceColumn="ID_Supplier" />
  605. <Param name="@IsMain_ProductSupplier" type="ProductSupplier.IsMain_ProductSupplier" sourceColumn="IsMain_ProductSupplier" />
  606. <Param name="@Comment_ProductSupplier" type="ProductSupplier.Comment_ProductSupplier" sourceColumn="Comment_ProductSupplier" />
  607. </Params>
  608. </Update>
  609. <Delete CmdType="Text" CmdText="DELETE ProductSupplier WHERE ProductSupplier.ID_ProductSupplier = @ID_ProductSupplier">
  610. <Params>
  611. <Param name="@ID_ProductSupplier" type="ProductSupplier.ID_ProductSupplier" sourceColumn="ID_ProductSupplier" />
  612. </Params>
  613. </Delete>
  614. </Table>
  615. <Table name="ProductSpecification" Type="Child">
  616. <GetSchema CmdType="Text" CmdText="SELECT TOP 0 * FROM ProductSpecification"/>
  617. <New CmdType="Text" CmdText=" INSERT INTO ProductSpecification (ID_ProductSpecification, ID_Product, No_ProductSpecification, Comment_ProductSpecification)
  618. VALUES(@ID_ProductSpecification, @ID_Product,@No_ProductSpecification, @Comment_ProductSpecification)">
  619. <Params>
  620. <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
  621. <Param name="@ID_Product" type="ProductSpecification.ID_Product" sourceColumn="ID_Product" />
  622. <Param name="@No_ProductSpecification" type="ProductSpecification.No_ProductSpecification" sourceColumn="No_ProductSpecification" />
  623. <Param name="@Comment_ProductSpecification" type="ProductSpecification.Comment_ProductSpecification" sourceColumn="Comment_ProductSpecification" />
  624. </Params>
  625. </New>
  626. <Update CmdType="Text" CmdText="UPDATE ProductSpecification SET No_ProductSpecification = @No_ProductSpecification, Comment_ProductSpecification = @Comment_ProductSpecification WHERE ID_ProductSpecification = @ID_ProductSpecification">
  627. <Params>
  628. <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
  629. <Param name="@No_ProductSpecification" type="ProductSpecification.No_ProductSpecification" sourceColumn="No_ProductSpecification" />
  630. <Param name="@Comment_ProductSpecification" type="ProductSpecification.Comment_ProductSpecification" sourceColumn="Comment_ProductSpecification" />
  631. </Params>
  632. </Update>
  633. <Delete CmdType="Text" CmdText="DELETE ProductSpecification WHERE ProductSpecification.ID_ProductSpecification = @ID_ProductSpecification">
  634. <Params>
  635. <Param name="@ID_ProductSpecification" type="ProductSpecification.ID_ProductSpecification" sourceColumn="ID_ProductSpecification" />
  636. </Params>
  637. </Delete>
  638. </Table>
  639. <Table name="Supplier" Type="Other">
  640. <GetSchema CmdType="Text" CmdText="SELECT top 0 Supplier.ID_Supplier,Supplier.No_Supplier, Supplier.ShortName_Supplier FROM Supplier" />
  641. </Table>
  642. <Table name="ProductList" Type="Other">
  643. <GetSchema CmdType="Text" CmdText="SELECT Top 0 Product.No_Product,Product.Name_Product FROM Product" />
  644. </Table>
  645. <Table name="ExchangeHistory" Type="Other">
  646. <GetSchema CmdType="Text" CmdText="SELECT Top 0 Date_SaleBill as Date,convert(nvarchar(64),'') as Name_Bill,
  647. convert(nvarchar(64),'') as No_Bill,convert(nvarchar(64),'') as No_CustomerOrSupprier,convert(nvarchar(64),'')as shortname,
  648. convert(decimal,0.00) as num,convert(decimal,0.00)as price,convert(nvarchar(64),'') as TaxCurrency,convert(nvarchar(200),'')as Comment
  649. FROM SaleBill" />
  650. </Table>
  651. </Tables>
  652. <Search>
  653. <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product,BarCode_Product,Type_Product, Price_Product, LowSalePrice_Product, SafetyQty_Product, Comment_Product FROM Product ">
  654. <Tables>
  655. <Table name="AllProduct" />
  656. </Tables>
  657. </SearchAllProduct>
  658. <SearchProductList CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product Where SuspendDate_Product Is Null">
  659. <Tables>
  660. <Table name="ProductList" />
  661. </Tables>
  662. </SearchProductList>
  663. <SearchAllProductList CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product">
  664. <Tables>
  665. <Table name="ProductList" />
  666. </Tables>
  667. </SearchAllProductList>
  668. <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
  669. <Tables>
  670. <Table name="AllSupplier" />
  671. </Tables>
  672. </SearchAllSupplier>
  673. <SearchProductWithNo CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
  674. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product,A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  675. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  676. FROM Product
  677. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  678. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  679. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  680. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  681. where Product.No_Product = @No_Product
  682. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @No_Product
  683. 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
  684. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  685. <Params>
  686. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  687. </Params>
  688. <Tables>
  689. <Table name="Product" />
  690. <Table name="ProductSupplier" />
  691. <Table name="ProductSpecification" />
  692. </Tables>
  693. </SearchProductWithNo>
  694. <SearchUnit CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 7">
  695. <Tables>
  696. <Table name="Unit" />
  697. </Tables>
  698. </SearchUnit>
  699. <SearchType CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 8">
  700. <Tables>
  701. <Table name="Type" />
  702. </Tables>
  703. </SearchType>
  704. <SearchProperty CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 10">
  705. <Tables>
  706. <Table name="Property" />
  707. </Tables>
  708. </SearchProperty>
  709. <SearchSource CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 11">
  710. <Tables>
  711. <Table name="Source" />
  712. </Tables>
  713. </SearchSource>
  714. <SearchOperationPrincipal CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.Name_Employee AS Result,No_Employee FROM Employee order by No_Employee">
  715. <Tables>
  716. <Table name="OperationPrincipal" />
  717. </Tables>
  718. </SearchOperationPrincipal>
  719. <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
  720. <Tables>
  721. <Table name="SystemSetting"/>
  722. </Tables>
  723. </SearchSystemSetting>
  724. <SearchPurchasePrincipal CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.Name_Employee AS Result,No_Employee FROM Employee order by No_Employee">
  725. <Tables>
  726. <Table name="PurchasePrincipal" />
  727. </Tables>
  728. </SearchPurchasePrincipal>
  729. <GetSupplierNameByNo CmdType="Text" CmdText="SELECT Supplier.ID_Supplier, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.SuspendDate_Supplier FROM Supplier WHERE No_Supplier = @No_Supplier">
  730. <Params>
  731. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
  732. </Params>
  733. <Tables>
  734. <Table name="Supplier" />
  735. </Tables>
  736. </GetSupplierNameByNo>
  737. <SearchIsMain CmdType="Text" CmdText=" Create Table #IsMain
  738. (
  739. Result nvarchar(64),
  740. Value bit
  741. )
  742. Insert into #IsMain Values('是',1)
  743. Insert into #IsMain Values('否',0)
  744. Select * From #IsMain
  745. Drop Table #IsMain">
  746. <Tables>
  747. <Table name="IsMain" />
  748. </Tables>
  749. </SearchIsMain>
  750. <SearchProductFirst CmdType="Text" CmdText=" DECLARE @ID_Product uniqueidentifier
  751. DECLARE @NextNo nvarchar(64)
  752. SET @NextNo = @No_Product
  753. SELECT TOP 1 @NextNo = Product.No_Product FROM Product ORDER BY Product.No_Product
  754. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  755. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  756. FROM Product
  757. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  758. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  759. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  760. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  761. where Product.No_Product = @NextNo
  762. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
  763. 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
  764. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  765. <Params>
  766. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  767. </Params>
  768. <Tables>
  769. <Table name="Product" />
  770. <Table name="ProductSupplier" />
  771. <Table name="ProductSpecification" />
  772. </Tables>
  773. </SearchProductFirst>
  774. <SearchProductPrevious CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
  775. DECLARE @NextNo nvarchar(64)
  776. SET @NextNo = @No_Product
  777. SELECT TOP 1 @NextNo = Product.No_Product FROM Product WHERE Product.No_Product &lt; @No_Product ORDER BY Product.No_Product Desc
  778. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  779. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  780. FROM Product
  781. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  782. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  783. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  784. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  785. where Product.No_Product = @NextNo
  786. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
  787. 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
  788. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  789. <Params>
  790. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  791. </Params>
  792. <Tables>
  793. <Table name="Product" />
  794. <Table name="ProductSupplier" />
  795. <Table name="ProductSpecification" />
  796. </Tables>
  797. </SearchProductPrevious>
  798. <SearchProductNext CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
  799. DECLARE @NextNo nvarchar(64)
  800. SET @NextNo = @No_Product
  801. SELECT TOP 1 @NextNo = Product.No_Product FROM Product WHERE Product.No_Product &gt; @No_Product ORDER BY Product.No_Product
  802. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  803. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  804. FROM Product
  805. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  806. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  807. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  808. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  809. where Product.No_Product = @NextNo
  810. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
  811. 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
  812. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  813. <Params>
  814. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  815. </Params>
  816. <Tables>
  817. <Table name="Product" />
  818. <Table name="ProductSupplier" />
  819. <Table name="ProductSpecification" />
  820. </Tables>
  821. </SearchProductNext>
  822. <SearchProductLast CmdType="Text" CmdText="DECLARE @ID_Product uniqueidentifier
  823. DECLARE @NextNo nvarchar(64)
  824. SET @NextNo = @No_Product
  825. SELECT TOP 1 @NextNo = Product.No_Product FROM Product ORDER BY Product.No_Product DESC
  826. SELECT Product.*,C.Name_Employee as OperationPrincipal_Product, A.Name_User AS CreatorName_Product,B.Name_User as LastModUser_ProductName
  827. ,D.Name_Employee as PurchasePrincipal_Product,D.No_Employee as PurchasePrincipalNo_Product,C.No_Employee as OperationPrincipalNo_Product
  828. FROM Product
  829. Left Join Employee D On D.ID_Employee=Product.ID_PurchasePrincipal
  830. LEFT JOIN AppUser A ON A.ID_User = Product.ID_Creator
  831. LEFT JOIN AppUser B ON B.ID_User = Product.LastModUser_Product
  832. Left Join Employee C On C.ID_Employee=Product.ID_OperationPrincipal
  833. where Product.No_Product = @NextNo
  834. SELECT @ID_Product = Product.ID_Product FROM Product WHERE Product.No_Product = @NextNo
  835. 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
  836. SELECT * FROM ProductSpecification WHERE ProductSpecification.ID_Product = @ID_Product">
  837. <Params>
  838. <Param name="@No_Product" type="Product.No_Product" Index="0" />
  839. </Params>
  840. <Tables>
  841. <Table name="Product" />
  842. <Table name="ProductSupplier" />
  843. <Table name="ProductSpecification" />
  844. </Tables>
  845. </SearchProductLast>
  846. <SearchCessOut CmdType="Text" CmdText=" SELECT SystemSetting.CessOut_SystemSetting FROM SystemSetting">
  847. <Tables>
  848. <Table name="System" />
  849. </Tables>
  850. </SearchCessOut>
  851. <searchAllBill CmdType="Text" CmdText=" Declare @ID_Product Uniqueidentifier
  852. Select @ID_Product = ID_Product From Product Where No_Product =@No_Product
  853. SELECT * FROM
  854. (SELECT Top 0 convert(datetime,'') as Date,convert(nvarchar(64),'') as Name_Bill,
  855. convert(nvarchar(64),'') as No_Bill,convert(nvarchar(64),'') as No_CustomerOrSupprier,convert(nvarchar(64),'')as shortname,
  856. 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
  857. FROM SaleBill
  858. Union all
  859. select PriceQueryBill.Date_PriceQueryBill as Date
  860. ,convert(nvarchar(64),'报价单') as Name_Bill
  861. ,PriceQueryBill.No_PriceQueryBill as No_Bill
  862. ,Customer.No_Customer as No_CustomerOrSupprier
  863. ,Customer.ShortName_Customer as shortname
  864. ,PriceQueryBillProduct.Quantity_PriceQueryBillProduct as num,
  865. PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct as price,
  866. PriceQueryBillProduct.Comment_PriceQueryBillProduct as Comment,
  867. PriceQueryBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product
  868. ,PriceQueryBill.TaxCurrency_PriceQueryBill as TaxCurrency
  869. From PriceQueryBill
  870. join PriceQueryBillProduct on PriceQueryBill.ID_PriceQueryBill = PriceQueryBillProduct.ID_PriceQueryBill
  871. left join Customer on Customer.ID_Customer=PriceQueryBill.ID_Customer
  872. left join Product on PriceQueryBillProduct.ID_Product = Product.ID_Product
  873. where Customer.ID_Creator IS NOT NULL
  874. 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))
  875. and PriceQueryBill.ID_Assessor is not null
  876. And @cktn =1
  877. union all
  878. select IndentBill.Date_IndentBill as Date,convert(nvarchar(64),'订货单') as Name_Bill,IndentBill.No_IndentBill as No_Bill,
  879. Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
  880. IndentBillProduct.Quantity_IndentBillProduct as num,
  881. IndentBillProduct.UnitPrice_IndentBillProduct as price,
  882. IndentBillProduct.Comment_IndentBillProduct as Comment,
  883. IndentBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,IndentBill.TaxCurrency_IndentBill as TaxCurrency
  884. from IndentBill
  885. join IndentBillProduct on IndentBill.ID_IndentBill=IndentBillProduct.ID_IndentBill
  886. left join Customer on Customer.ID_Customer=IndentBill.ID_Customer
  887. left join Product on IndentBillProduct.ID_Product = Product.ID_Product
  888. where Customer.ID_Creator is not null
  889. and IndentBill.ID_Assessor is not null
  890. 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))
  891. And @cktn =2
  892. Union all
  893. select SaleBill.Date_SaleBill as Date,convert(nvarchar(64),'销货单') as Name_Bill,SaleBill.No_SaleBill as No_Bill,
  894. Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
  895. SaleBillProduct.Quantity_SaleBillProduct as num,
  896. SaleBillProduct.UnitPrice_SaleBillProduct as price,
  897. SaleBillProduct.Comment_SaleBillProduct as Comment,
  898. SaleBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,SaleBill.TaxCurrency_SaleBill as TaxCurrency
  899. from SaleBill
  900. join SaleBillProduct on SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill
  901. left join Customer on Customer.ID_Customer=SaleBill.ID_Customer
  902. left join Product on SaleBillProduct.ID_Product = Product.ID_Product
  903. where Customer.ID_Creator is not null
  904. 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))
  905. And SaleBill.ID_Assessor is not null
  906. And @cktn =3
  907. Union all
  908. select SaleRtnBill.Date_SaleRtnBill as Date,convert(nvarchar(64),'销售退货单') as Name_Bill,SaleRtnBill.No_SaleRtnBill as No_Bill,
  909. Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
  910. SaleRtnBillProduct.Quantity_SaleRtnBillProduct as num,
  911. SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct as price,
  912. SaleRtnBillProduct.Comment_SaleRtnBillProduct as Comment,
  913. SaleRtnBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,SaleRtnBill.TaxCurrency_SaleRtnBill as TaxCurrency
  914. from SaleRtnBill
  915. join SaleRtnBillProduct on SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
  916. left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
  917. left join Product on SaleRtnBillProduct.ID_Product = Product.ID_Product
  918. where Customer.ID_Creator is not null
  919. 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))
  920. and SaleRtnBill.ID_Assessor is not null
  921. And @cktn =4
  922. Union all
  923. select SaleOutDepotBill.Date_SaleOutDepotBill as Date,convert(nvarchar(64),'销货出库单') as Name_Bill,SaleOutDepotBill.No_SaleOutDepotBill as No_Bill,
  924. Customer.No_Customer as No_CustomerOrSupprier,Customer.ShortName_Customer as shortname,
  925. SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct as num,
  926. isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0.00) as price,
  927. SaleOutDepotBillProduct.Comment_SaleOutDepotBillProduct as Comment,
  928. SaleOutDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
  929. from SaleOutDepotBill
  930. join SaleOutDepotBillProduct on SaleOutDepotBill.ID_SaleOutDepotBill=SaleOutDepotBillProduct.ID_SaleOutDepotBill And SaleOutDepotBillProduct.ID_Product = @ID_Product
  931. left join Customer on Customer.ID_Customer=SaleOutDepotBill.ID_Customer
  932. left join Product on SaleOutDepotBillProduct.ID_Product = Product.ID_Product And SaleOutDepotBillProduct.ID_Product = @ID_Product
  933. left join SaleBillProduct on SaleBillProduct.ID_Product = @ID_Product And SaleOutDepotBillProduct.Type_FromBill=21
  934. and SaleOutDepotBillProduct.No_FromBill=(select SaleBill.No_SaleBill from SaleBill where SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill)
  935. and SaleOutDepotBillProduct.No_FromBillProduct=SaleBillProduct.No_SaleBillProduct
  936. 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))
  937. and SaleOutDepotBill.ID_Assessor is not null
  938. And @cktn =5
  939. Union all
  940. select PurchaseQueryBill.Date_PurchaseQueryBill as Date,convert(nvarchar(64),'询价单') as Name_Bill,PurchaseQueryBill.No_PurchaseQueryBill as No_Bill,
  941. Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
  942. PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct as num,
  943. PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct as price,
  944. PurchaseQueryBillProduct.Comment_PurchaseQueryBillProduct as Comment,
  945. PurchaseQueryBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,PurchaseQueryBill.TaxCurrency_PurchaseQueryBill as TaxCurrency
  946. from PurchaseQueryBill
  947. join PurchaseQueryBillProduct on PurchaseQueryBill.ID_PurchaseQueryBill=PurchaseQueryBillProduct.ID_PurchaseQueryBill
  948. left join Supplier on Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  949. left join Product on PurchaseQueryBillProduct.ID_Product = Product.ID_Product
  950. Where PurchaseQueryBill.ID_Assessor is not null
  951. And @cktn =6
  952. Union all
  953. select PurchaseOrderBill.Date_PurchaseOrderBill as Date,convert(nvarchar(64),'采购订单') as Name_Bill,PurchaseOrderBill.No_PurchaseOrderBill as No_Bill,
  954. Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
  955. PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct as num,
  956. PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct as price,
  957. PurchaseOrderBillProduct.Comment_PurchaseOrderBillProduct as Comment,
  958. PurchaseOrderBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,PurchaseOrderBill.TaxCurrency_PurchaseOrderBill as TaxCurrency
  959. from PurchaseOrderBill
  960. join PurchaseOrderBillProduct on PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill
  961. left join Supplier on Supplier.ID_Supplier=PurchaseOrderBill.ID_Supplier
  962. left join Product on PurchaseOrderBillProduct.ID_Product = Product.ID_Product
  963. Where PurchaseOrderBill.ID_Assessor is not null
  964. And @cktn =7
  965. Union all
  966. select ModifyDepotBill.Date_ModifyDepotBill as Date,convert(nvarchar(64),('库存异动作业'+'('+ModName_ModifyTypeSettings+')')) as Name_Bill,ModifyDepotBill.No_ModifyDepotBill as No_Bill,'' as No_CustomerOrSupprier,
  967. shortname= case when ModName_ModifyTypeSettings='销退入库' or ModName_ModifyTypeSettings='借出' or ModName_ModifyTypeSettings='借出归还' or ModName_ModifyTypeSettings='借入' or ModName_ModifyTypeSettings='借入归还' then ModifyDepotBill.Comment_ModifyDepotBill else '' end,
  968. ModifyDepotBillProduct.Quantity_ModifyDepotBillProduct as num,0 as price,ModifyDepotBillProduct.Comment_ModifyDepotBillProduct as Comment,
  969. ModifyDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
  970. from ModifyDepotBill
  971. join ModifyDepotBillProduct on ModifyDepotBill.ID_ModifyDepotBill=ModifyDepotBillProduct.ID_ModifyDepotBill
  972. left join Product on ModifyDepotBillProduct.ID_Product = Product.ID_Product
  973. LEFT JOIN ModifyTypeSettings ON ModifyTypeSettings.ID_ModifyTypeSettings = ModifyDepotBill.Style_ModifyDepotBill
  974. Where ModifyDepotBill.ID_Assessor is not null
  975. And @cktn =8
  976. Union all
  977. select PurchaseInDepotBill.Date_PurchaseInDepotBill as Date,convert(nvarchar(64),'采购入库单') as Name_Bill,PurchaseInDepotBill.No_PurchaseInDepotBill as No_Bill,
  978. Supplier.No_Supplier as No_CustomerOrSupprier,Supplier.ShortName_Supplier as shortname,
  979. PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct as num,
  980. isnull(PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct,0.00) as price,
  981. PurchaseInDepotBillProduct.Comment_PurchaseInDepotBillProduct as Comment,
  982. PurchaseInDepotBill.ID_Assessor as ID_Assessor,Product.No_Product as No_Product,'' as TaxCurrency
  983. from PurchaseInDepotBill
  984. join PurchaseInDepotBillProduct on PurchaseInDepotBill.ID_PurchaseInDepotBill=PurchaseInDepotBillProduct.ID_PurchaseInDepotBill
  985. left join Supplier on Supplier.ID_Supplier=PurchaseInDepotBill.ID_Supplier
  986. left join Product on PurchaseInDepotBillProduct.ID_Product = Product.ID_Product
  987. left join PurchaseOrderBillProduct on PurchaseInDepotBillProduct.Type_FromBill=41
  988. and PurchaseInDepotBillProduct.No_FromBill=(select PurchaseOrderBill.No_PurchaseOrderBill from PurchaseOrderBill where PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill)
  989. and PurchaseInDepotBillProduct.No_FromBillProduct=PurchaseOrderBillProduct.No_PurchaseOrderBillProduct
  990. Where PurchaseInDepotBill.ID_Assessor is not null
  991. And @cktn =9
  992. )A
  993. where A.No_Product = @No_Product
  994. AND A.Date Between isnull(DateAdd(day,DateDiff(day,0,@StartTime),0),A.Date)
  995. AND Isnull(DateAdd(day,DateDiff(day,0,@EndTime),1),A.Date)
  996. Order By Date desc
  997. ">
  998. <Params>
  999. <Param name="@No_Product" type="Customer.No_Customer" />
  1000. <Param name="@Name_Employee" type="Employee.Name_Employee" />
  1001. <Param name="@cktn" type="Customer.DunDate_Customer" />
  1002. <Param name="@StartTime" type="PurchaseInDepotBill.Date_PurchaseInDepotBill" />
  1003. <Param name="@EndTime" type="PurchaseInDepotBill.Date_PurchaseInDepotBill" />
  1004. </Params>
  1005. <Tables>
  1006. <Table name="searchAllBill" />
  1007. </Tables>
  1008. </searchAllBill>
  1009. </Search>
  1010. </Server>
  1011. <Lables>
  1012. <Search>
  1013. Empty();
  1014. Empty("#ExchangeHistory");
  1015. NewInstance();
  1016. tbNo.ReadOnly=false;
  1017. txtName.ReadOnly=true;
  1018. txtBarCode.ReadOnly=true;
  1019. cbUnit.Enabled=false;
  1020. txtInvoiceName.ReadOnly=true;
  1021. cbType.Enabled=false;
  1022. cbCurrency.Enabled=false;
  1023. #Product.Currency_Product=@SysCurrency;
  1024. #Product.LowSalePriceCurrency_Product=#Product.Currency_Product;
  1025. txtPrice.ReadOnly=true;
  1026. txtLowSalePrice.ReadOnly=true;
  1027. txtProperty.Enabled=false;
  1028. txtSource.Enabled=false;
  1029. cbOperationPrincipal.Enabled=false;
  1030. cbPurchasePrincipal.Enabled=false;
  1031. txtMaxStocks.ReadOnly=true;
  1032. txtSafetyStocks.ReadOnly=true;
  1033. txtComment.ReadOnly=true;
  1034. dtpSuspend.Enabled=false;
  1035. dgSupplier.ReadOnly=true;
  1036. dgSpecification.ReadOnly=true;
  1037. cbCostCurrency.Enabled=false;
  1038. txtCost.ReadOnly=true;
  1039. toolBar.EnableSubmit=false;
  1040. toolBar.EnableModify=false;
  1041. toolBar.EnableDelete=false;
  1042. toolBar.EnablePrint=false;
  1043. toolBar.EnablePrintBarCode=true;
  1044. #Product.CreateDate_Product=DBNull();
  1045. #Product.SuspendDate_Product=DBNull();
  1046. #Product.LastModUser_Product=DBNull();
  1047. #Product.LastModDate_Product=DBNull();
  1048. txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
  1049. if(ckDisplay.Checked)
  1050. #Product.IsDisplay=1;
  1051. else
  1052. #Product.IsDisplay=0;
  1053. UpdateForm(true, "");
  1054. tbNo.Focus();
  1055. @Status=0;
  1056. </Search>
  1057. <New>
  1058. tbNo.ReadOnly=true;
  1059. txtName.ReadOnly=false;
  1060. txtBarCode.ReadOnly=false;
  1061. cbUnit.Enabled=true;
  1062. txtInvoiceName.ReadOnly=false;
  1063. cbType.Enabled=true;
  1064. txtPrice.ReadOnly=false;
  1065. txtLowSalePrice.ReadOnly=false;
  1066. txtProperty.Enabled=true;
  1067. txtSource.Enabled=true;
  1068. cbOperationPrincipal.Enabled=true;
  1069. cbPurchasePrincipal.Enabled=true;
  1070. txtMaxStocks.ReadOnly=false;
  1071. txtSafetyStocks.ReadOnly=false;
  1072. txtComment.ReadOnly=false;
  1073. dtpSuspend.Enabled=true;
  1074. dgSupplier.ReadOnly=false;
  1075. dgSpecification.ReadOnly=false;
  1076. cbCostCurrency.Enabled=false;
  1077. txtCost.ReadOnly=true;
  1078. toolBar.EnableSubmit=GetRight(@Title,"新增");
  1079. toolBar.EnableModify=false;
  1080. toolBar.EnableDelete=false;
  1081. toolBar.EnablePrint=false;
  1082. toolBar.EnablePrintBarCode=false;
  1083. #Product.No_Product=tbNo.CValue;
  1084. #Product.CreatorName_Product=GetCurrentUser();
  1085. #Product.ID_Product=NewGuid();
  1086. #Product.ID_Creator=GetLoginUserID();
  1087. #Product.CreateDate_Product=DateTimeNow();
  1088. #Product.SuspendDate_Product=DBNull();
  1089. #Product.LastModUser_Product=DBNull();
  1090. #Product.LastModDate_Product=DBNull();
  1091. #Product.ID_OperationPrincipal=DBNull();
  1092. #Product.ID_PurchasePrincipal=DBNull();
  1093. if(ckDisplay.Checked)
  1094. #Product.IsDisplay=1;
  1095. else
  1096. #Product.IsDisplay=0;
  1097. UpdateForm(true, "");
  1098. txtName.Focus();
  1099. @Status=1;
  1100. </New>
  1101. <View>
  1102. tbNo.ReadOnly=false;
  1103. txtName.ReadOnly=true;
  1104. txtBarCode.ReadOnly=true;
  1105. cbUnit.Enabled=false;
  1106. txtInvoiceName.ReadOnly=true;
  1107. cbType.Enabled=false;
  1108. txtPrice.ReadOnly=true;
  1109. txtLowSalePrice.ReadOnly=true;
  1110. txtProperty.Enabled=false;
  1111. txtSource.Enabled=false;
  1112. cbOperationPrincipal.Enabled=false;
  1113. cbPurchasePrincipal.Enabled=false;
  1114. txtMaxStocks.ReadOnly=true;
  1115. txtSafetyStocks.ReadOnly=true;
  1116. txtComment.ReadOnly=true;
  1117. dtpSuspend.Enabled=false;
  1118. dgSupplier.ReadOnly=true;
  1119. dgSpecification.ReadOnly=true;
  1120. cbCostCurrency.Enabled=false;
  1121. txtCost.ReadOnly=true;
  1122. toolBar.EnableSubmit=false;
  1123. toolBar.EnableModify=GetRight(@Title,"修改");
  1124. toolBar.EnableDelete=GetRight(@Title,"删除");
  1125. toolBar.EnablePrint=GetRight(@Title,"打印");
  1126. toolBar.EnablePrintBarCode=true;
  1127. if(#Product.Price_Product!=TypeConvert("Decimal","0.00"))
  1128. txtMaxDiscount.CValue=#Product.LowSalePrice_Product/#Product.Price_Product*100;
  1129. else
  1130. txtMaxDiscount.CValue=TypeConvert("Decimal","0.00");
  1131. if(ckDisplay.Checked)
  1132. #Product.IsDisplay=1;
  1133. else
  1134. #Product.IsDisplay=0;
  1135. UpdateForm(true, "");
  1136. @Status=2;
  1137. </View>
  1138. <Modify>
  1139. tbNo.ReadOnly=true;
  1140. txtName.ReadOnly=false;
  1141. txtBarCode.ReadOnly=false;
  1142. cbUnit.Enabled=true;
  1143. txtInvoiceName.ReadOnly=false;
  1144. cbType.Enabled=true;
  1145. txtPrice.ReadOnly=false;
  1146. txtLowSalePrice.ReadOnly=false;
  1147. txtProperty.Enabled=true;
  1148. txtSource.Enabled=true;
  1149. cbOperationPrincipal.Enabled=true;
  1150. cbPurchasePrincipal.Enabled=true;
  1151. txtMaxStocks.ReadOnly=false;
  1152. txtSafetyStocks.ReadOnly=false;
  1153. txtComment.ReadOnly=false;
  1154. dtpSuspend.Enabled=true;
  1155. dgSupplier.ReadOnly=false;
  1156. dgSpecification.ReadOnly=false;
  1157. cbCostCurrency.Enabled=false;
  1158. txtCost.ReadOnly=true;
  1159. toolBar.EnableSubmit=GetRight(@Title,"新增");
  1160. toolBar.EnableModify=false;
  1161. toolBar.EnableDelete=GetRight(@Title,"删除");
  1162. toolBar.EnablePrint=false;
  1163. toolBar.EnablePrintBarCode=false;
  1164. #Product.LastModUser_ProductName=GetCurrentUser();
  1165. #Product.LastModUser_Product=GetLoginUserID();
  1166. #Product.LastModDate_Product=DateTimeNow();
  1167. if(ckDisplay.Checked)
  1168. #Product.IsDisplay=1;
  1169. else
  1170. #Product.IsDisplay=0;
  1171. UpdateForm(true, "");
  1172. txtName.Focus();
  1173. @Status=3;
  1174. </Modify>
  1175. <SubmitButtonClick>
  1176. <![CDATA[
  1177. if(txtName.CValue=="")
  1178. {
  1179. MessageBox("请输入产品名称!",@Title);
  1180. txtName.Focus();
  1181. return;
  1182. }
  1183. if(StringLength(txtBarCode.CValue) > 27)
  1184. {
  1185. MessageBox("条码长度不得超过27!",@Title);
  1186. txtBarCode.Focus();
  1187. return;
  1188. }
  1189. if(cbUnit.SelectedName=="")
  1190. {
  1191. tbDetail.SelectedIndex=0;
  1192. MessageBox("请输入基本单位!",@Title);
  1193. cbUnit.Focus();
  1194. return;
  1195. }
  1196. if(txtInvoiceName.CValue=="")
  1197. {
  1198. tbDetail.SelectedIndex=0;
  1199. MessageBox("请输入发票名称!",@Title);
  1200. txtInvoiceName.Focus();
  1201. return;
  1202. }
  1203. if(cbType.SelectedName=="")
  1204. {
  1205. tbDetail.SelectedIndex=0;
  1206. MessageBox("请输入产品大类!",@Title);
  1207. cbType.Focus();
  1208. return;
  1209. }
  1210. if(txtProperty.SelectedName=="")
  1211. {
  1212. tbDetail.SelectedIndex=0;
  1213. MessageBox("请输入产品性质!",@Title);
  1214. txtProperty.Focus();
  1215. return;
  1216. }
  1217. if(txtPrice.CValue>TypeConvert("Decimal","100000000000.00"))
  1218. {
  1219. MessageBox("标准售价不可以高于100000000000.00!",@Title);
  1220. txtPrice.Focus();
  1221. return;
  1222. }
  1223. if(txtLowSalePrice.CValue>txtPrice.CValue)
  1224. {
  1225. MessageBox("最低售价不可以高于标准售价!",@Title);
  1226. txtLowSalePrice.Focus();
  1227. return;
  1228. }
  1229. if(txtSafetyStocks.CValue>txtMaxStocks.CValue)
  1230. {
  1231. MessageBox("安全存量不可以高于最大库存量!",@Title);
  1232. txtSafetyStocks.Focus();
  1233. return;
  1234. }
  1235. UpdateForm(false, "");
  1236. if(@Status==1)
  1237. {
  1238. SuspendLayout();
  1239. for(@i=RowCount("#ProductSupplier")-1;@i>=0;@i=@i-1)
  1240. {
  1241. SetPosition("#ProductSupplier", @i);
  1242. if(Equals(#ProductSupplier.ID_ProductSupplier,GuidEmpty()))
  1243. #ProductSupplier.ID_ProductSupplier = NewGuid();
  1244. if(Equals(#ProductSupplier.ID_Supplier, GuidEmpty()))
  1245. {
  1246. dgSupplier.CurrentRowIndex=@i;
  1247. tbDetail.SelectedIndex=1;
  1248. MessageBox("该供应商不存在",@Title);
  1249. ResumeLayout();
  1250. return;
  1251. }
  1252. #ProductSupplier.ID_Product = #Product.ID_Product;
  1253. }
  1254. for(@i=RowCount("#ProductSpecification")-1;@i>=0;@i=@i-1)
  1255. {
  1256. SetPosition("#ProductSpecification", @i);
  1257. if(Equals(#ProductSpecification.ID_ProductSpecification,GuidEmpty()))
  1258. #ProductSpecification.ID_ProductSpecification = NewGuid();
  1259. #ProductSpecification.ID_Product = #Product.ID_Product;
  1260. }
  1261. ResumeLayout();
  1262. New();
  1263. }
  1264. else if(@Status == 3)
  1265. {
  1266. SuspendLayout();
  1267. for(@i=RowCount("#ProductSupplier")-1;@i>=0;@i=@i-1)
  1268. {
  1269. SetPosition("#ProductSupplier", @i);
  1270. if(Equals(#ProductSupplier.ID_ProductSupplier,GuidEmpty()))
  1271. #ProductSupplier.ID_ProductSupplier = NewGuid();
  1272. if(Equals(#ProductSupplier.ID_Supplier, GuidEmpty()))
  1273. {
  1274. dgSupplier.CurrentRowIndex=@i;
  1275. tbDetail.SelectedIndex=1;
  1276. MessageBox("该供应商不存在",@Title);
  1277. ResumeLayout();
  1278. return;
  1279. }
  1280. #ProductSupplier.ID_Product = #Product.ID_Product;
  1281. }
  1282. for(@i=RowCount("#ProductSpecification")-1;@i>=0;@i=@i-1)
  1283. {
  1284. SetPosition("#ProductSpecification", @i);
  1285. if(Equals(#ProductSpecification.ID_ProductSpecification,GuidEmpty()))
  1286. #ProductSpecification.ID_ProductSpecification = NewGuid();
  1287. #ProductSpecification.ID_Product = #Product.ID_Product;
  1288. }
  1289. ResumeLayout();
  1290. #Product.LastModDate_Product=DateTimeNow();
  1291. Update();
  1292. }
  1293. ChangeMode("View");
  1294. ]]>
  1295. </SubmitButtonClick>
  1296. </Lables>
  1297. </Form>
  1298. </Forms>