FrmCompany.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- 编辑使用 XMLSpy v2006 U (http://www.altova.com) 由 any (any) -->
  3. <Forms>
  4. <Form Name="FrmCompany">
  5. <Client>
  6. <Events>
  7. <Load><![CDATA[
  8. @HaveSearchCompanyList=false;
  9. @Title="公司基本资料";
  10. GetSchema();
  11. ChangeMode("Search");
  12. ]]></Load>
  13. <Closing>
  14. ;
  15. </Closing>
  16. <Closed>
  17. ;
  18. </Closed>
  19. </Events>
  20. <Mode>
  21. <Search>
  22. <Lable name="Search"/>
  23. </Search>
  24. <New>
  25. <Lable name="New"/>
  26. </New>
  27. <View>
  28. <Lable name="View"/>
  29. </View>
  30. <Modify>
  31. <Lable name="Modify"/>
  32. </Modify>
  33. </Mode>
  34. <Controls>
  35. <IKTextButton name="tbNo" DataSource="Company.No_Company">
  36. <Events>
  37. <Enter><![CDATA[
  38. if(tbNo.ReadOnly == false)
  39. {
  40. if(tbNo.CValue != StringEmpty())
  41. {
  42. UpdateForm(false, "");
  43. if(Search("SearchCompanyWithNo", tbNo.CValue))
  44. {
  45. ChangeMode("View");
  46. }
  47. else
  48. {
  49. MessageBox("该公司编号不存在!",@Title);
  50. }
  51. }
  52. else
  53. {
  54. MessageBox("请输入公司编号!",@Title);
  55. }
  56. }
  57. ]]>
  58. </Enter>
  59. <Click>
  60. @Temp = ShowSearchBox("CompanySearch","INFOMATION");
  61. if(@Temp != StringEmpty())
  62. {
  63. tbNo.CValue = @Temp;
  64. ActiveControlEvent("tbNo", "Enter");
  65. UpdateForm(false, "");
  66. if(Search("SearchCompanyWithNo", tbNo.CValue))
  67. {
  68. ChangeMode("View");
  69. }
  70. }
  71. </Click>
  72. </Events>
  73. </IKTextButton>
  74. <IKTextBox name="txtShortName" DataSource="Company.ShortName_Company"/>
  75. <IKTextBox name="txtName" DataSource="Company.Name_Company"/>
  76. <IKTextBox name="txtRegistedAddress" DataSource="Company.RegistedAddress_Company"/>
  77. <IKCountryCombo name="cbCountry" DataSource="Company.Country_Company"/>
  78. <IKTextBox name="txtPostalCode" DataSource="Company.PostalCode_Company"/>
  79. <IKTextBox name="txtTel" DataSource="Company.Tel_Company"/>
  80. <IKTextBox name="txtFax" DataSource="Company.Fax_Company" />
  81. <IKTextBox name="txtSendAddress" DataSource="Company.SendAddress_Company"/>
  82. <IKDateTimeText name="dttCreateDate" DataSource="Company.CreateDate_Company"/>
  83. <IKTextBox name="txtCreator" DataSource="Company.Creator_Company"/>
  84. <IKDateTimePause name="dtpIsSuspend" DataSource="Company.SuspendDate_Company"/>
  85. <IKTextBox name="txtComment" DataSource="Company.Comment_Company"/>
  86. <IKTextBox name="txtBank" DataSource="Company.Bank_Company"/>
  87. <IKTextBox name="txtMender" DataSource="Company.LastModUser_Company"></IKTextBox>
  88. <IKDateTimeText name="dttMendeDate" DataSource="Company.LastModDate_Company"></IKDateTimeText>
  89. <IKTextBox name="txtAccount" DataSource="Company.Account_Company"/>
  90. <IKTextBox name="txtRevenueRegisterNo" DataSource="Company.RevenueRegisterNo_Company"/>
  91. <IKTextBox name="txtInvoiceTitle" DataSource="Company.InvoiceTitle_Company"/>
  92. <IKTextBox name="txtInvoiceAddress" DataSource="Company.InvoiceAddress_Company"/>
  93. <IKDataGridEx name="dgCompany" DataSource="CompanyList" TableStyleIndex="0">
  94. <DataColumn Index="0" DataSource="CompanyList.No_Company" />
  95. <DataColumn Index="1" DataSource="CompanyList.ShortName_Company" />
  96. <Events>
  97. <RowHeaderDoubleClick>
  98. if(Search("SearchCompanyWithNo",#CompanyList.No_Company))
  99. {
  100. ChangeMode("View");
  101. }
  102. </RowHeaderDoubleClick>
  103. </Events>
  104. </IKDataGridEx>
  105. <IKFormToolBar name="toolBar">
  106. <Events>
  107. <ClickFirst>
  108. if(Search("SearchCompanyFirst", tbNo.CValue))
  109. {
  110. ChangeMode("View");
  111. }
  112. </ClickFirst>
  113. <ClickPrev>
  114. if(Search("SearchCompanyPrevious", tbNo.CValue))
  115. {
  116. ChangeMode("View");
  117. }
  118. </ClickPrev>
  119. <ClickNext>
  120. if(Search("SearchCompanyNext", tbNo.CValue))
  121. {
  122. ChangeMode("View");
  123. }
  124. </ClickNext>
  125. <ClickLast>
  126. if(Search("SearchCompanyLast", tbNo.CValue))
  127. {
  128. ChangeMode("View");
  129. }
  130. </ClickLast>
  131. <ClickEmpty>
  132. ChangeMode("Search");
  133. </ClickEmpty>
  134. <ClickNew>
  135. ;
  136. </ClickNew>
  137. <ClickSubmit>
  138. <Lable name="SubmitButtonClick"/>
  139. </ClickSubmit>
  140. <ClickModify>
  141. ChangeMode("Modify");
  142. </ClickModify>
  143. <ClickDelete>
  144. Delete(); ChangeMode("Search");
  145. </ClickDelete>
  146. <ClickPrint>
  147. #Company.CountryName = cbCountry.Text;
  148. PrintReport();
  149. </ClickPrint>
  150. <ClickAudit>
  151. ;
  152. </ClickAudit>
  153. <ClickUnAudit>
  154. ;
  155. </ClickUnAudit>
  156. <ClickImport>
  157. ;
  158. </ClickImport>
  159. <ClickExport>
  160. ;
  161. </ClickExport>
  162. <ClickClose>
  163. ;
  164. </ClickClose>
  165. <ClickExpand>
  166. if(toolBar.ExpandForm==true)
  167. {
  168. pnRight.Visible=true;<!--PanelRight is not existed-->
  169. if(!@HaveSearchCompanyList)
  170. {
  171. Search("SearchCompanyList");
  172. @HaveSearchCompanyList=true;
  173. }
  174. }
  175. else
  176. {
  177. pnRight.Visible=false;
  178. }
  179. </ClickExpand>
  180. </Events>
  181. </IKFormToolBar>
  182. </Controls>
  183. <LockInfomation LockID="ID_Company" LockNO="No_Company" LockSearchFunction="SearchCompanyWithNo"/>
  184. <ChildForms>
  185. <ChildForm name="CompanySearch" DataSource="Company" SearchFunction="SearchAllCompany" SearchFunctionByNo="SearchCompanyWithNo" MappingName="公司">
  186. <DataColumn Index="0" MappingName="#Company.No_Company" HeaderText="公司编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  187. <DataColumn Index="1" MappingName="#Company.ShortName_Company" HeaderText="公司简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  188. </ChildForm>
  189. </ChildForms>
  190. </Client>
  191. <Server>
  192. <Tables>
  193. <Table name="Company" Type="Parent">
  194. <GetSchema ConnectDB="ManageDB" CmdType="Text" CmdText=" SELECT TOP 0 Company.* , convert(nvarchar(64),'') as CountryName FROM Company"/>
  195. <Update ConnectDB="ManageDB" CmdType="Text" CmdText="UPDATE Company SET
  196. ShortName_Company = @ShortName_Company,
  197. Name_Company = @Name_Company,
  198. RegistedAddress_Company = @RegistedAddress_Company,
  199. Country_Company = @Country_Company,
  200. PostalCode_Company = @PostalCode_Company,
  201. SendAddress_Company = @SendAddress_Company,
  202. CreateDate_Company = @CreateDate_Company,
  203. Creator_Company = @Creator_Company,
  204. Comment_Company = @Comment_Company,
  205. Bank_Company = @Bank_Company,
  206. Account_Company = @Account_Company,
  207. RevenueRegisterNo_Company = @RevenueRegisterNo_Company,
  208. InvoiceTitle_Company = @InvoiceTitle_Company,
  209. InvoiceAddress_Company = @InvoiceAddress_Company,
  210. SuspendDate_Company = @SuspendDate_Company,
  211. Fax_Company=@Fax_Company,
  212. Tel_Company=@Tel_Company,
  213. LastModUser_Company=@LastModUser_Company,
  214. LastModDate_Company=@LastModDate_Company
  215. WHERE ID_Company = @ID_Company">
  216. <Params>
  217. <Param name="@ID_Company" type="Company.ID_Company" sourceColumn="ID_Company"/>
  218. <Param name="@ShortName_Company" type="Company.ShortName_Company" sourceColumn="ShortName_Company"/>
  219. <Param name="@Name_Company" type="Company.Name_Company" sourceColumn="Name_Company"/>
  220. <Param name="@RegistedAddress_Company" type="Company.RegistedAddress_Company" sourceColumn="RegistedAddress_Company"/>
  221. <Param name="@Country_Company" type="Company.Country_Company" sourceColumn="Country_Company"/>
  222. <Param name="@PostalCode_Company" type="Company.PostalCode_Company" sourceColumn="PostalCode_Company"/>
  223. <Param name="@SendAddress_Company" type="Company.SendAddress_Company" sourceColumn="SendAddress_Company"/>
  224. <Param name="@CreateDate_Company" type="Company.CreateDate_Company" sourceColumn="CreateDate_Company"/>
  225. <Param name="@Creator_Company" type="Company.Creator_Company" sourceColumn="Creator_Company"/>
  226. <Param name="@Comment_Company" type="Company.Comment_Company" sourceColumn="Comment_Company"/>
  227. <Param name="@Bank_Company" type="Company.Bank_Company" sourceColumn="Bank_Company"/>
  228. <Param name="@Account_Company" type="Company.Account_Company" sourceColumn="Account_Company"/>
  229. <Param name="@RevenueRegisterNo_Company" type="Company.RevenueRegisterNo_Company" sourceColumn="RevenueRegisterNo_Company"/>
  230. <Param name="@InvoiceTitle_Company" type="Company.InvoiceTitle_Company" sourceColumn="InvoiceTitle_Company"/>
  231. <Param name="@InvoiceAddress_Company" type="Company.InvoiceAddress_Company" sourceColumn="InvoiceAddress_Company"/>
  232. <Param name="@SuspendDate_Company" type="Company.SuspendDate_Company" sourceColumn="SuspendDate_Company"/>
  233. <Param name="@Fax_Company" type="Company.Fax_Company" sourceColumn="Fax_Company"/>
  234. <Param name="@Tel_Company" type="Company.Tel_Company" sourceColumn="Tel_Company"/>
  235. <Param name="@LastModUser_Company" type="Company.LastModUser_Company" sourceColumn="LastModUser_Company"/>
  236. <Param name="@LastModDate_Company" type="Company.LastModDate_Company" sourceColumn="LastModDate_Company"/>
  237. </Params>
  238. </Update>
  239. </Table>
  240. <Table name="CompanyList" Type="Other">
  241. <GetSchema ConnectDB="ManageDB" CmdType="Text" CmdText="SELECT Top 0 Company.No_Company,Company.ShortName_Company FROM Company"/>
  242. </Table>
  243. </Tables>
  244. <Search>
  245. <SearchAllCompany ConnectDB="ManageDB" CmdType="Text" CmdText="SELECT Company.No_Company,Company.ShortName_Company FROM Company">
  246. <Tables>
  247. <Table name="AllCompany" />
  248. </Tables>
  249. </SearchAllCompany>
  250. <SearchCompanyList ConnectDB="ManageDB" CmdType="Text" CmdText=" SELECT Company.No_Company,Company.ShortName_Company FROM Company">
  251. <Tables>
  252. <Table name="CompanyList" />
  253. </Tables>
  254. </SearchCompanyList>
  255. <SearchCompanyWithNo ConnectDB="ManageDB" CmdType="Text" CmdText="DECLARE @ID_Company uniqueidentifier SELECT Company.* FROM Company where Company.No_Company = @No_Company
  256. SELECT @ID_Company = Company.ID_Company FROM Company WHERE Company.No_Company = @No_Company
  257. ">
  258. <Params>
  259. <Param name="@No_Company" type="Company.No_Company" Index="0"/>
  260. </Params>
  261. <Tables>
  262. <Table name="Company"/>
  263. </Tables>
  264. </SearchCompanyWithNo>
  265. <SearchCompanyFirst ConnectDB="ManageDB" CmdType="Text" CmdText=" DECLARE @ID_Company uniqueidentifier DECLARE @NextNo nvarchar(64)
  266. SET @NextNo = @No_Company
  267. SELECT TOP 1 @NextNo = Company.No_Company FROM Company ORDER BY Company.No_Company
  268. SELECT Company.* FROM Company where Company.No_Company = @NextNo
  269. SELECT @ID_Company = Company.ID_Company FROM Company WHERE Company.No_Company = @NextNo
  270. ">
  271. <Params>
  272. <Param name="@No_Company" type="Company.No_Company" Index="0"/>
  273. </Params>
  274. <Tables>
  275. <Table name="Company"/>
  276. </Tables>
  277. </SearchCompanyFirst>
  278. <SearchCompanyPrevious ConnectDB="ManageDB" CmdType="Text" CmdText="DECLARE @ID_Company uniqueidentifier DECLARE @NextNo nvarchar(64)
  279. SET @NextNo = @No_Company
  280. SELECT TOP 1 @NextNo = Company.No_Company FROM Company WHERE Company.No_Company &lt; @No_Company ORDER BY Company.No_Company Desc
  281. SELECT Company.* FROM Company where Company.No_Company = @NextNo
  282. SELECT @ID_Company = Company.ID_Company FROM Company WHERE Company.No_Company = @NextNo
  283. ">
  284. <Params>
  285. <Param name="@No_Company" type="Company.No_Company" Index="0"/>
  286. </Params>
  287. <Tables>
  288. <Table name="Company"/>
  289. </Tables>
  290. </SearchCompanyPrevious>
  291. <SearchCompanyNext ConnectDB="ManageDB" CmdType="Text" CmdText="DECLARE @ID_Company uniqueidentifier DECLARE @NextNo nvarchar(64)
  292. SET @NextNo = @No_Company
  293. SELECT TOP 1 @NextNo = Company.No_Company FROM Company WHERE Company.No_Company &gt; @No_Company ORDER BY Company.No_Company
  294. SELECT Company.* FROM Company where Company.No_Company = @NextNo
  295. SELECT @ID_Company = Company.ID_Company FROM Company WHERE Company.No_Company = @NextNo
  296. ">
  297. <Params>
  298. <Param name="@No_Company" type="Company.No_Company" Index="0"/>
  299. </Params>
  300. <Tables>
  301. <Table name="Company"/>
  302. </Tables>
  303. </SearchCompanyNext>
  304. <SearchCompanyLast ConnectDB="ManageDB" CmdType="Text" CmdText="DECLARE @ID_Company uniqueidentifier DECLARE @NextNo nvarchar(64)
  305. SET @NextNo = @No_Company
  306. SELECT TOP 1 @NextNo = Company.No_Company FROM Company ORDER BY Company.No_Company DESC
  307. SELECT Company.* FROM Company where Company.No_Company = @NextNo
  308. SELECT @ID_Company = Company.ID_Company FROM Company WHERE Company.No_Company = @NextNo
  309. ">
  310. <Params>
  311. <Param name="@No_Company" type="Company.No_Company" Index="0"/>
  312. </Params>
  313. <Tables>
  314. <Table name="Company"/>
  315. </Tables>
  316. </SearchCompanyLast>
  317. </Search>
  318. </Server>
  319. <Lables>
  320. <Search>
  321. Empty();
  322. NewInstance();
  323. tbNo.ReadOnly=false;
  324. txtShortName.ReadOnly=true;
  325. txtName.ReadOnly=true;
  326. txtRegistedAddress.ReadOnly=true;
  327. cbCountry.Enabled=false;
  328. txtPostalCode.ReadOnly=true;
  329. txtTel.ReadOnly=true;
  330. txtFax.ReadOnly=true;
  331. dtpIsSuspend.Enabled=false;
  332. txtComment.ReadOnly=true;
  333. txtSendAddress.ReadOnly=true;
  334. txtBank.Enabled=false;
  335. txtAccount.ReadOnly=true;
  336. txtRevenueRegisterNo.ReadOnly=true;
  337. txtInvoiceTitle.ReadOnly=true;
  338. txtInvoiceAddress.ReadOnly=true;
  339. toolBar.EnableSubmit=false;
  340. toolBar.EnableModify=false;
  341. toolBar.EnableDelete=false;
  342. #Company.CreateDate_Company=DBNull();
  343. #Company.SuspendDate_Company=DBNull();
  344. #Company.LastModUser_Company=DBNull();
  345. #Company.LastModDate_Company=DBNull();
  346. UpdateForm(true, "");
  347. tbNo.Focus();
  348. @Status=0;
  349. </Search>
  350. <View>
  351. tbNo.ReadOnly=false;
  352. txtShortName.ReadOnly=true;
  353. txtName.ReadOnly=true;
  354. txtRegistedAddress.ReadOnly=true;
  355. cbCountry.Enabled=false;
  356. txtPostalCode.ReadOnly=true;
  357. txtTel.ReadOnly=true;
  358. txtFax.ReadOnly=true;
  359. dtpIsSuspend.Enabled=false;
  360. txtComment.ReadOnly=true;
  361. txtSendAddress.ReadOnly=true;
  362. txtBank.Enabled=false;
  363. txtAccount.ReadOnly=true;
  364. txtRevenueRegisterNo.ReadOnly=true;
  365. txtInvoiceTitle.ReadOnly=true;
  366. txtInvoiceAddress.ReadOnly=true;
  367. toolBar.EnableSubmit=false;
  368. if(Equals(GetLoginCompanyID(),#Company.ID_Company))
  369. toolBar.EnableModify=GetRight(@Title,"新增");
  370. else
  371. toolBar.EnableModify=false;
  372. toolBar.EnableDelete=GetRight(@Title,"删除");
  373. UpdateForm(true, "");
  374. @Status=2;
  375. </View>
  376. <Modify>
  377. tbNo.ReadOnly=true;
  378. txtShortName.ReadOnly=false;
  379. txtName.ReadOnly=false;
  380. txtRegistedAddress.ReadOnly=false;
  381. cbCountry.Enabled=true;
  382. txtPostalCode.ReadOnly=false;
  383. txtTel.ReadOnly=false;
  384. txtFax.ReadOnly=false;
  385. dtpIsSuspend.Enabled=false;
  386. txtComment.ReadOnly=false;
  387. txtSendAddress.ReadOnly=false;
  388. txtBank.Enabled=true;
  389. txtAccount.ReadOnly=false;
  390. txtRevenueRegisterNo.ReadOnly=false;
  391. txtInvoiceTitle.ReadOnly=false;
  392. txtInvoiceAddress.ReadOnly=false;
  393. toolBar.EnableSubmit=GetRight(@Title,"新增");
  394. toolBar.EnableModify=false;
  395. toolBar.EnableDelete=GetRight(@Title,"删除");
  396. #Company.LastModUser_Company=GetCurrentUser();
  397. #Company.LastModDate_Company=DateTimeNow();
  398. UpdateForm(true, "");
  399. txtShortName.Focus();
  400. @Status=3;
  401. </Modify>
  402. <SubmitButtonClick><![CDATA[
  403. if(txtShortName.CValue==StringEmpty())
  404. {
  405. MessageBox("请输入公司简称!",@Title);
  406. txtShortName.Focus();
  407. return;
  408. }
  409. if(txtName.CValue==StringEmpty())
  410. {
  411. MessageBox("请输入公司名称!",@Title);
  412. txtName.Focus();
  413. return;
  414. }
  415. if(cbCountry.CValue==0)
  416. {
  417. tbDetail.SelectedIndex=0;
  418. MessageBox("请输入国家名称!",@Title);
  419. cbCountry.Focus();
  420. return;
  421. }
  422. UpdateForm(false, "");
  423. if(@Status == 3)
  424. {
  425. #Company.LastModDate_Company=DateTimeNow();
  426. Update();
  427. }
  428. ChangeMode("View");
  429. ]]></SubmitButtonClick>
  430. </Lables>
  431. </Form>
  432. </Forms>