FrmTransporter.xml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmTransporter">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="运输商基本资料";
  9. @HaveSearchTransporterList=false;
  10. GetSchema();
  11. ChangeMode("Search");
  12. Search("SearchZone");
  13. Search("SearchName");
  14. ]]>
  15. </Load>
  16. <Closing>
  17. ;
  18. </Closing>
  19. <Closed>
  20. ;
  21. </Closed>
  22. </Events>
  23. <Mode>
  24. <Search>
  25. <Lable name="Search" />
  26. </Search>
  27. <New>
  28. <Lable name="New" />
  29. </New>
  30. <View>
  31. <Lable name="View" />
  32. </View>
  33. <Modify>
  34. <Lable name="Modify" />
  35. </Modify>
  36. </Mode>
  37. <Controls>
  38. <IKTextButton name="tbNo" DataSource="Transporter.No_Transporter">
  39. <Events>
  40. <Enter>
  41. <![CDATA[
  42. if(tbNo.ReadOnly == false)
  43. {
  44. if(tbNo.CValue != StringEmpty())
  45. {
  46. UpdateForm(false, "");
  47. if(Search("SearchTransporterWithNo", tbNo.CValue))
  48. {
  49. Search("SearchMainPrincipal");
  50. ChangeMode("View");
  51. }
  52. else
  53. {
  54. Search("SearchMainPrincipal");
  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("TransporterSearch","INFOMATION",tbNo.CValue);
  70. if(@Temp != StringEmpty())
  71. {
  72. tbNo.CValue = @Temp;
  73. ActiveControlEvent("tbNo", "Enter");
  74. UpdateForm(false, "");
  75. if(Search("SearchTransporterWithNo", tbNo.CValue))
  76. {
  77. Search("SearchMainPrincipal");
  78. ChangeMode("View");
  79. }
  80. }
  81. </Click>
  82. </Events>
  83. </IKTextButton>
  84. <IKTextBox name="txtShortName" DataSource="Transporter.ShortName_Transporter"></IKTextBox>
  85. <IKTextBox name="txtName" DataSource="Transporter.Name_Transporter"></IKTextBox>
  86. <IKTextBox name="txtRegistedAddress" DataSource="Transporter.RegistedAddress_Transporter"></IKTextBox>
  87. <IKCountryCombo name="cbCountry" DataSource="Transporter.Country_Transporter"></IKCountryCombo>
  88. <IKTextBox name="txtPostalCode" DataSource="Transporter.PostalCode_Transporter"></IKTextBox>
  89. <IKTextBox name="txtMender" DataSource="Transporter.LastModUser_TransporterName"></IKTextBox>
  90. <IKDateTimeText name="dttMendDate" DataSource="Transporter.LastModDate_Transporter"></IKDateTimeText>
  91. <IKComboBoxEx name="cbMainPrincipal" ValueSource="Transporter.ID_Principal" DisplaySource="Transporter.MainPrincipal_Transporter" NoSource="Transporter.No_Employee"
  92. ValueMember="ID_Employee" DataSource="Employee" DisplayMember="Name_Employee" NoMember="No_Employee">
  93. <Events>
  94. <Reload>
  95. UpdateForm(false, "cbMainPrincipal");
  96. Search("SearchMainPrincipal");
  97. UpdateForm(true, "cbMainPrincipal");
  98. </Reload>
  99. </Events>
  100. </IKComboBoxEx>
  101. <IKTextBox name="txtLinkman" DataSource="Transporter.Linkman_Transporter"></IKTextBox>
  102. <IKDateTimeText name="dttCreateDate" DataSource="Transporter.CreateDate_Transporter"></IKDateTimeText>
  103. <IKTextBox name="txtCreator" DataSource="Transporter.CreatorName_Transporter"></IKTextBox>
  104. <IKDateTimePause name="dtpIsSuspend" DataSource="Transporter.SuspendDate_Transporter"></IKDateTimePause>
  105. <IKTextBox name="txtComment" DataSource="Transporter.Comment_Transporter"></IKTextBox>
  106. <IKPhoneControl name="pcFax" DataSource="Fax" ValueMember="ID_Fax" DisplayMember="Name_Fax" NoMember="No_Fax" FocusMember="Focus_Fax">
  107. </IKPhoneControl>
  108. <IKPhoneControl name="pcPhone" DataSource="Telephone" ValueMember="ID_Telephone" DisplayMember="Name_Telephone" FocusMember="Focus_Telephone" NoMember="No_Telephone">
  109. </IKPhoneControl>
  110. <IKDataGridEx name="dgFreightMode" DataSource="FreightMode" TableStyleIndex="0">
  111. <DataColumn Index="0" DataSource="FreightMode.Zone_FreightMode" >
  112. <IKDataGridComboBoxColumn DisplaySourceEx="FreightMode.Zone_FreightMode" ValueSourceEx="FreightMode.Zone_FreightMode" DataSourceEx="Zone" DisplayMemberEx="Name_TypeDef" ValueMemberEx="Name_TypeDef">
  113. <Events>
  114. <Reload>
  115. Search("SearchZone");
  116. SetDataGridColumnDataSource(0,"dgFreightMode");
  117. </Reload>
  118. </Events>
  119. </IKDataGridComboBoxColumn>
  120. </DataColumn>
  121. <DataColumn Index="1" DataSource="FreightMode.Name_FreightMode" >
  122. <IKDataGridComboBoxColumn DisplaySourceEx="FreightMode.Name_FreightMode" ValueSourceEx="FreightMode.Name_FreightMode" DataSourceEx="Name" DisplayMemberEx="Name_TypeDef" ValueMemberEx="Name_TypeDef" >
  123. <Events>
  124. <Reload>
  125. Search("SearchName");
  126. SetDataGridColumnDataSource(1,"dgFreightMode");
  127. </Reload>
  128. </Events>
  129. </IKDataGridComboBoxColumn>
  130. </DataColumn>
  131. <DataColumn Index="2" DataSource="FreightMode.Comment_FreightMode" />
  132. </IKDataGridEx>
  133. <IKDataGridEx name="dgTransporter" DataSource="TransporterList" TableStyleIndex="0">
  134. <DataColumn Index="0" DataSource="TransporterList.No_Transporter" />
  135. <DataColumn Index="1" DataSource="TransporterList.ShortName_Transporter" />
  136. <Events>
  137. <RowHeaderDoubleClick>
  138. if(Search("SearchTransporterWithNo",#TransporterList.No_Transporter))
  139. {
  140. ChangeMode("View");
  141. }
  142. </RowHeaderDoubleClick>
  143. </Events>
  144. </IKDataGridEx>
  145. <IKCheckBox name="ckDisplay" DataSource="Transporter.IsDisplay">
  146. <Events>
  147. <CheckedChanged>
  148. if(ckDisplay.Checked)
  149. Search("SearchAllTransporterList");
  150. else
  151. Search("SearchTransporterList");
  152. </CheckedChanged>
  153. </Events>
  154. </IKCheckBox>
  155. <IKFormToolBar name="toolBar">
  156. <Events>
  157. <ClickFirst>
  158. if(Search("SearchTransporterFirst", tbNo.CValue))
  159. {
  160. ChangeMode("View");
  161. }
  162. </ClickFirst>
  163. <ClickPrev>
  164. if(Search("SearchTransporterPrevious", tbNo.CValue))
  165. {
  166. ChangeMode("View");
  167. }
  168. </ClickPrev>
  169. <ClickNext>
  170. if(Search("SearchTransporterNext", tbNo.CValue))
  171. {
  172. ChangeMode("View");
  173. }
  174. </ClickNext>
  175. <ClickLast>
  176. if(Search("SearchTransporterLast", tbNo.CValue))
  177. {
  178. ChangeMode("View");
  179. }
  180. </ClickLast>
  181. <ClickNew>
  182. ;
  183. </ClickNew>
  184. <ClickEmpty>
  185. ChangeMode("Search");
  186. </ClickEmpty>
  187. <ClickSubmit>
  188. <Lable name="SubmitButtonClick" />
  189. </ClickSubmit>
  190. <ClickModify>
  191. ChangeMode("Modify");
  192. </ClickModify>
  193. <ClickDelete>
  194. Delete(); ChangeMode("Search");
  195. </ClickDelete>
  196. <ClickPrint>
  197. #Transporter.CountryName = cbCountry.Text;
  198. PrintReport();
  199. </ClickPrint>
  200. <ClickAudit>
  201. ;
  202. </ClickAudit>
  203. <ClickUnAudit>
  204. ;
  205. </ClickUnAudit>
  206. <ClickImport>
  207. ;
  208. </ClickImport>
  209. <ClickExport>
  210. ;
  211. </ClickExport>
  212. <ClickClose>
  213. ;
  214. </ClickClose>
  215. <ClickExpand>
  216. if(toolBar.ExpandForm==true)
  217. {
  218. pnRight.Visible=true;<!--PanelRight is not existed-->
  219. if(!@HaveSearchTransporterList)
  220. {
  221. Search("SearchTransporterList");
  222. @HaveSearchTransporterList=true;
  223. }
  224. }
  225. else
  226. {
  227. pnRight.Visible=false;
  228. }
  229. </ClickExpand>
  230. </Events>
  231. </IKFormToolBar>
  232. </Controls>
  233. <Tables>
  234. <Table name="Transporter">
  235. <Events>
  236. ;
  237. </Events>
  238. </Table>
  239. <Table name="FreightMode">
  240. <Events>
  241. ;
  242. </Events>
  243. </Table>
  244. </Tables>
  245. <LockInfomation LockID="ID_Transporter" LockNO="No_Transporter" LockSearchFunction="SearchTransporterWithNo"/>
  246. <ChildForms>
  247. <ChildForm name="TransporterSearch" DataSource="Transporter" SearchFunction="SearchAllTransporter" SearchFunctionByNo="SearchTransporterWithNo" MappingName="运输商">
  248. <DataColumn Index="0" MappingName="#Transporter.No_Transporter" HeaderText="运输商编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  249. <DataColumn Index="1" MappingName="#Transporter.ShortName_Transporter" HeaderText="运输商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  250. </ChildForm>
  251. </ChildForms>
  252. </Client>
  253. <Server>
  254. <Tables>
  255. <Table name="Transporter" Type="Parent">
  256. <GetSchema CmdType="Text" CmdText=" SELECT top 0 Transporter.*,convert(nvarchar(64),'') as CountryName, '' as No_Employee,'' as MainPrincipal_Transporter,a.Name_User AS CreatorName_Transporter,b.Name_User AS LastModUser_TransporterName ,convert(bit,1) As IsDisplay FROM Transporter
  257. left join AppUser a on a.ID_User = Transporter.Creator_Transporter
  258. left join AppUser b on b.ID_User = Transporter.LastModUser_Transporter" />
  259. <New CmdType="Text" CmdText="INSERT INTO Transporter(ID_Transporter,No_Transporter,ShortName_Transporter,Name_Transporter,RegistedAddress_Transporter,Country_Transporter,PostalCode_Transporter,Linkman_Transporter,ID_Principal,CreateDate_Transporter,Creator_Transporter,Comment_Transporter,SuspendDate_Transporter,LastModUser_Transporter,LastModDate_Transporter)
  260. VALUES(@ID_Transporter,@No_Transporter,@ShortName_Transporter,@Name_Transporter,@RegistedAddress_Transporter,@Country_Transporter,@PostalCode_Transporter,@Linkman_Transporter,@ID_Principal,@CreateDate_Transporter,@Creator_Transporter,@Comment_Transporter,@SuspendDate_Transporter,@LastModUser_Transporter,@LastModDate_Transporter)">
  261. <Params>
  262. <Param name="@ID_Transporter" type="Transporter.ID_Transporter" sourceColumn="ID_Transporter" />
  263. <Param name="@No_Transporter" type="Transporter.No_Transporter" sourceColumn="No_Transporter" />
  264. <Param name="@ShortName_Transporter" type="Transporter.ShortName_Transporter" sourceColumn="ShortName_Transporter" />
  265. <Param name="@Name_Transporter" type="Transporter.Name_Transporter" sourceColumn="Name_Transporter" />
  266. <Param name="@RegistedAddress_Transporter" type="Transporter.RegistedAddress_Transporter"
  267. sourceColumn="RegistedAddress_Transporter" />
  268. <Param name="@Country_Transporter" type="Transporter.Country_Transporter" sourceColumn="Country_Transporter" />
  269. <Param name="@PostalCode_Transporter" type="Transporter.PostalCode_Transporter" sourceColumn="PostalCode_Transporter" />
  270. <Param name="@Linkman_Transporter" type="Transporter.Linkman_Transporter" sourceColumn="Linkman_Transporter" />
  271. <Param name="@ID_Principal" type="Transporter.ID_Principal" sourceColumn="ID_Principal" />
  272. <Param name="@CreateDate_Transporter" type="Transporter.CreateDate_Transporter" sourceColumn="CreateDate_Transporter" />
  273. <Param name="@Creator_Transporter" type="Transporter.Creator_Transporter" sourceColumn="Creator_Transporter" />
  274. <Param name="@Comment_Transporter" type="Transporter.Comment_Transporter" sourceColumn="Comment_Transporter" />
  275. <Param name="@SuspendDate_Transporter" type="Transporter.SuspendDate_Transporter" sourceColumn="SuspendDate_Transporter" />
  276. <Param name="@LastModUser_Transporter" type="Transporter.LastModUser_Transporter" sourceColumn="LastModUser_Transporter" />
  277. <Param name="@LastModDate_Transporter" type="Transporter.LastModDate_Transporter" sourceColumn="LastModDate_Transporter" />
  278. </Params>
  279. </New>
  280. <Update CmdType="Text" CmdText="UPDATE Transporter SET No_Transporter = @No_Transporter, ShortName_Transporter = @ShortName_Transporter, Name_Transporter = @Name_Transporter, RegistedAddress_Transporter = @RegistedAddress_Transporter, Country_Transporter = @Country_Transporter, PostalCode_Transporter=@PostalCode_Transporter,LastModUser_Transporter=@LastModUser_Transporter,LastModDate_Transporter=@LastModDate_Transporter,Linkman_Transporter=@Linkman_Transporter,ID_Principal=@ID_Principal,CreateDate_Transporter=@CreateDate_Transporter,Creator_Transporter=@Creator_Transporter,Comment_Transporter=@Comment_Transporter,SuspendDate_Transporter=@SuspendDate_Transporter WHERE ID_Transporter = @ID_Transporter">
  281. <Params>
  282. <Param name="@ID_Transporter" type="Transporter.ID_Transporter" sourceColumn="ID_Transporter" />
  283. <Param name="@No_Transporter" type="Transporter.No_Transporter" sourceColumn="No_Transporter" />
  284. <Param name="@ShortName_Transporter" type="Transporter.ShortName_Transporter" sourceColumn="ShortName_Transporter" />
  285. <Param name="@Name_Transporter" type="Transporter.Name_Transporter" sourceColumn="Name_Transporter" />
  286. <Param name="@RegistedAddress_Transporter" type="Transporter.RegistedAddress_Transporter"
  287. sourceColumn="RegistedAddress_Transporter" />
  288. <Param name="@Country_Transporter" type="Transporter.Country_Transporter" sourceColumn="Country_Transporter" />
  289. <Param name="@PostalCode_Transporter" type="Transporter.PostalCode_Transporter" sourceColumn="PostalCode_Transporter" />
  290. <Param name="@Linkman_Transporter" type="Transporter.Linkman_Transporter" sourceColumn="Linkman_Transporter" />
  291. <Param name="@ID_Principal" type="Transporter.ID_Principal" sourceColumn="ID_Principal" />
  292. <Param name="@CreateDate_Transporter" type="Transporter.CreateDate_Transporter" sourceColumn="CreateDate_Transporter" />
  293. <Param name="@Creator_Transporter" type="Transporter.Creator_Transporter" sourceColumn="Creator_Transporter" />
  294. <Param name="@Comment_Transporter" type="Transporter.Comment_Transporter" sourceColumn="Comment_Transporter" />
  295. <Param name="@SuspendDate_Transporter" type="Transporter.SuspendDate_Transporter" sourceColumn="SuspendDate_Transporter" />
  296. <Param name="@LastModUser_Transporter" type="Transporter.LastModUser_Transporter" sourceColumn="LastModUser_Transporter" />
  297. <Param name="@LastModDate_Transporter" type="Transporter.LastModDate_Transporter" sourceColumn="LastModDate_Transporter" />
  298. </Params>
  299. </Update>
  300. <Delete CmdType="Text" CmdText="DELETE Fax WHERE ID_Person = @ID_Transporter
  301. DELETE Telephone WHERE ID_Person = @ID_Transporter
  302. DELETE FreightMode WHERE ID_Transporter = @ID_Transporter
  303. DELETE Transporter WHERE ID_Transporter = @ID_Transporter">
  304. <Params>
  305. <Param name="@ID_Transporter" type="Transporter.ID_Transporter" sourceColumn="ID_Transporter" />
  306. </Params>
  307. </Delete>
  308. <FKErrorReport ErrorMessage="该运输商已被引用,删除失败!"/>
  309. <UNIQUEErrorReport ErrorMessage="该运输商编号已存在,提交失败!"/>
  310. </Table>
  311. <Table name="FreightMode" Type="Child">
  312. <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM FreightMode" />
  313. <New CmdType="Text" CmdText="INSERT INTO FreightMode(ID_FreightMode, ID_Transporter, Zone_FreightMode, Name_FreightMode, Comment_FreightMode) VALUES(@ID_FreightMode, @ID_Transporter, @Zone_FreightMode, @Name_FreightMode, @Comment_FreightMode)">
  314. <Params>
  315. <Param name="@ID_FreightMode" type="FreightMode.ID_FreightMode" sourceColumn="ID_FreightMode" />
  316. <Param name="@ID_Transporter" type="FreightMode.ID_Transporter" sourceColumn="ID_Transporter" />
  317. <Param name="@Zone_FreightMode" type="FreightMode.Zone_FreightMode" sourceColumn="Zone_FreightMode" />
  318. <Param name="@Name_FreightMode" type="FreightMode.Name_FreightMode" sourceColumn="Name_FreightMode" />
  319. <Param name="@Comment_FreightMode" type="FreightMode.Comment_FreightMode" sourceColumn="Comment_FreightMode" />
  320. </Params>
  321. </New>
  322. <Update CmdType="Text" CmdText="UPDATE FreightMode SET ID_Transporter=@ID_Transporter, Zone_FreightMode=@Zone_FreightMode, Name_FreightMode=@Name_FreightMode, Comment_FreightMode=@Comment_FreightMode WHERE ID_FreightMode=@ID_FreightMode">
  323. <Params>
  324. <Param name="@ID_FreightMode" type="FreightMode.ID_FreightMode" sourceColumn="ID_FreightMode" />
  325. <Param name="@ID_Transporter" type="FreightMode.ID_Transporter" sourceColumn="ID_Transporter" />
  326. <Param name="@Zone_FreightMode" type="FreightMode.Zone_FreightMode" sourceColumn="Zone_FreightMode" />
  327. <Param name="@Name_FreightMode" type="FreightMode.Name_FreightMode" sourceColumn="Name_FreightMode" />
  328. <Param name="@Comment_FreightMode" type="FreightMode.Comment_FreightMode" sourceColumn="Comment_FreightMode" />
  329. </Params>
  330. </Update>
  331. <Delete CmdType="Text" CmdText="DELETE FreightMode WHERE ID_FreightMode=@ID_FreightMode">
  332. <Params>
  333. <Param name="@ID_FreightMode" type="FreightMode.ID_FreightMode" sourceColumn="ID_FreightMode" />
  334. </Params>
  335. </Delete>
  336. </Table>
  337. <Table name="AppUser" Type="Reference">
  338. <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM AppUser" />
  339. </Table>
  340. <Table name="Fax" Type="Association">
  341. <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Fax" />
  342. <New CmdType="Text" CmdText="INSERT INTO Fax (ID_Fax,ID_Person,Name_Fax,No_Fax,Focus_Fax) VALUES(@ID_Fax,@ID_Person,@Name_Fax,@No_Fax,@Focus_Fax)">
  343. <Params>
  344. <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
  345. <Param name="@ID_Person" type="Fax.ID_Person" sourceColumn="ID_Person" />
  346. <Param name="@Name_Fax" type="Fax.Name_Fax" sourceColumn="Name_Fax" />
  347. <Param name="@No_Fax" type="Fax.No_Fax" sourceColumn="No_Fax" />
  348. <Param name="@Focus_Fax" type="Fax.Focus_Fax" sourceColumn="Focus_Fax" />
  349. </Params>
  350. </New>
  351. <Update CmdType="Text" CmdText="UPDATE Fax SET Name_Fax=@Name_Fax,No_Fax=@No_Fax,Focus_Fax=@Focus_Fax WHERE ID_Fax=@ID_Fax">
  352. <Params>
  353. <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
  354. <Param name="@Name_Fax" type="Fax.Name_Fax" sourceColumn="Name_Fax" />
  355. <Param name="@No_Fax" type="Fax.No_Fax" sourceColumn="No_Fax" />
  356. <Param name="@Focus_Fax" type="Fax.Focus_Fax" sourceColumn="Focus_Fax" />
  357. </Params>
  358. </Update>
  359. <Delete CmdType="Text" CmdText="DELETE Fax WHERE ID_Fax=@ID_Fax">
  360. <Params>
  361. <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
  362. </Params>
  363. </Delete>
  364. <UNIQUEErrorReport ErrorMessage="传真名称或传真号码已经存在!"/>
  365. </Table>
  366. <Table name="Telephone" Type="Association">
  367. <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Telephone" />
  368. <New CmdType="Text" CmdText="INSERT INTO Telephone (ID_Telephone,ID_Person,Name_Telephone,No_Telephone,Focus_Telephone) VALUES(@ID_Telephone,@ID_Person,@Name_Telephone,@No_Telephone,@Focus_Telephone)">
  369. <Params>
  370. <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
  371. <Param name="@ID_Person" type="Telephone.ID_Person" sourceColumn="ID_Person" />
  372. <Param name="@Name_Telephone" type="Telephone.Name_Telephone" sourceColumn="Name_Telephone" />
  373. <Param name="@No_Telephone" type="Telephone.No_Telephone" sourceColumn="No_Telephone" />
  374. <Param name="@Focus_Telephone" type="Telephone.Focus_Telephone" sourceColumn="Focus_Telephone" />
  375. </Params>
  376. </New>
  377. <Update CmdType="Text" CmdText="UPDATE Telephone SET Name_Telephone=@Name_Telephone,No_Telephone=@No_Telephone,Focus_Telephone=@Focus_Telephone WHERE ID_Telephone=@ID_Telephone">
  378. <Params>
  379. <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
  380. <Param name="@Name_Telephone" type="Telephone.Name_Telephone" sourceColumn="Name_Telephone" />
  381. <Param name="@No_Telephone" type="Telephone.No_Telephone" sourceColumn="No_Telephone" />
  382. <Param name="@Focus_Telephone" type="Telephone.Focus_Telephone" sourceColumn="Focus_Telephone" />
  383. </Params>
  384. </Update>
  385. <Delete CmdType="Text" CmdText="DELETE Telephone WHERE ID_Telephone=@ID_Telephone">
  386. <Params>
  387. <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
  388. </Params>
  389. </Delete>
  390. <UNIQUEErrorReport ErrorMessage="电话名称或电话号码已经存在!"/>
  391. </Table>
  392. <Table name="TransporterList" Type="Other">
  393. <GetSchema CmdType="Text" CmdText="SELECT top 0 No_Transporter,ShortName_Transporter From Transporter" />
  394. </Table>
  395. </Tables>
  396. <Search>
  397. <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">
  398. <Tables>
  399. <Table name="DefaultTelephone" />
  400. </Tables>
  401. </SearchDefaultPhone>
  402. <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">
  403. <Tables>
  404. <Table name="DefaultFax" />
  405. </Tables>
  406. </SearchDefaultFax>
  407. <SearchZone CmdType="Text" CmdText="Select Name_TypeDef From TypeDef Where Type_TypeDef = 4">
  408. <Tables>
  409. <Table name="Zone" />
  410. </Tables>
  411. </SearchZone>
  412. <SearchName CmdType="Text" CmdText="Select Name_TypeDef From TypeDef Where Type_TypeDef = 5">
  413. <Tables>
  414. <Table name="Name" />
  415. </Tables>
  416. </SearchName>
  417. <SearchAllTransporter CmdType="Text" CmdText="SELECT Transporter.* FROM Transporter">
  418. <Tables>
  419. <Table name="AllTransporter" />
  420. </Tables>
  421. </SearchAllTransporter>
  422. <SearchTransporterList CmdType="Text" CmdText="SELECT No_Transporter,ShortName_Transporter From Transporter Where SuspendDate_Transporter Is Null">
  423. <Tables>
  424. <Table name="TransporterList" />
  425. </Tables>
  426. </SearchTransporterList>
  427. <SearchAllTransporterList CmdType="Text" CmdText="SELECT No_Transporter,ShortName_Transporter From Transporter">
  428. <Tables>
  429. <Table name="TransporterList" />
  430. </Tables>
  431. </SearchAllTransporterList>
  432. <SearchTransporterWithNo CmdType="Text" CmdText="DECLARE @ID_Transporter uniqueidentifier
  433. SELECT Transporter.*, a.Name_User AS CreatorName_Transporter,b.Name_User AS LastModUser_TransporterName
  434. ,Employee.Name_Employee as MainPrincipal_Transporter,Employee.No_Employee
  435. FROM Transporter
  436. Left Join Employee On Employee.ID_Employee=Transporter.ID_Principal
  437. left join AppUser a on a.ID_User = Transporter.Creator_Transporter
  438. left join AppUser b on b.ID_User = Transporter.LastModUser_Transporter
  439. where Transporter.No_Transporter = @No_Transporter
  440. SELECT @ID_Transporter = Transporter.ID_Transporter FROM Transporter where Transporter.No_Transporter = @No_Transporter
  441. SELECT * from FreightMode where FreightMode.ID_Transporter = @ID_Transporter
  442. SELECT * from Telephone where Telephone.ID_Person = @ID_Transporter
  443. SELECT * from Fax where Fax.ID_Person = @ID_Transporter">
  444. <Params>
  445. <Param name="@No_Transporter" type="Transporter.No_Transporter" Index="0" />
  446. </Params>
  447. <Tables>
  448. <Table name="Transporter" />
  449. <Table name="FreightMode" />
  450. <Table name="Telephone" />
  451. <Table name="Fax"/>
  452. </Tables>
  453. </SearchTransporterWithNo>
  454. <SearchTransporterFirst CmdType="Text" CmdText="DECLARE @ID_Transporter uniqueidentifier
  455. DECLARE @NextNo nvarchar(64)
  456. SET @NextNo = @No_Transporter
  457. SELECT TOP 1 @NextNo = Transporter.No_Transporter FROM Transporter ORDER BY Transporter.No_Transporter
  458. SELECT Transporter.*, a.Name_User AS CreatorName_Transporter,b.Name_User AS LastModUser_TransporterName
  459. ,Employee.Name_Employee as MainPrincipal_Transporter, Employee.No_Employee
  460. FROM Transporter
  461. Left Join Employee On Employee.ID_Employee=Transporter.ID_Principal
  462. left join AppUser a on a.ID_User = Transporter.Creator_Transporter
  463. left join AppUser b on b.ID_User = Transporter.LastModUser_Transporter
  464. where Transporter.No_Transporter = @NextNo
  465. SELECT @ID_Transporter = Transporter.ID_Transporter FROM Transporter where Transporter.No_Transporter = @NextNo
  466. SELECT * from FreightMode where FreightMode.ID_Transporter = @ID_Transporter
  467. SELECT * from Telephone where Telephone.ID_Person = @ID_Transporter
  468. SELECT * from Fax where Fax.ID_Person = @ID_Transporter">
  469. <Params>
  470. <Param name="@No_Transporter" type="Transporter.No_Transporter" Index="0" />
  471. </Params>
  472. <Tables>
  473. <Table name="Transporter" />
  474. <Table name="FreightMode" />
  475. <Table name="Telephone" />
  476. <Table name="Fax"/>
  477. </Tables>
  478. </SearchTransporterFirst>
  479. <SearchTransporterPrevious CmdType="Text" CmdText="DECLARE @ID_Transporter uniqueidentifier
  480. DECLARE @NextNo nvarchar(64)
  481. SET @NextNo = @No_Transporter
  482. SELECT TOP 1 @NextNo = Transporter.No_Transporter FROM Transporter WHERE Transporter.No_Transporter &lt; @No_Transporter ORDER BY Transporter.No_Transporter Desc
  483. SELECT Transporter.*, a.Name_User AS CreatorName_Transporter,b.Name_User AS LastModUser_TransporterName
  484. ,Employee.Name_Employee as MainPrincipal_Transporter, Employee.No_Employee
  485. FROM Transporter
  486. Left Join Employee On Employee.ID_Employee=Transporter.ID_Principal
  487. left join AppUser a on a.ID_User = Transporter.Creator_Transporter
  488. left join AppUser b on b.ID_User = Transporter.LastModUser_Transporter
  489. where Transporter.No_Transporter = @NextNo
  490. SELECT @ID_Transporter = Transporter.ID_Transporter FROM Transporter where Transporter.No_Transporter = @NextNo
  491. SELECT * from FreightMode where FreightMode.ID_Transporter = @ID_Transporter
  492. SELECT * from Telephone where Telephone.ID_Person = @ID_Transporter
  493. SELECT * from Fax where Fax.ID_Person = @ID_Transporter">
  494. <Params>
  495. <Param name="@No_Transporter" type="Transporter.No_Transporter" Index="0" />
  496. </Params>
  497. <Tables>
  498. <Table name="Transporter" />
  499. <Table name="FreightMode" />
  500. <Table name="Telephone" />
  501. <Table name="Fax"/>
  502. </Tables>
  503. </SearchTransporterPrevious>
  504. <SearchTransporterNext CmdType="Text" CmdText="DECLARE @ID_Transporter uniqueidentifier
  505. DECLARE @NextNo nvarchar(64)
  506. SET @NextNo = @No_Transporter
  507. SELECT TOP 1 @NextNo = Transporter.No_Transporter FROM Transporter WHERE Transporter.No_Transporter &gt; @No_Transporter ORDER BY Transporter.No_Transporter
  508. SELECT Transporter.*, a.Name_User AS CreatorName_Transporter,b.Name_User AS LastModUser_TransporterName
  509. ,Employee.Name_Employee as MainPrincipal_Transporter, Employee.No_Employee
  510. FROM Transporter
  511. Left Join Employee On Employee.ID_Employee=Transporter.ID_Principal
  512. left join AppUser a on a.ID_User = Transporter.Creator_Transporter
  513. left join AppUser b on b.ID_User = Transporter.LastModUser_Transporter
  514. where Transporter.No_Transporter = @NextNo
  515. SELECT @ID_Transporter = Transporter.ID_Transporter FROM Transporter where Transporter.No_Transporter = @NextNo
  516. SELECT * from FreightMode where FreightMode.ID_Transporter = @ID_Transporter
  517. SELECT * from Telephone where Telephone.ID_Person = @ID_Transporter
  518. SELECT * from Fax where Fax.ID_Person = @ID_Transporter">
  519. <Params>
  520. <Param name="@No_Transporter" type="Transporter.No_Transporter" Index="0" />
  521. </Params>
  522. <Tables>
  523. <Table name="Transporter" />
  524. <Table name="FreightMode" />
  525. <Table name="Telephone" />
  526. <Table name="Fax"/>
  527. </Tables>
  528. </SearchTransporterNext>
  529. <SearchTransporterLast CmdType="Text" CmdText="DECLARE @ID_Transporter uniqueidentifier
  530. DECLARE @NextNo nvarchar(64)
  531. SET @NextNo = @No_Transporter
  532. SELECT TOP 1 @NextNo = Transporter.No_Transporter FROM Transporter ORDER BY Transporter.No_Transporter DESC
  533. SELECT Transporter.*, a.Name_User AS CreatorName_Transporter,b.Name_User AS LastModUser_TransporterName
  534. ,Employee.Name_Employee as MainPrincipal_Transporter, Employee.No_Employee
  535. FROM Transporter
  536. Left Join Employee On Employee.ID_Employee=Transporter.ID_Principal
  537. left join AppUser a on a.ID_User = Transporter.Creator_Transporter
  538. left join AppUser b on b.ID_User = Transporter.LastModUser_Transporter
  539. where Transporter.No_Transporter = @NextNo
  540. SELECT @ID_Transporter = Transporter.ID_Transporter FROM Transporter where Transporter.No_Transporter = @NextNo
  541. SELECT * from FreightMode where FreightMode.ID_Transporter = @ID_Transporter
  542. SELECT * from Telephone where Telephone.ID_Person = @ID_Transporter
  543. SELECT * from Fax where Fax.ID_Person = @ID_Transporter">
  544. <Params>
  545. <Param name="@No_Transporter" type="Transporter.No_Transporter" Index="0" />
  546. </Params>
  547. <Tables>
  548. <Table name="Transporter" />
  549. <Table name="FreightMode" />
  550. <Table name="Telephone" />
  551. <Table name="Fax"/>
  552. </Tables>
  553. </SearchTransporterLast>
  554. <SearchMainPrincipal CmdType="Text" CmdText="SELECT * from Employee order by No_Employee">
  555. <Tables>
  556. <Table name="Employee" />
  557. </Tables>
  558. </SearchMainPrincipal>
  559. <!--<SearchTelephone CmdType="Text" CmdText="SELECT * from Telephone where Telephone.ID_Person=@ID_Transporter">
  560. <Params>
  561. <Param name="@ID_Transporter" type="Transporter.ID_Transporter" Index="0" />
  562. </Params>
  563. <Tables>
  564. <Table name="Telephone" />
  565. </Tables>
  566. </SearchTelephone>
  567. <SearchFax CmdType="Text" CmdText="SELECT * from Fax where Fax.ID_Person=@ID_Transporter">
  568. <Params>
  569. <Param name="@ID_Transporter" type="Fax.ID_Transporter" Index="0" />
  570. </Params>
  571. <Tables>
  572. <Table name="Fax" />
  573. </Tables>
  574. </SearchFax>-->
  575. </Search>
  576. </Server>
  577. <Lables>
  578. <Search>
  579. Empty();
  580. NewInstance();
  581. tbNo.ReadOnly=false;
  582. txtShortName.ReadOnly=true;
  583. txtName.ReadOnly=true;
  584. txtRegistedAddress.ReadOnly=true;
  585. cbCountry.Enabled=false;
  586. txtPostalCode.ReadOnly=true;
  587. cbMainPrincipal.Enabled=false;
  588. txtLinkman.ReadOnly=true;
  589. dttCreateDate.ReadOnly=true;
  590. dtpIsSuspend.Enabled=false;
  591. txtComment.ReadOnly=true;
  592. toolBar.EnableSubmit=false;
  593. toolBar.EnableModify=false;
  594. toolBar.EnableDelete=false;
  595. toolBar.EnablePrint=false;
  596. pcPhone.ReadOnly=true;
  597. pcFax.ReadOnly=true;
  598. dgFreightMode.ReadOnly=true;
  599. #Transporter.CreateDate_Transporter=DBNull();
  600. #Transporter.SuspendDate_Transporter=DBNull();
  601. #Transporter.LastModUser_Transporter=DBNull();
  602. #Transporter.LastModDate_Transporter=DBNull();
  603. if(ckDisplay.Checked)
  604. #Transporter.IsDisplay=1;
  605. else
  606. #Transporter.IsDisplay=0;
  607. UpdateForm(true, "");
  608. tbNo.Focus();
  609. @Status=0;
  610. </Search>
  611. <New>
  612. Empty();
  613. NewInstance();
  614. tbNo.ReadOnly=true;
  615. txtShortName.ReadOnly=false;
  616. txtName.ReadOnly=false;
  617. txtRegistedAddress.ReadOnly=false;
  618. cbCountry.Enabled=true;
  619. txtPostalCode.ReadOnly=false;
  620. cbMainPrincipal.Enabled=true;
  621. txtLinkman.ReadOnly=false;
  622. dtpIsSuspend.Enabled=true;
  623. txtComment.ReadOnly=false;
  624. toolBar.EnableSubmit=GetRight(@Title,"新增");
  625. toolBar.EnableModify=false;
  626. toolBar.EnableDelete=false;
  627. toolBar.EnablePrint=false;
  628. dgFreightMode.ReadOnly=false;
  629. #Transporter.No_Transporter=tbNo.CValue;
  630. #Transporter.CreatorName_Transporter=GetCurrentUser();<!--得到当前用户。引擎应支持-->
  631. #Transporter.ID_Transporter=NewGuid();
  632. #Transporter.Creator_Transporter=GetLoginUserID();
  633. #Transporter.Country_Transporter=40;
  634. #Transporter.CreateDate_Transporter=DateTimeNow();
  635. #Transporter.SuspendDate_Transporter=DBNull();
  636. #Transporter.LastModUser_Transporter=DBNull();
  637. #Transporter.LastModDate_Transporter=DBNull();
  638. Search("SearchDefaultFax");
  639. Search("SearchDefaultPhone");
  640. MergeTable("#DefaultFax","#Fax");
  641. MergeTable("#DefaultTelephone","#Telephone");
  642. if(ckDisplay.Checked)
  643. #Transporter.IsDisplay=1;
  644. else
  645. #Transporter.IsDisplay=0;
  646. UpdateForm(true, "");
  647. pcPhone.ReadOnly=false;
  648. pcFax.ReadOnly=false;
  649. txtShortName.Focus();
  650. @Status=1;
  651. </New>
  652. <View>
  653. tbNo.ReadOnly=false;
  654. txtShortName.ReadOnly=true;
  655. txtName.ReadOnly=true;
  656. txtRegistedAddress.ReadOnly=true;
  657. cbCountry.Enabled=false;
  658. txtPostalCode.ReadOnly=true;
  659. cbMainPrincipal.Enabled=false;
  660. txtLinkman.ReadOnly=true;
  661. dtpIsSuspend.Enabled=false;
  662. txtComment.ReadOnly=true;
  663. toolBar.EnableSubmit=false;
  664. toolBar.EnableModify=GetRight(@Title,"修改");
  665. toolBar.EnableDelete=GetRight(@Title,"删除");
  666. toolBar.EnablePrint=GetRight(@Title,"打印");
  667. pcPhone.ReadOnly=true;
  668. pcFax.ReadOnly=true;
  669. dgFreightMode.ReadOnly=true;
  670. if(ckDisplay.Checked)
  671. #Transporter.IsDisplay=1;
  672. else
  673. #Transporter.IsDisplay=0;
  674. UpdateForm(true, "");
  675. @Status=2;
  676. </View>
  677. <Modify>
  678. tbNo.ReadOnly=true;
  679. txtShortName.ReadOnly=false;
  680. txtName.ReadOnly=false;
  681. txtRegistedAddress.ReadOnly=false;
  682. cbCountry.Enabled=true;
  683. txtPostalCode.ReadOnly=false;
  684. cbMainPrincipal.Enabled=true;
  685. txtLinkman.ReadOnly=false;
  686. dtpIsSuspend.Enabled=true;
  687. txtComment.ReadOnly=false;
  688. toolBar.EnableSubmit=GetRight(@Title,"新增");
  689. toolBar.EnableModify=false;
  690. toolBar.EnableDelete=GetRight(@Title,"删除");
  691. toolBar.EnablePrint=false;
  692. pcPhone.ReadOnly=false;
  693. pcFax.ReadOnly=false;
  694. dgFreightMode.ReadOnly=false;
  695. #Transporter.LastModUser_TransporterName=GetCurrentUser();
  696. #Transporter.LastModUser_Transporter=GetLoginUserID();
  697. #Transporter.LastModDate_Transporter=DateTimeNow();
  698. if(ckDisplay.Checked)
  699. #Transporter.IsDisplay=1;
  700. else
  701. #Transporter.IsDisplay=0;
  702. UpdateForm(true, "");
  703. txtShortName.Focus();
  704. @Status=3;
  705. </Modify>
  706. <SubmitButtonClick>
  707. <![CDATA[
  708. if(txtShortName.CValue=="")
  709. {
  710. MessageBox("请输入运输商简称!",@Title);
  711. txtShortName.Focus();
  712. return;
  713. }
  714. if(txtName.CValue=="")
  715. {
  716. MessageBox("请输入运输商名称!",@Title);
  717. txtName.Focus();
  718. return;
  719. }
  720. if(cbCountry.CValue==0)
  721. {
  722. tbDetail.SelectedIndex=0;
  723. MessageBox("请输入国家名称!",@Title);
  724. cbCountry.Focus();
  725. return;
  726. }
  727. if(!cbMainPrincipal.CheckSelectedItem())
  728. {
  729. MessageBox("请选择有效的主要负责人!",@Title);
  730. tbDetail.SelectedIndex = 0;
  731. cbMainPrincipal.Focus();
  732. return;
  733. }
  734. UpdateForm(false, "");
  735. if(@Status==1)
  736. {
  737. SuspendLayout();
  738. for(@i=RowCount("#FreightMode")-1;@i>=0;@i=@i-1)
  739. {
  740. SetPosition("#FreightMode", @i);
  741. if(Equals(#FreightMode.ID_FreightMode,GuidEmpty()))
  742. #FreightMode.ID_FreightMode = NewGuid();
  743. #FreightMode.ID_Transporter = #Transporter.ID_Transporter;
  744. }
  745. for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1)
  746. {
  747. SetPosition("#Telephone",@i);
  748. if(Equals(#Telephone.ID_Telephone,GuidEmpty()))
  749. #Telephone.ID_Telephone=NewGuid();
  750. #Telephone.ID_Person=#Transporter.ID_Transporter;
  751. }
  752. for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1)
  753. {
  754. SetPosition("#Fax",@i);
  755. if(Equals(#Fax.ID_Fax,GuidEmpty()))
  756. #Fax.ID_Fax=NewGuid();
  757. #Fax.ID_Person=#Transporter.ID_Transporter;
  758. }
  759. ResumeLayout();
  760. New();
  761. }
  762. else if(@Status == 3)
  763. {
  764. SuspendLayout();
  765. for(@i=RowCount("#FreightMode")-1;@i>=0;@i=@i-1)
  766. {
  767. SetPosition("#FreightMode", @i);
  768. if(Equals(#FreightMode.ID_FreightMode,GuidEmpty()))
  769. #FreightMode.ID_FreightMode = NewGuid();
  770. #FreightMode.ID_Transporter = #Transporter.ID_Transporter;
  771. }
  772. for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1)
  773. {
  774. SetPosition("#Telephone",@i);
  775. if(Equals(#Telephone.ID_Telephone,GuidEmpty()))
  776. #Telephone.ID_Telephone=NewGuid();
  777. #Telephone.ID_Person=#Transporter.ID_Transporter;
  778. }
  779. for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1)
  780. {
  781. SetPosition("#Fax",@i);
  782. if(Equals(#Fax.ID_Fax,GuidEmpty()))
  783. #Fax.ID_Fax=NewGuid();
  784. #Fax.ID_Person=#Transporter.ID_Transporter;
  785. }
  786. ResumeLayout();
  787. #Transporter.LastModDate_Transporter=DateTimeNow();
  788. Update();
  789. }
  790. ChangeMode("View");
  791. ]]>
  792. </SubmitButtonClick>
  793. </Lables>
  794. </Form>
  795. </Forms>