FrmSupplier.xml 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmSupplier">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @SetFlag=1;
  9. @HaveSearchSupplierList=false;
  10. @Title="供应商基本资料";
  11. GetSchema();
  12. ChangeMode("Search");
  13. Search("SearchDepartment");
  14. Search("SearchDuty");
  15. Search("SearchIsMain");
  16. ]]>
  17. </Load>
  18. <Closing>
  19. ;
  20. </Closing>
  21. <Closed>
  22. ;
  23. </Closed>
  24. </Events>
  25. <Mode>
  26. <Search>
  27. <Lable name="Search" />
  28. </Search>
  29. <New>
  30. <Lable name="New" />
  31. </New>
  32. <View>
  33. <Lable name="View" />
  34. </View>
  35. <Modify>
  36. <Lable name="Modify" />
  37. </Modify>
  38. </Mode>
  39. <Controls>
  40. <IKTextButton name="tbNo" DataSource="Supplier.No_Supplier">
  41. <Events>
  42. <Enter>
  43. <![CDATA[
  44. if(tbNo.ReadOnly == false)
  45. {
  46. if(tbNo.CValue != StringEmpty())
  47. {
  48. UpdateForm(false, "");
  49. if(Search("SearchSupplierWithNo", tbNo.CValue))
  50. {
  51. ChangeMode("View");
  52. }
  53. else
  54. {
  55. if(GetRight(@Title,"新增"))
  56. ChangeMode("New");
  57. else
  58. MessageBox("您没有新增供应商基本资料的权限!",@Title);
  59. }
  60. }
  61. else
  62. {
  63. MessageBox("请输入供应商编号!",@Title);
  64. }
  65. }
  66. ]]>
  67. </Enter>
  68. <Click>
  69. @Temp = ShowSearchBox("SupplierSearch","INFOMATION",tbNo.CValue);
  70. if(@Temp != StringEmpty())
  71. {
  72. tbNo.CValue = @Temp;
  73. UpdateForm(false, "");
  74. if(Search("SearchSupplierWithNo", tbNo.CValue))
  75. {
  76. ChangeMode("View");
  77. }
  78. }
  79. </Click>
  80. </Events>
  81. </IKTextButton>
  82. <IKTextBox name="txtShortName" DataSource="Supplier.ShortName_Supplier">
  83. <Events>
  84. <Enter>
  85. if( txtName.CValue == "")
  86. {
  87. txtName.CValue = txtShortName.CValue;
  88. txtName.Focus();
  89. }
  90. </Enter>
  91. </Events>
  92. </IKTextBox>
  93. <IKTextBox name="txtName" DataSource="Supplier.Name_Supplier"/>
  94. <IKTextBox name="txtRegistedAddress" DataSource="Supplier.RegistedAddress_Supplier"/>
  95. <IKCountryCombo name="cbCountry" DataSource="Supplier.Country_Supplier"/>
  96. <IKTextBox name="txtPostalCode" DataSource="Supplier.PostalCode_Supplier"/>
  97. <IKPhoneControl name="pcPhone" DataSource="Telephone" ValueMember="ID_Telephone" DisplayMember="Name_Telephone" NoMember="No_Telephone" FocusMember="Focus_Telephone">
  98. </IKPhoneControl>
  99. <IKPhoneControl name="pcFax" DataSource="Fax" ValueMember="ID_Fax" DisplayMember="Name_Fax" NoMember="No_Fax" FocusMember="Focus_Fax">
  100. </IKPhoneControl>
  101. <IKDateTimeText name="dttCreateDate" DataSource="Supplier.CreateDate_Supplier"/>
  102. <IKTextBox name="txtCreator" DataSource="Supplier.CreatorName_Supplier"/><!--Supplier.CreatorName_Supplier isn't DB's Field-->
  103. <IKDateTimePause name="dtpIsSuspend" DataSource="Supplier.SuspendDate_Supplier"/>
  104. <IKTextBox name="txtComment" DataSource="Supplier.Comment_Supplier"/>
  105. <IKTextBox name="txtMender" DataSource="Supplier.LastModUser_SupplierName"/>
  106. <IKDateTimeText name="dttMendDate" DataSource="Supplier.LastModDate_Supplier"/>
  107. <IKDataGridEx name="dtLinkMan" DataSource="Linkman" TableStyleIndex="0">
  108. <DataColumn Index="0" DataSource="Linkman.Name_Linkman" />
  109. <DataColumn Index="1" DataSource="Linkman.Department_Linkman">
  110. <IKDataGridComboBoxColumn DisplaySourceEx="Linkman.Department_Linkman" ValueSourceEx="Linkman.Department_Linkman" DataSourceEx="Department" DisplayMemberEx="Result" ValueMemberEx="Result">
  111. <Events>
  112. <Reload>
  113. Search("SearchDepartment");
  114. SetDataGridColumnDataSource(1,"dtLinkMan");
  115. </Reload>
  116. </Events>
  117. </IKDataGridComboBoxColumn>
  118. </DataColumn>
  119. <DataColumn Index="2" DataSource="Linkman.Duty_Linkman" >
  120. <IKDataGridComboBoxColumn DisplaySourceEx="Linkman.Duty_Linkman" ValueSourceEx="Linkman.Duty_Linkman" DataSourceEx="Duty" DisplayMemberEx="Result" ValueMemberEx="Result">
  121. <Events>
  122. <Reload>
  123. Search("SearchDuty");
  124. SetDataGridColumnDataSource(2,"dtLinkMan");
  125. </Reload>
  126. </Events>
  127. </IKDataGridComboBoxColumn>
  128. </DataColumn>
  129. <DataColumn Index="3" DataSource="Linkman.Tel_Linkman" />
  130. <DataColumn Index="4" DataSource="Linkman.Fax_Linkman" />
  131. <DataColumn Index="5" DataSource="Linkman.Mobile_Linkman" />
  132. <DataColumn Index="6" DataSource="Linkman.Email_Linkman" />
  133. <DataColumn Index="7" DataSource="Linkman.IsMainDis_Linkman" >
  134. <IKDataGridComboBoxColumn DisplaySourceEx="Linkman.IsMainDis_Linkman" ValueSourceEx="Linkman.IsMain_Linkman" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
  135. <Events>
  136. <Reload>
  137. Search("SearchIsMain");
  138. SetDataGridColumnDataSource(7,"dtLinkMan");
  139. </Reload>
  140. </Events>
  141. </IKDataGridComboBoxColumn>
  142. </DataColumn>
  143. <DataColumn Index="8" DataSource="Linkman.Comment_Linkman" />
  144. </IKDataGridEx>
  145. <IKDataGridEx name="dtPrinciple" DataSource="Principal" TableStyleIndex="0">
  146. <DataColumn Index="0" DataSource="Principal.No_Employee" >
  147. <IKDataGridTextButtonColumn>
  148. <Events>
  149. <Click>
  150. @SetFlag=1;
  151. @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee);
  152. if(@temp != "")
  153. {
  154. ResumeColumnEvent("#Principal.No_Employee");
  155. #Principal.No_Employee = @temp;
  156. ClearColumnEvent();
  157. }
  158. </Click>
  159. <SetFlagBeforeClick>
  160. @SetFlag=0;
  161. </SetFlagBeforeClick>
  162. </Events>
  163. </IKDataGridTextButtonColumn>
  164. </DataColumn>
  165. <DataColumn Index="1" DataSource="Principal.Name_Employee" />
  166. <DataColumn Index="2" DataSource="Principal.IsMainStr_Principal" >
  167. <IKDataGridComboBoxColumn DisplaySourceEx="Principal.IsMainStr_Principal" ValueSourceEx="Principal.IsMain_Principal" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
  168. <Events>
  169. <Reload>
  170. Search("SearchIsMain");
  171. SetDataGridColumnDataSource(2,"dtPrinciple");
  172. </Reload>
  173. </Events>
  174. </IKDataGridComboBoxColumn>
  175. </DataColumn>
  176. <DataColumn Index="3" DataSource="Principal.Comment_Principal" />
  177. </IKDataGridEx>
  178. <IKDataGridEx name="dgSupplier" DataSource="SupplierList" TableStyleIndex="0">
  179. <DataColumn Index="0" DataSource="SupplierList.No_Supplier" />
  180. <DataColumn Index="1" DataSource="SupplierList.ShortName_Supplier" />
  181. <Events>
  182. <RowHeaderDoubleClick>
  183. if(Search("SearchSupplierWithNo",#SupplierList.No_Supplier))
  184. {
  185. ChangeMode("View");
  186. }
  187. </RowHeaderDoubleClick>
  188. </Events>
  189. </IKDataGridEx>
  190. <IKCheckBox name="ckDisplay" DataSource="Supplier.IsDisplay" >
  191. <Events>
  192. <CheckedChanged>
  193. if(ckDisplay.Checked)
  194. Search("SearchAllSupplierList");
  195. else
  196. Search("SearchSupplierList");
  197. </CheckedChanged>
  198. </Events>
  199. </IKCheckBox>
  200. <IKFormToolBar name="toolBar">
  201. <Events>
  202. <ClickFirst>
  203. <!--if(CreateThread("Search","SearchSupplierFirst", tbNo.CValue))
  204. {
  205. ChangeMode("View");
  206. }
  207. MessageBox("thread ok");-->
  208. if(Search("SearchSupplierFirst", tbNo.CValue))
  209. {
  210. ChangeMode("View");
  211. }
  212. </ClickFirst>
  213. <ClickPrev>
  214. if(Search("SearchSupplierPrevious", tbNo.CValue))
  215. {
  216. ChangeMode("View");
  217. }
  218. </ClickPrev>
  219. <ClickNext>
  220. if(Search("SearchSupplierNext", tbNo.CValue))
  221. {
  222. ChangeMode("View");
  223. }
  224. </ClickNext>
  225. <ClickLast>
  226. if(Search("SearchSupplierLast", tbNo.CValue))
  227. {
  228. ChangeMode("View");
  229. }
  230. </ClickLast>
  231. <ClickNew>
  232. ;
  233. </ClickNew>
  234. <ClickEmpty>
  235. ChangeMode("Search");
  236. </ClickEmpty>
  237. <ClickSubmit>
  238. <Lable name="SubmitButtonClick" />
  239. </ClickSubmit>
  240. <ClickModify>
  241. ChangeMode("Modify");
  242. </ClickModify>
  243. <ClickDelete>
  244. Delete(); ChangeMode("Search");
  245. </ClickDelete>
  246. <ClickPrint>
  247. #Supplier.CountryName = cbCountry.Text;
  248. PrintReport();
  249. </ClickPrint>
  250. <ClickAudit>
  251. ;
  252. </ClickAudit>
  253. <ClickUnAudit>
  254. ;
  255. </ClickUnAudit>
  256. <ClickImport>
  257. ;
  258. </ClickImport>
  259. <ClickExport>
  260. ;
  261. </ClickExport>
  262. <ClickClose>
  263. ;
  264. </ClickClose>
  265. <ClickExpand>
  266. if(toolBar.ExpandForm==true)
  267. {
  268. pnRight.Visible=true;<!--PanelRight is not existed-->
  269. if(!@HaveSearchSupplierList)
  270. {
  271. Search("SearchSupplierList");
  272. @HaveSearchSupplierList=true;
  273. }
  274. }
  275. else
  276. {
  277. pnRight.Visible=false;
  278. }
  279. </ClickExpand>
  280. </Events>
  281. </IKFormToolBar>
  282. </Controls>
  283. <Tables>
  284. <Table name="Principal">
  285. <Events>
  286. <ColumnsChanged>
  287. <No_Employee>
  288. if(@SetFlag==0)
  289. {
  290. return;
  291. }
  292. if(Search("GetEmployeeNameByNo",#Principal.No_Employee))
  293. {
  294. #Principal.Name_Employee=#Employee.Name_Employee;
  295. #Principal.ID_Employee=#Employee.ID_Employee;
  296. if(!Equals(#Employee.SuspendDate_Employee,DBNull()))
  297. MessageBox("该员工已停用!",@Title);
  298. }
  299. else
  300. {
  301. MessageBox("该员工不存在!",@Title);
  302. #Principal.Name_Employee="";
  303. #Principal.ID_Employee=GuidEmpty();
  304. @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee);
  305. if(@temp != "")
  306. {
  307. ResumeColumnEvent("#Principal.No_Employee");
  308. #Principal.No_Employee = @temp;
  309. ClearColumnEvent();
  310. }
  311. }
  312. </No_Employee>
  313. <IsMain_Principal>
  314. ;<!--SetDefaultColoumn("Principal.IsMain_Principal");-->
  315. </IsMain_Principal>
  316. </ColumnsChanged>
  317. </Events>
  318. </Table>
  319. <Table name="Linkman">
  320. <Events>
  321. <ColumnsChanged>
  322. <IsMain_Linkman>
  323. ;<!--SetDefaultColoumn("Linkman.IsMain_Linkman");-->
  324. </IsMain_Linkman>
  325. </ColumnsChanged>
  326. </Events>
  327. </Table>
  328. </Tables>
  329. <LockInfomation LockID="ID_Supplier" LockNO="No_Supplier" LockSearchFunction="SearchSupplierWithNo"/>
  330. <ChildForms>
  331. <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="SearchSupplierWithNo" MappingName="供应商">
  332. <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  333. <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  334. </ChildForm>
  335. <ChildForm name="EmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="SearchEmployeeWithNo" MappingName="员工" >
  336. <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" />
  337. <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  338. </ChildForm>
  339. </ChildForms>
  340. </Client>
  341. <Server>
  342. <Tables>
  343. <Table name="Supplier" Type="Parent">
  344. <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 Supplier.*,convert(nvarchar(64),'') as CountryName,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName,Convert(bit,1) As IsDisplay
  345. FROM Supplier
  346. LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
  347. LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier" />
  348. <New CmdType="Text" CmdText=" INSERT INTO Supplier (ID_Supplier,No_Supplier,ShortName_Supplier,Name_Supplier,RegistedAddress_Supplier,Country_Supplier,PostalCode_Supplier,CreateDate_Supplier,ID_Creator,Comment_Supplier,SuspendDate_Supplier,LastModUser_Supplier,LastModDate_Supplier)
  349. VALUES(@ID_Supplier,@No_Supplier,@ShortName_Supplier,@Name_Supplier,@RegistedAddress_Supplier,@Country_Supplier,@PostalCode_Supplier,@CreateDate_Supplier,@ID_Creator,@Comment_Supplier,@SuspendDate_Supplier,@LastModUser_Supplier,@LastModDate_Supplier)" >
  350. <Params>
  351. <Param name="@ID_Supplier" type="Supplier.ID_Supplier" sourceColumn="ID_Supplier" />
  352. <Param name="@No_Supplier" type="Supplier.No_Supplier" sourceColumn="No_Supplier" />
  353. <Param name="@ShortName_Supplier" type="Supplier.ShortName_Supplier" sourceColumn="ShortName_Supplier" />
  354. <Param name="@Name_Supplier" type="Supplier.Name_Supplier" sourceColumn="Name_Supplier" />
  355. <Param name="@RegistedAddress_Supplier" type="Supplier.RegistedAddress_Supplier" sourceColumn="RegistedAddress_Supplier" />
  356. <Param name="@Country_Supplier" type="Supplier.Country_Supplier" sourceColumn="Country_Supplier" />
  357. <Param name="@PostalCode_Supplier" type="Supplier.PostalCode_Supplier" sourceColumn="PostalCode_Supplier" />
  358. <Param name="@CreateDate_Supplier" type="Supplier.CreateDate_Supplier" sourceColumn="CreateDate_Supplier" />
  359. <Param name="@ID_Creator" type="Supplier.ID_Creator" sourceColumn="ID_Creator" />
  360. <Param name="@Comment_Supplier" type="Supplier.Comment_Supplier" sourceColumn="Comment_Supplier" />
  361. <Param name="@SuspendDate_Supplier" type="Supplier.SuspendDate_Supplier" sourceColumn="SuspendDate_Supplier" />
  362. <Param name="@LastModUser_Supplier" type="Supplier.LastModUser_Supplier" sourceColumn="LastModUser_Supplier" />
  363. <Param name="@LastModDate_Supplier" type="Supplier.LastModDate_Supplier" sourceColumn="LastModDate_Supplier" />
  364. </Params>
  365. </New>
  366. <Update CmdType="Text" CmdText="UPDATE Supplier SET ShortName_Supplier = @ShortName_Supplier,Name_Supplier = @Name_Supplier,RegistedAddress_Supplier = @RegistedAddress_Supplier,Country_Supplier = @Country_Supplier,PostalCode_Supplier = @PostalCode_Supplier,ID_Creator = @ID_Creator,Comment_Supplier = @Comment_Supplier,SuspendDate_Supplier = @SuspendDate_Supplier,LastModUser_Supplier=@LastModUser_Supplier,LastModDate_Supplier=@LastModDate_Supplier WHERE ID_Supplier = @ID_Supplier">
  367. <Params>
  368. <Param name="@ID_Supplier" type="Supplier.ID_Supplier" sourceColumn="ID_Supplier" />
  369. <!--<Param name="@No_Supplier" type="Supplier.No_Supplier" sourceColumn="No_Supplier" />-->
  370. <Param name="@ShortName_Supplier" type="Supplier.ShortName_Supplier" sourceColumn="ShortName_Supplier" />
  371. <Param name="@Name_Supplier" type="Supplier.Name_Supplier" sourceColumn="Name_Supplier" />
  372. <Param name="@RegistedAddress_Supplier" type="Supplier.RegistedAddress_Supplier" sourceColumn="RegistedAddress_Supplier" />
  373. <Param name="@Country_Supplier" type="Supplier.Country_Supplier" sourceColumn="Country_Supplier" />
  374. <Param name="@PostalCode_Supplier" type="Supplier.PostalCode_Supplier" sourceColumn="PostalCode_Supplier" />
  375. <Param name="@CreateDate_Supplier" type="Supplier.CreateDate_Supplier" sourceColumn="CreateDate_Supplier" />
  376. <Param name="@ID_Creator" type="Supplier.ID_Creator" sourceColumn="ID_Creator" />
  377. <Param name="@Comment_Supplier" type="Supplier.Comment_Supplier" sourceColumn="Comment_Supplier" />
  378. <Param name="@SuspendDate_Supplier" type="Supplier.SuspendDate_Supplier" sourceColumn="SuspendDate_Supplier" />
  379. <Param name="@LastModUser_Supplier" type="Supplier.LastModUser_Supplier" sourceColumn="LastModUser_Supplier" />
  380. <Param name="@LastModDate_Supplier" type="Supplier.LastModDate_Supplier" sourceColumn="LastModDate_Supplier" />
  381. </Params>
  382. </Update>
  383. <Delete CmdType="Text" CmdText="DELETE Supplier WHERE ID_Supplier = @ID_Supplier
  384. DELETE Fax WHERE ID_Person = @ID_Supplier
  385. DELETE Telephone WHERE ID_Person = @ID_Supplier
  386. DELETE Linkman WHERE ID_Person = @ID_Supplier
  387. DELETE Principal WHERE ID_Person = @ID_Supplier">
  388. <Params>
  389. <Param name="@ID_Supplier" type="Supplier.ID_Supplier" sourceColumn="ID_Supplier" />
  390. </Params>
  391. </Delete>
  392. <FKErrorReport ErrorMessage="该供应商已被引用,删除失败!"/>
  393. <UNIQUEErrorReport ErrorMessage="该供应商编号已存在,提交失败!"/>
  394. </Table>
  395. <Table name="Linkman" Type="Child">
  396. <GetSchema CmdType="Text" CmdText="SELECT top 0 '' As IsMainDis_Linkman,Linkman.* FROM Linkman" />
  397. <New CmdType="Text" CmdText=" INSERT INTO Linkman ( ID_Linkman,ID_Person,Name_Linkman,Department_Linkman,Duty_Linkman,Tel_Linkman,Fax_Linkman,Mobile_Linkman,Email_Linkman,IsMain_Linkman,Comment_Linkman)
  398. VALUES(@ID_Linkman,@ID_Person,@Name_Linkman,@Department_Linkman,@Duty_Linkman,@Tel_Linkman,@Fax_Linkman,@Mobile_Linkman,@Email_Linkman,@IsMain_Linkman,@Comment_Linkman)">
  399. <Params>
  400. <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
  401. <Param name="@ID_Person" type="Linkman.ID_Person" sourceColumn="ID_Person" />
  402. <Param name="@Name_Linkman" type="Linkman.Name_Linkman" sourceColumn="Name_Linkman" />
  403. <Param name="@Department_Linkman" type="Linkman.Department_Linkman" sourceColumn="Department_Linkman" />
  404. <Param name="@Duty_Linkman" type="Linkman.Duty_Linkman" sourceColumn="Duty_Linkman" />
  405. <Param name="@Tel_Linkman" type="Linkman.Tel_Linkman" sourceColumn="Tel_Linkman" />
  406. <Param name="@Fax_Linkman" type="Linkman.Fax_Linkman" sourceColumn="Fax_Linkman" />
  407. <Param name="@Mobile_Linkman" type="Linkman.Mobile_Linkman" sourceColumn="Mobile_Linkman" />
  408. <Param name="@Email_Linkman" type="Linkman.Email_Linkman" sourceColumn="Email_Linkman" />
  409. <Param name="@IsMain_Linkman" type="Linkman.IsMain_Linkman" sourceColumn="IsMain_Linkman" />
  410. <Param name="@Comment_Linkman" type="Linkman.Comment_Linkman" sourceColumn="Comment_Linkman" />
  411. </Params>
  412. </New>
  413. <Update CmdType="Text" CmdText="UPDATE Linkman SET Name_Linkman = @Name_Linkman, Department_Linkman = @Department_Linkman, Duty_Linkman = @Duty_Linkman, Tel_Linkman = @Tel_Linkman, Fax_Linkman = @Fax_Linkman ,Mobile_Linkman = @Mobile_Linkman, Email_Linkman = @Email_Linkman, IsMain_Linkman = @IsMain_Linkman, Comment_Linkman = @Comment_Linkman
  414. WHERE ID_Linkman = @ID_Linkman">
  415. <Params>
  416. <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
  417. <Param name="@Name_Linkman" type="Linkman.Name_Linkman" sourceColumn="Name_Linkman" />
  418. <Param name="@Department_Linkman" type="Linkman.Department_Linkman" sourceColumn="Department_Linkman" />
  419. <Param name="@Duty_Linkman" type="Linkman.Duty_Linkman" sourceColumn="Duty_Linkman" />
  420. <Param name="@Tel_Linkman" type="Linkman.Tel_Linkman" sourceColumn="Tel_Linkman" />
  421. <Param name="@Fax_Linkman" type="Linkman.Fax_Linkman" sourceColumn="Fax_Linkman" />
  422. <Param name="@Mobile_Linkman" type="Linkman.Mobile_Linkman" sourceColumn="Mobile_Linkman" />
  423. <Param name="@Email_Linkman" type="Linkman.Email_Linkman" sourceColumn="Email_Linkman" />
  424. <Param name="@IsMain_Linkman" type="Linkman.IsMain_Linkman" sourceColumn="IsMain_Linkman" />
  425. <Param name="@Comment_Linkman" type="Linkman.Comment_Linkman" sourceColumn="Comment_Linkman" />
  426. </Params>
  427. </Update>
  428. <Delete CmdType="Text" CmdText="DELETE Linkman WHERE ID_Linkman=@ID_Linkman">
  429. <Params>
  430. <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
  431. </Params>
  432. </Delete>
  433. </Table>
  434. <Table name="Principal" Type="Child">
  435. <GetSchema CmdType="Text" CmdText="SELECT top 0 Principal.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee,'' as IsMainStr_Principal FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee" />
  436. <New CmdType="Text" CmdText=" INSERT INTO Principal (ID_Principal,ID_Person,ID_Employee,IsMain_Principal,Comment_Principal)
  437. VALUES(@ID_Principal,@ID_Person,@ID_Employee,@IsMain_Principal,@Comment_Principal)" >
  438. <Params>
  439. <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
  440. <Param name="@ID_Person" type="Principal.ID_Person" sourceColumn="ID_Person" />
  441. <Param name="@ID_Employee" type="Principal.ID_Employee" sourceColumn="ID_Employee" />
  442. <Param name="@IsMain_Principal" type="Principal.IsMain_Principal" sourceColumn="IsMain_Principal" />
  443. <Param name="@Comment_Principal" type="Principal.Comment_Principal" sourceColumn="Comment_Principal" />
  444. </Params>
  445. </New>
  446. <Update CmdType="Text" CmdText="UPDATE Principal SET ID_Employee = @ID_Employee,IsMain_Principal = @IsMain_Principal,Comment_Principal = @Comment_Principal
  447. WHERE ID_Principal = @ID_Principal">
  448. <Params>
  449. <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
  450. <Param name="@ID_Employee" type="Principal.ID_Employee" sourceColumn="ID_Employee" />
  451. <Param name="@IsMain_Principal" type="Principal.IsMain_Principal" sourceColumn="IsMain_Principal" />
  452. <Param name="@Comment_Principal" type="Principal.Comment_Principal" sourceColumn="Comment_Principal" />
  453. </Params>
  454. </Update>
  455. <Delete CmdType="Text" CmdText="DELETE Principal WHERE ID_Principal = @ID_Principal">
  456. <Params>
  457. <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
  458. </Params>
  459. </Delete>
  460. </Table>
  461. <Table name="Fax" Type="Association">
  462. <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Fax" />
  463. <New CmdType="Text" CmdText=" INSERT INTO Fax (ID_Fax,ID_Person,Name_Fax,No_Fax,Focus_Fax)
  464. VALUES(@ID_Fax,@ID_Person,@Name_Fax,@No_Fax,@Focus_Fax)">
  465. <Params>
  466. <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
  467. <Param name="@ID_Person" type="Fax.ID_Person" sourceColumn="ID_Person" />
  468. <Param name="@Name_Fax" type="Fax.Name_Fax" sourceColumn="Name_Fax" />
  469. <Param name="@No_Fax" type="Fax.No_Fax" sourceColumn="No_Fax" />
  470. <Param name="@Focus_Fax" type="Fax.Focus_Fax" sourceColumn="Focus_Fax" />
  471. </Params>
  472. </New>
  473. <Update CmdType="Text" CmdText="UPDATE Fax SET Name_Fax=@Name_Fax,No_Fax=@No_Fax,Focus_Fax=@Focus_Fax WHERE ID_Fax=@ID_Fax">
  474. <Params>
  475. <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
  476. <Param name="@Name_Fax" type="Fax.Name_Fax" sourceColumn="Name_Fax" />
  477. <Param name="@No_Fax" type="Fax.No_Fax" sourceColumn="No_Fax" />
  478. <Param name="@Focus_Fax" type="Fax.Focus_Fax" sourceColumn="Focus_Fax" />
  479. </Params>
  480. </Update>
  481. <Delete CmdType="Text" CmdText="DELETE Fax WHERE ID_Fax=@ID_Fax">
  482. <Params>
  483. <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
  484. </Params>
  485. </Delete>
  486. <UNIQUEErrorReport ErrorMessage="传真名称或传真号码已经存在!"/>
  487. </Table>
  488. <Table name="Telephone" Type="Association">
  489. <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Telephone" />
  490. <New CmdType="Text" CmdText=" INSERT INTO Telephone (ID_Telephone,ID_Person,Name_Telephone,No_Telephone,Focus_Telephone)
  491. VALUES(@ID_Telephone,@ID_Person,@Name_Telephone,@No_Telephone,@Focus_Telephone)">
  492. <Params>
  493. <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
  494. <Param name="@ID_Person" type="Telephone.ID_Person" sourceColumn="ID_Person" />
  495. <Param name="@Name_Telephone" type="Telephone.Name_Telephone" sourceColumn="Name_Telephone" />
  496. <Param name="@No_Telephone" type="Telephone.No_Telephone" sourceColumn="No_Telephone" />
  497. <Param name="@Focus_Telephone" type="Telephone.Focus_Telephone" sourceColumn="Focus_Telephone" />
  498. </Params>
  499. </New>
  500. <Update CmdType="Text" CmdText="UPDATE Telephone SET Name_Telephone=@Name_Telephone,No_Telephone=@No_Telephone,Focus_Telephone=@Focus_Telephone WHERE ID_Telephone=@ID_Telephone">
  501. <Params>
  502. <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
  503. <Param name="@Name_Telephone" type="Telephone.Name_Telephone" sourceColumn="Name_Telephone" />
  504. <Param name="@No_Telephone" type="Telephone.No_Telephone" sourceColumn="No_Telephone" />
  505. <Param name="@Focus_Telephone" type="Telephone.Focus_Telephone" sourceColumn="Focus_Telephone" />
  506. </Params>
  507. </Update>
  508. <Delete CmdType="Text" CmdText="DELETE Telephone WHERE ID_Telephone=@ID_Telephone">
  509. <Params>
  510. <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
  511. </Params>
  512. </Delete>
  513. <UNIQUEErrorReport ErrorMessage="电话名称或电话号码已经存在!"/>
  514. </Table>
  515. <Table name="Employee" Type="Other">
  516. <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Employee" />
  517. </Table>
  518. <Table name="SupplierList" Type="Other">
  519. <GetSchema CmdType="Text" CmdText="SELECT top 0 Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier" />
  520. </Table>
  521. </Tables>
  522. <Search>
  523. <SearchDefaultPhone CmdType="Text" CmdText="Select newid() as ID_Telephone, CAST('{00000000-0000-0000-0000-000000000000}' AS uniqueidentifier) as ID_Person, CAST(Name_TypeDef AS NVARCHAR(64))As Name_Telephone, CAST(''AS NVARCHAR(128)) As No_Telephone, CAST(0 AS bit) As Focus_Telephone From TypeDef Where Type_TypeDef = 24">
  524. <Tables>
  525. <Table name="DefaultTelephone" />
  526. </Tables>
  527. </SearchDefaultPhone>
  528. <SearchDefaultFax CmdType="Text" CmdText="Select newid() as ID_Fax, CAST('{00000000-0000-0000-0000-000000000000}' AS uniqueidentifier) as ID_Person, CAST(Name_TypeDef AS NVARCHAR(64)) As Name_Fax, CAST(''AS NVARCHAR(128)) As No_Fax, CAST(0 AS bit) As Focus_Fax From TypeDef Where Type_TypeDef = 25 order by No_TypeDef">
  529. <Tables>
  530. <Table name="DefaultFax" />
  531. </Tables>
  532. </SearchDefaultFax>
  533. <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
  534. <Tables>
  535. <Table name="AllSupplier" />
  536. </Tables>
  537. </SearchAllSupplier>
  538. <SearchSupplierList CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier Where SuspendDate_Supplier Is Null">
  539. <Tables>
  540. <Table name="SupplierList" />
  541. </Tables>
  542. </SearchSupplierList>
  543. <SearchAllSupplierList CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
  544. <Tables>
  545. <Table name="SupplierList" />
  546. </Tables>
  547. </SearchAllSupplierList>
  548. <SearchDepartment CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 17">
  549. <Tables>
  550. <Table name="Department" />
  551. </Tables>
  552. </SearchDepartment>
  553. <SearchDuty CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 18">
  554. <Tables>
  555. <Table name="Duty" />
  556. </Tables>
  557. </SearchDuty>
  558. <SearchIsMain CmdType="Text" CmdText=" Create Table #IsMain
  559. (
  560. Result nvarchar(64),
  561. Value bit
  562. )
  563. Insert into #IsMain Values('是',1)
  564. Insert into #IsMain Values('否',0)
  565. Select * From #IsMain
  566. Drop Table #IsMain">
  567. <Tables>
  568. <Table name="IsMain" />
  569. </Tables>
  570. </SearchIsMain>
  571. <SearchSupplierWithNo CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
  572. SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
  573. LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
  574. LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
  575. where Supplier.No_Supplier = @No_Supplier
  576. SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @No_Supplier
  577. SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
  578. SELECT * from Fax where Fax.ID_Person = @ID_Supplier
  579. SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
  580. SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
  581. <Params>
  582. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
  583. </Params>
  584. <Tables>
  585. <Table name="Supplier" />
  586. <Table name="Telephone" />
  587. <Table name="Fax"/>
  588. <Table name="Linkman" />
  589. <Table name="Principal"/>
  590. </Tables>
  591. </SearchSupplierWithNo>
  592. <SearchSupplierFirst CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
  593. DECLARE @NextNo nvarchar(64)
  594. SET @NextNo = @No_Supplier
  595. SELECT TOP 1 @NextNo = Supplier.No_Supplier FROM Supplier ORDER BY Supplier.No_Supplier
  596. SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
  597. LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
  598. LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
  599. where Supplier.No_Supplier = @NextNo
  600. SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @NextNo
  601. SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
  602. SELECT * from Fax where Fax.ID_Person = @ID_Supplier
  603. SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
  604. SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
  605. <Params>
  606. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
  607. </Params>
  608. <Tables>
  609. <Table name="Supplier" />
  610. <Table name="Telephone" />
  611. <Table name="Fax"/>
  612. <Table name="Linkman" />
  613. <Table name="Principal"/>
  614. </Tables>
  615. </SearchSupplierFirst>
  616. <SearchSupplierPrevious CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
  617. DECLARE @NextNo nvarchar(64)
  618. SET @NextNo = @No_Supplier
  619. SELECT TOP 1 @NextNo = Supplier.No_Supplier FROM Supplier WHERE Supplier.No_Supplier &lt; @No_Supplier ORDER BY Supplier.No_Supplier Desc
  620. SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
  621. LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
  622. LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
  623. where Supplier.No_Supplier = @NextNo
  624. SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @NextNo
  625. SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
  626. SELECT * from Fax where Fax.ID_Person = @ID_Supplier
  627. SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
  628. SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
  629. <Params>
  630. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
  631. </Params>
  632. <Tables>
  633. <Table name="Supplier" />
  634. <Table name="Telephone" />
  635. <Table name="Fax"/>
  636. <Table name="Linkman" />
  637. <Table name="Principal"/>
  638. </Tables>
  639. </SearchSupplierPrevious>
  640. <SearchSupplierNext CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
  641. DECLARE @NextNo nvarchar(64)
  642. SET @NextNo = @No_Supplier
  643. SELECT TOP 1 @NextNo = Supplier.No_Supplier FROM Supplier WHERE Supplier.No_Supplier &gt; @No_Supplier ORDER BY Supplier.No_Supplier
  644. SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
  645. LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
  646. LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
  647. where Supplier.No_Supplier = @NextNo
  648. SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @NextNo
  649. SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
  650. SELECT * from Fax where Fax.ID_Person = @ID_Supplier
  651. SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
  652. SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
  653. <Params>
  654. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
  655. </Params>
  656. <Tables>
  657. <Table name="Supplier" />
  658. <Table name="Telephone" />
  659. <Table name="Fax"/>
  660. <Table name="Linkman" />
  661. <Table name="Principal"/>
  662. </Tables>
  663. </SearchSupplierNext>
  664. <SearchSupplierLast CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
  665. DECLARE @NextNo nvarchar(64)
  666. SET @NextNo = @No_Supplier
  667. SELECT TOP 1 @NextNo = Supplier.No_Supplier FROM Supplier ORDER BY Supplier.No_Supplier DESC
  668. SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
  669. LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
  670. LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
  671. where Supplier.No_Supplier = @NextNo
  672. SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @NextNo
  673. SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
  674. SELECT * from Fax where Fax.ID_Person = @ID_Supplier
  675. SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
  676. SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
  677. <Params>
  678. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
  679. </Params>
  680. <Tables>
  681. <Table name="Supplier" />
  682. <Table name="Telephone" />
  683. <Table name="Fax"/>
  684. <Table name="Linkman" />
  685. <Table name="Principal"/>
  686. </Tables>
  687. </SearchSupplierLast>
  688. <GetEmployeeNameByNo CmdType="Text" CmdText="SELECT * FROM Employee WHERE No_Employee = @No_Employee">
  689. <Params>
  690. <Param name="@No_Employee" type="Employee.No_Employee" Index="0" />
  691. </Params>
  692. <Tables>
  693. <Table name="Employee" />
  694. </Tables>
  695. </GetEmployeeNameByNo>
  696. <SearchAllEmployee CmdType="Text" CmdText="SELECT Employee.No_Employee,Employee.Name_Employee FROM Employee ">
  697. <Tables>
  698. <Table name="AllEmployee" />
  699. </Tables>
  700. </SearchAllEmployee>
  701. </Search>
  702. </Server>
  703. <Lables>
  704. <Search>
  705. Empty();
  706. NewInstance();
  707. tbNo.ReadOnly=false;
  708. txtShortName.ReadOnly=true;
  709. txtName.ReadOnly=true;
  710. txtRegistedAddress.ReadOnly=true;
  711. cbCountry.Enabled=false;
  712. txtPostalCode.ReadOnly=true;
  713. pcPhone.ReadOnly=true;
  714. pcFax.ReadOnly=true;
  715. dttCreateDate.ReadOnly=true;
  716. dtpIsSuspend.Enabled=false;
  717. txtComment.ReadOnly=true;
  718. dtLinkMan.ReadOnly=true;
  719. dtPrinciple.ReadOnly=true;
  720. toolBar.EnableSubmit=false;
  721. toolBar.EnableModify=false;
  722. toolBar.EnableDelete=false;
  723. toolBar.EnablePrint=false;
  724. #Supplier.CreateDate_Supplier=DBNull();
  725. #Supplier.SuspendDate_Supplier=DBNull();
  726. #Supplier.LastModUser_Supplier=DBNull();
  727. #Supplier.LastModDate_Supplier=DBNull();
  728. if(ckDisplay.Checked)
  729. #Supplier.IsDisplay=1;
  730. else
  731. #Supplier.IsDisplay=0;
  732. UpdateForm(true, "");
  733. tbNo.Focus();
  734. @Status=0;
  735. </Search>
  736. <New>
  737. Empty();
  738. NewInstance();
  739. tbNo.ReadOnly=true;
  740. txtShortName.ReadOnly=false;
  741. txtName.ReadOnly=false;
  742. txtRegistedAddress.ReadOnly=false;
  743. cbCountry.Enabled=true;
  744. txtPostalCode.ReadOnly=false;
  745. dtpIsSuspend.Enabled=true;
  746. txtComment.ReadOnly=false;
  747. dtLinkMan.ReadOnly=false;
  748. dtPrinciple.ReadOnly=false;
  749. toolBar.EnableSubmit=GetRight(@Title,"新增");
  750. toolBar.EnableModify=false;
  751. toolBar.EnableDelete=false;
  752. toolBar.EnablePrint=false;
  753. #Supplier.No_Supplier=tbNo.CValue;
  754. #Supplier.CreatorName_Supplier=GetCurrentUser();<!--得到当前用户。引擎应支持-->
  755. #Supplier.ID_Supplier=NewGuid();
  756. #Supplier.ID_Creator=GetLoginUserID();
  757. #Supplier.Country_Supplier=40;
  758. #Supplier.CreateDate_Supplier=DateTimeNow();
  759. #Supplier.SuspendDate_Supplier=DBNull();
  760. #Supplier.LastModUser_Supplier=DBNull();
  761. #Supplier.LastModDate_Supplier=DBNull();
  762. Search("SearchDefaultPhone");
  763. Search("SearchDefaultFax");
  764. MergeTable("#DefaultFax","#Fax");
  765. MergeTable("#DefaultTelephone","#Telephone");
  766. if(ckDisplay.Checked)
  767. #Supplier.IsDisplay=1;
  768. else
  769. #Supplier.IsDisplay=0;
  770. UpdateForm(true, "");
  771. pcPhone.ReadOnly=false;
  772. pcFax.ReadOnly=false;
  773. txtShortName.Focus();
  774. @Status=1;
  775. </New>
  776. <View>
  777. tbNo.ReadOnly=false;
  778. txtShortName.ReadOnly=true;
  779. txtName.ReadOnly=true;
  780. txtRegistedAddress.ReadOnly=true;
  781. cbCountry.Enabled=false;
  782. txtPostalCode.ReadOnly=true;
  783. pcPhone.ReadOnly=true;
  784. pcFax.ReadOnly=true;
  785. dtpIsSuspend.Enabled=false;
  786. txtComment.ReadOnly=true;
  787. dtLinkMan.ReadOnly=true;
  788. dtPrinciple.ReadOnly=true;
  789. toolBar.EnableSubmit=false;
  790. toolBar.EnableModify=GetRight(@Title,"修改");
  791. toolBar.EnableDelete=GetRight(@Title,"删除");
  792. toolBar.EnablePrint=GetRight(@Title,"打印");
  793. if(ckDisplay.Checked)
  794. #Supplier.IsDisplay=1;
  795. else
  796. #Supplier.IsDisplay=0;
  797. UpdateForm(true, "");
  798. @Status=2;
  799. </View>
  800. <Modify>
  801. tbNo.ReadOnly=true;
  802. txtShortName.ReadOnly=false;
  803. txtName.ReadOnly=false;
  804. txtRegistedAddress.ReadOnly=false;
  805. cbCountry.Enabled=true;
  806. txtPostalCode.ReadOnly=false;
  807. pcPhone.ReadOnly=false;
  808. pcFax.ReadOnly=false;
  809. dtpIsSuspend.Enabled=true;
  810. txtComment.ReadOnly=false;
  811. dtLinkMan.ReadOnly=false;
  812. dtPrinciple.ReadOnly=false;
  813. toolBar.EnableSubmit=GetRight(@Title,"新增");
  814. toolBar.EnableModify=false;
  815. toolBar.EnableDelete=GetRight(@Title,"删除");
  816. toolBar.EnablePrint=false;
  817. #Supplier.LastModUser_SupplierName=GetCurrentUser();
  818. #Supplier.LastModUser_Supplier=GetLoginUserID();
  819. #Supplier.LastModDate_Supplier=DateTimeNow();
  820. if(ckDisplay.Checked)
  821. #Supplier.IsDisplay=1;
  822. else
  823. #Supplier.IsDisplay=0;
  824. UpdateForm(true, "");
  825. txtShortName.Focus();
  826. @Status=3;
  827. </Modify>
  828. <SubmitButtonClick>
  829. <![CDATA[
  830. if(txtShortName.CValue=="")
  831. {
  832. MessageBox("请输入供应商简称!",@Title);
  833. txtShortName.Focus();
  834. return;
  835. }
  836. if(txtName.CValue=="")
  837. {
  838. MessageBox("请输入供应商名称!",@Title);
  839. txtName.Focus();
  840. return;
  841. }
  842. if(cbCountry.CValue==0)
  843. {
  844. tbDetail.SelectedIndex=0;
  845. MessageBox("请输入国家名称!",@Title);
  846. cbCountry.Focus();
  847. return;
  848. }
  849. dttCreateDate.CValue=DateTimeNow();
  850. UpdateForm(false, "");
  851. if(@Status==1)
  852. {
  853. SuspendLayout();
  854. for(@i=RowCount("#Linkman")-1;@i>=0;@i=@i-1)
  855. {
  856. SetPosition("#Linkman", @i);
  857. if(Equals(#Linkman.ID_Linkman,GuidEmpty()))
  858. #Linkman.ID_Linkman = NewGuid();
  859. #Linkman.ID_Person = #Supplier.ID_Supplier;
  860. }
  861. for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1)
  862. {
  863. SetPosition("#Principal", @i);
  864. if(Equals(#Principal.ID_Principal,GuidEmpty()))
  865. #Principal.ID_Principal = NewGuid();
  866. if(Equals(#Principal.ID_Employee, GuidEmpty()))
  867. {
  868. dtPrinciple.CurrentRowIndex=@i;
  869. tbDetail.SelectedIndex=2;
  870. MessageBox("该员工不存在!",@Title);
  871. ResumeLayout();
  872. return;
  873. }
  874. #Principal.ID_Person = #Supplier.ID_Supplier;
  875. }
  876. for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1)
  877. {
  878. SetPosition("#Telephone",@i);
  879. if(Equals(#Telephone.ID_Telephone,GuidEmpty()))
  880. #Telephone.ID_Telephone=NewGuid();
  881. #Telephone.ID_Person=#Supplier.ID_Supplier;
  882. }
  883. for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1)
  884. {
  885. SetPosition("#Fax",@i);
  886. if(Equals(#Fax.ID_Fax,GuidEmpty()))
  887. #Fax.ID_Fax=NewGuid();
  888. #Fax.ID_Person=#Supplier.ID_Supplier;
  889. }
  890. ResumeLayout();
  891. New();
  892. }
  893. else if(@Status == 3)
  894. {
  895. SuspendLayout();
  896. for(@i=RowCount("#Linkman")-1;@i>=0;@i=@i-1)
  897. {
  898. SetPosition("#Linkman", @i);
  899. if(Equals(#Linkman.ID_Linkman,GuidEmpty()))
  900. #Linkman.ID_Linkman = NewGuid();
  901. #Linkman.ID_Person = #Supplier.ID_Supplier;
  902. }
  903. for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1)
  904. {
  905. SetPosition("#Principal", @i);
  906. if(Equals(#Principal.ID_Principal,GuidEmpty()))
  907. #Principal.ID_Principal = NewGuid();
  908. if(Equals(#Principal.ID_Employee, GuidEmpty()))
  909. {
  910. dtPrinciple.CurrentRowIndex=@i;
  911. tbDetail.SelectedIndex=2;
  912. MessageBox("该员工不存在!",@Title);
  913. ResumeLayout();
  914. return;
  915. }
  916. #Principal.ID_Person = #Supplier.ID_Supplier;
  917. }
  918. for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1)
  919. {
  920. SetPosition("#Telephone",@i);
  921. if(Equals(#Telephone.ID_Telephone,GuidEmpty()))
  922. #Telephone.ID_Telephone=NewGuid();
  923. #Telephone.ID_Person=#Supplier.ID_Supplier;
  924. }
  925. for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1)
  926. {
  927. SetPosition("#Fax",@i);
  928. if(Equals(#Fax.ID_Fax,GuidEmpty()))
  929. #Fax.ID_Fax=NewGuid();
  930. #Fax.ID_Person=#Supplier.ID_Supplier;
  931. }
  932. ResumeLayout();
  933. #Supplier.LastModDate_Supplier=DateTimeNow();
  934. Update();
  935. }
  936. ChangeMode("View");
  937. ]]>
  938. </SubmitButtonClick>
  939. </Lables>
  940. </Form>
  941. </Forms>