FrmRegionalLeader.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmRegionalLeader">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @SetFlag=1;
  9. @Title="业务区域设定";
  10. GetSchema();
  11. ChangeMode("Search");
  12. RecordHistoryRead("FrmRegionalLeader");
  13. ]]>
  14. </Load>
  15. <Closing>
  16. ;
  17. </Closing>
  18. <Closed>
  19. ;
  20. </Closed>
  21. </Events>
  22. <Mode>
  23. <Search>
  24. <Lable name="Search" />
  25. </Search>
  26. <New>
  27. <Lable name="New" />
  28. </New>
  29. <View>
  30. <Lable name="View" />
  31. </View>
  32. <Modify>
  33. <Lable name="Modify" />
  34. </Modify>
  35. </Mode>
  36. <Controls>
  37. <IKTextButton name="tbNo" DataSource="RegionalLeader.No_RegionalLeader">
  38. <Events>
  39. <Enter>
  40. <![CDATA[
  41. if(tbNo.ReadOnly == false)
  42. {
  43. if(tbNo.CValue != StringEmpty())
  44. {
  45. UpdateForm(false, "");
  46. if(Search("SearchRegionalLeaderWithNo", tbNo.CValue))
  47. {
  48. ChangeMode("View");
  49. }
  50. else
  51. {
  52. if(GetRight(@Title,"新增"))
  53. ChangeMode("New");
  54. else
  55. MessageBox("您没有新增区域业务负责人的权限!",@Title);
  56. }
  57. }
  58. else
  59. {
  60. MessageBox("请输入区域编号!",@Title);
  61. }
  62. }
  63. ]]>
  64. </Enter>
  65. <Click>
  66. @Temp = ShowSearchBox("RegionalLeaderSearch","INFOMATION",tbNo.CValue);
  67. if(@Temp != StringEmpty())
  68. {
  69. tbNo.CValue = @Temp;
  70. UpdateForm(false, "");
  71. if(Search("SearchRegionalLeaderWithNo",tbNo.CValue))
  72. {
  73. ChangeMode("View");
  74. }
  75. }
  76. </Click>
  77. </Events>
  78. </IKTextButton>
  79. <IKTextBox name="txtName" DataSource="RegionalLeader.Name_RegionalLeader"/>
  80. <IKDataGridEx name="dgEmployee" DataSource="Principal" TableStyleIndex="0">
  81. <DataColumn Index="0" DataSource="Principal.No_Employee" >
  82. <IKDataGridTextButtonColumn>
  83. <Events>
  84. <Click>
  85. @SetFlag=1;
  86. @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee);
  87. if(@temp != "")
  88. {
  89. ResumeColumnEvent("#Principal.No_Employee");
  90. #Principal.No_Employee = @temp;
  91. ClearColumnEvent();
  92. }
  93. </Click>
  94. <SetFlagBeforeClick>
  95. @SetFlag=0;
  96. </SetFlagBeforeClick>
  97. </Events>
  98. </IKDataGridTextButtonColumn>
  99. </DataColumn>
  100. <DataColumn Index="1" DataSource="Principal.Name_Employee" />
  101. <DataColumn Index="2" DataSource="Principal.Comment_Principal" />
  102. </IKDataGridEx>
  103. <IKFormToolBar name="toolBar">
  104. <Events>
  105. <ClickFirst>
  106. if(Search("SearchRegionalLeaderFirst", tbNo.CValue))
  107. {
  108. ChangeMode("View");
  109. }
  110. </ClickFirst>
  111. <ClickPrev>
  112. if(Search("SearchRegionalLeaderPrevious", tbNo.CValue))
  113. {
  114. ChangeMode("View");
  115. }
  116. </ClickPrev>
  117. <ClickNext>
  118. if(Search("SearchRegionalLeaderNext", tbNo.CValue))
  119. {
  120. ChangeMode("View");
  121. }
  122. </ClickNext>
  123. <ClickLast>
  124. if(Search("SearchRegionalLeaderLast", tbNo.CValue))
  125. {
  126. ChangeMode("View");
  127. }
  128. </ClickLast>
  129. <ClickNew>
  130. ;
  131. </ClickNew>
  132. <ClickEmpty>
  133. ChangeMode("Search");
  134. </ClickEmpty>
  135. <ClickSubmit>
  136. <Lable name="SubmitButtonClick" />
  137. </ClickSubmit>
  138. <ClickModify>
  139. ChangeMode("Modify");
  140. </ClickModify>
  141. <ClickDelete>
  142. Delete(); ChangeMode("Search");
  143. </ClickDelete>
  144. <ClickPrint>
  145. PrintReport();
  146. </ClickPrint>
  147. <ClickAudit>
  148. ;
  149. </ClickAudit>
  150. <ClickUnAudit>
  151. ;
  152. </ClickUnAudit>
  153. <ClickImport>
  154. ;
  155. </ClickImport>
  156. <ClickExport>
  157. ;
  158. </ClickExport>
  159. <ClickClose>
  160. ;
  161. </ClickClose>
  162. </Events>
  163. </IKFormToolBar>
  164. </Controls>
  165. <Tables>
  166. <Table name="Principal">
  167. <Events>
  168. <ColumnsChanged>
  169. <No_Employee>
  170. if(@SetFlag==0)
  171. {
  172. return;
  173. }
  174. if(Search("GetEmployeeNameByNo",#Principal.No_Employee))
  175. {
  176. #Principal.Name_Employee=#Employee.Name_Employee;
  177. #Principal.ID_Employee=#Employee.ID_Employee;
  178. if(!Equals(#Employee.SuspendDate_Employee,DBNull()))
  179. MessageBox("该员工已停用!",@Title);
  180. }
  181. else
  182. {
  183. MessageBox("该员工不存在!",@Title);
  184. #Principal.Name_Employee="";
  185. #Principal.ID_Employee=GuidEmpty();
  186. @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee);
  187. if(@temp != "")
  188. {
  189. ResumeColumnEvent("#Principal.No_Employee");
  190. #Principal.No_Employee = @temp;
  191. ClearColumnEvent();
  192. }
  193. }
  194. </No_Employee>
  195. </ColumnsChanged>
  196. </Events>
  197. </Table>
  198. </Tables>
  199. <LockInfomation LockID="ID_RegionalLeader" LockNO="No_RegionalLeader" LockSearchFunction="SearchRegionalLeaderWithNo"/>
  200. <ChildForms>
  201. <ChildForm name="RegionalLeaderSearch" DataSource="RegionalLeader" SearchFunction="SearchAllRegionalLeader" SearchFunctionCondition="SearchRegionalLeaderCondition" SearchFunctionByNo="SearchRegionalLeaderWithNo" MappingName="区域">
  202. <DataColumn Index="0" MappingName="#RegionalLeader.No_RegionalLeader" HeaderText="区域编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  203. <DataColumn Index="1" MappingName="#RegionalLeader.Name_RegionalLeader" HeaderText="区域名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  204. </ChildForm>
  205. <ChildForm name="EmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="SearchEmployeeWithNo" MappingName="员工" >
  206. <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" />
  207. <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  208. </ChildForm>
  209. </ChildForms>
  210. <FormatString>
  211. <Format name="SearchRegionalLeaderCondition">
  212. if(GetRight("区域业务负责人","全权查看"))
  213. {
  214. FormatString("");
  215. }
  216. </Format>
  217. </FormatString>
  218. </Client>
  219. <Server>
  220. <Tables>
  221. <Table name="RegionalLeader" Type="Parent">
  222. <GetSchema CmdType="Text" CmdText="SELECT TOP 0 RegionalLeader.* FROM RegionalLeader"/>
  223. <New CmdType="Text" CmdText="INSERT INTO RegionalLeader
  224. (ID_RegionalLeader,No_RegionalLeader,Name_RegionalLeader)
  225. VALUES
  226. (@ID_RegionalLeader,@No_RegionalLeader,@Name_RegionalLeader)
  227. ">
  228. <Params>
  229. <Param name="@ID_RegionalLeader" type="RegionalLeader.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
  230. <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" sourceColumn="No_RegionalLeader" />
  231. <Param name="@Name_RegionalLeader" type="RegionalLeader.Name_RegionalLeader" sourceColumn="Name_RegionalLeader" />
  232. </Params>
  233. </New>
  234. <Update CmdType="Text" CmdText="UPDATE RegionalLeader SET Name_RegionalLeader = @Name_RegionalLeader
  235. WHERE ID_RegionalLeader = @ID_RegionalLeader">
  236. <Params>
  237. <Param name="@ID_RegionalLeader" type="RegionalLeader.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
  238. <Param name="@Name_RegionalLeader" type="RegionalLeader.Name_RegionalLeader" sourceColumn="Name_RegionalLeader" />
  239. </Params>
  240. </Update>
  241. <Delete CmdType="Text" CmdText="DELETE Principal WHERE ID_RegionalLeader = @ID_RegionalLeader
  242. DELETE RegionalLeader WHERE ID_RegionalLeader = @ID_RegionalLeader
  243. ">
  244. <Params>
  245. <Param name="@ID_RegionalLeader" type="RegionalLeader.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
  246. </Params>
  247. </Delete>
  248. <FKErrorReport ErrorMessage="该区域业务负责人已被引用,删除失败!"/>
  249. <UNIQUEErrorReport ErrorMessage="该区域业务负责人编号已存在,提交失败!"/>
  250. </Table>
  251. <Table name="Principal" Type="Child">
  252. <GetSchema CmdType="Text" CmdText="SELECT top 0 Principal.*,Employee.Name_Employee AS Name_Employee
  253. ,Employee.No_Employee AS No_Employee,Employee.Comment_Employee as Comment_Employee
  254. FROM Principal
  255. INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
  256. " />
  257. <New CmdType="Text" CmdText=" INSERT INTO Principal (ID_Principal,ID_Person,ID_Employee,IsMain_Principal
  258. ,Comment_Principal,ID_RegionalLeader)
  259. VALUES(@ID_Principal,@ID_Person,@ID_Employee,@IsMain_Principal
  260. ,@Comment_Principal,@ID_RegionalLeader)
  261. " >
  262. <Params>
  263. <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
  264. <Param name="@ID_Person" type="Principal.ID_Person" sourceColumn="ID_Person" />
  265. <Param name="@ID_Employee" type="Principal.ID_Employee" sourceColumn="ID_Employee" />
  266. <Param name="@IsMain_Principal" type="Principal.IsMain_Principal" sourceColumn="IsMain_Principal" />
  267. <Param name="@Comment_Principal" type="Principal.Comment_Principal" sourceColumn="Comment_Principal" />
  268. <Param name="@ID_RegionalLeader" type="Principal.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
  269. </Params>
  270. </New>
  271. <Update CmdType="Text" CmdText="UPDATE Principal SET ID_Employee = @ID_Employee,IsMain_Principal = @IsMain_Principal,Comment_Principal = @Comment_Principal
  272. WHERE ID_Principal = @ID_Principal">
  273. <Params>
  274. <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
  275. <Param name="@ID_Employee" type="Principal.ID_Employee" sourceColumn="ID_Employee" />
  276. <Param name="@IsMain_Principal" type="Principal.IsMain_Principal" sourceColumn="IsMain_Principal" />
  277. <Param name="@Comment_Principal" type="Principal.Comment_Principal" sourceColumn="Comment_Principal" />
  278. </Params>
  279. </Update>
  280. <Delete CmdType="Text" CmdText="DELETE Principal WHERE ID_Principal = @ID_Principal">
  281. <Params>
  282. <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
  283. </Params>
  284. </Delete>
  285. </Table>
  286. <Table name="Employee" Type="Other">
  287. <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Employee" />
  288. </Table>
  289. </Tables>
  290. <Search>
  291. <SearchAllRegionalLeader CmdType="Text" CmdText="select * from RegionalLeader
  292. ">
  293. <Tables>
  294. <Table name="AllRegionalLeader" />
  295. </Tables>
  296. </SearchAllRegionalLeader>
  297. <SearchRegionalLeaderWithNo CmdType="Text" CmdText="DECLARE @ID_RegionalLeader uniqueidentifier
  298. SELECT RegionalLeader.* FROM RegionalLeader
  299. Where No_RegionalLeader=@No_RegionalLeader
  300. SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
  301. FROM RegionalLeader WHERE RegionalLeader.No_RegionalLeader = @No_RegionalLeader
  302. SELECT Principal.*,Employee.Name_Employee AS Name_Employee
  303. ,Employee.No_Employee AS No_Employee,Employee.Comment_Employee AS Comment_Employee
  304. FROM Principal
  305. INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
  306. WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
  307. ">
  308. <Params>
  309. <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
  310. </Params>
  311. <Tables>
  312. <Table name="RegionalLeader" />
  313. <Table name="Principal"/>
  314. </Tables>
  315. </SearchRegionalLeaderWithNo>
  316. <SearchRegionalLeaderNext CmdType="Text" CmdText="DECLARE @ID_RegionalLeader uniqueidentifier
  317. DECLARE @NextNo nvarchar(64)
  318. SET @NextNo = @No_RegionalLeader
  319. SELECT TOP 1 @NextNo = RegionalLeader.No_RegionalLeader
  320. FROM RegionalLeader
  321. WHERE RegionalLeader.No_RegionalLeader &gt; @No_RegionalLeader
  322. ORDER BY RegionalLeader.No_RegionalLeader
  323. SELECT RegionalLeader.* FROM RegionalLeader
  324. Where No_RegionalLeader=@NextNo
  325. SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
  326. FROM RegionalLeader
  327. WHERE RegionalLeader.No_RegionalLeader = @NextNo
  328. SELECT Principal.*,Employee.Name_Employee AS Name_Employee
  329. ,Employee.No_Employee AS No_Employee,Employee.Comment_Employee AS Comment_Employee
  330. FROM Principal
  331. INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
  332. WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
  333. ">
  334. <Params>
  335. <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
  336. </Params>
  337. <Tables>
  338. <Table name="RegionalLeader" />
  339. <Table name="Principal"/>
  340. </Tables>
  341. </SearchRegionalLeaderNext>
  342. <SearchRegionalLeaderPrevious CmdType="Text" CmdText="DECLARE @ID_RegionalLeader uniqueidentifier
  343. DECLARE @NextNo nvarchar(64)
  344. SET @NextNo = @No_RegionalLeader
  345. SELECT TOP 1 @NextNo = RegionalLeader.No_RegionalLeader
  346. FROM RegionalLeader
  347. WHERE RegionalLeader.No_RegionalLeader &lt; @No_RegionalLeader
  348. ORDER BY RegionalLeader.No_RegionalLeader Desc
  349. SELECT RegionalLeader.* FROM RegionalLeader
  350. where RegionalLeader.No_RegionalLeader = @NextNo
  351. SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
  352. FROM RegionalLeader WHERE RegionalLeader.No_RegionalLeader = @NextNo
  353. SELECT Principal.*,Employee.Name_Employee AS Name_Employee,Employee.No_Employee AS No_Employee ,Employee.Comment_Employee AS Comment_Employee
  354. FROM Principal
  355. INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
  356. WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
  357. ">
  358. <Params>
  359. <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
  360. </Params>
  361. <Tables>
  362. <Table name="RegionalLeader" />
  363. <Table name="Principal"/>
  364. </Tables>
  365. </SearchRegionalLeaderPrevious>
  366. <SearchRegionalLeaderFirst CmdType="Text" CmdText=" DECLARE @ID_RegionalLeader uniqueidentifier
  367. DECLARE @NextNo nvarchar(64)
  368. SET @NextNo = @No_RegionalLeader
  369. SELECT TOP 1 @NextNo = RegionalLeader.No_RegionalLeader
  370. FROM RegionalLeader
  371. ORDER BY RegionalLeader.No_RegionalLeader
  372. SELECT RegionalLeader.* FROM RegionalLeader
  373. Where RegionalLeader.No_RegionalLeader=@NextNo
  374. SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
  375. FROM RegionalLeader
  376. WHERE RegionalLeader.No_RegionalLeader = @NextNo
  377. SELECT Principal.*, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee
  378. ,Employee.Comment_Employee AS Comment_Employee
  379. FROM Principal
  380. INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
  381. WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
  382. ">
  383. <Params>
  384. <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
  385. </Params>
  386. <Tables>
  387. <Table name="RegionalLeader" />
  388. <Table name="Principal"/>
  389. </Tables>
  390. </SearchRegionalLeaderFirst>
  391. <SearchRegionalLeaderLast CmdType="Text" CmdText="DECLARE @ID_RegionalLeader uniqueidentifier
  392. DECLARE @NextNo nvarchar(64)
  393. SET @NextNo = @No_RegionalLeader
  394. SELECT TOP 1 @NextNo = RegionalLeader.No_RegionalLeader
  395. FROM RegionalLeader
  396. ORDER BY RegionalLeader.No_RegionalLeader DESC
  397. SELECT RegionalLeader.* FROM RegionalLeader
  398. Where RegionalLeader.No_RegionalLeader=@NextNo
  399. SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
  400. FROM RegionalLeader
  401. WHERE RegionalLeader.No_RegionalLeader = @NextNo
  402. SELECT Principal.*, Employee.Name_Employee AS Name_Employee
  403. ,Employee.No_Employee AS No_Employee ,Employee.Comment_Employee AS Comment_Employee
  404. FROM Principal
  405. INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
  406. WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
  407. ">
  408. <Params>
  409. <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
  410. </Params>
  411. <Tables>
  412. <Table name="RegionalLeader" />
  413. <Table name="Principal"/>
  414. </Tables>
  415. </SearchRegionalLeaderLast>
  416. <GetEmployeeNameByNo CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.No_Employee,Employee.Name_Employee,Employee.SuspendDate_Employee FROM Employee WHERE No_Employee = @No_Employee">
  417. <Params>
  418. <Param name="@No_Employee" type="Employee.No_Employee" Index="0" />
  419. </Params>
  420. <Tables>
  421. <Table name="Employee" />
  422. </Tables>
  423. </GetEmployeeNameByNo>
  424. <SearchAllEmployee CmdType="Text" CmdText="SELECT Employee.No_Employee,Employee.Name_Employee FROM Employee ">
  425. <Tables>
  426. <Table name="AllEmployee" />
  427. </Tables>
  428. </SearchAllEmployee>
  429. </Search>
  430. </Server>
  431. <Lables>
  432. <Search>
  433. Empty();
  434. NewInstance();
  435. tbNo.ReadOnly=false;
  436. txtName.ReadOnly=true;
  437. dgEmployee.ReadOnly=true;
  438. toolBar.EnableSubmit=false;
  439. toolBar.EnableModify=false;
  440. toolBar.EnableDelete=false;
  441. toolBar.EnablePrint=false;
  442. UpdateForm(true, "");
  443. tbNo.Focus();
  444. @Status=0;
  445. </Search>
  446. <New>
  447. Empty();
  448. NewInstance();
  449. tbNo.ReadOnly=true;
  450. txtName.ReadOnly=false;
  451. dgEmployee.ReadOnly=false;
  452. toolBar.EnableSubmit=GetRight(@Title,"新增");
  453. toolBar.EnableModify=false;
  454. toolBar.EnableDelete=false;
  455. toolBar.EnablePrint=false;
  456. #RegionalLeader.No_RegionalLeader=tbNo.CValue;
  457. #RegionalLeader.ID_RegionalLeader=NewGuid();
  458. UpdateForm(true, "");
  459. txtName.Focus();
  460. @Status=1;
  461. </New>
  462. <View>
  463. tbNo.ReadOnly=false;
  464. txtName.ReadOnly=true;
  465. dgEmployee.ReadOnly=true;
  466. toolBar.EnableSubmit=false;
  467. toolBar.EnableModify=GetRight(@Title,"修改");
  468. toolBar.EnableDelete=GetRight(@Title,"删除");
  469. toolBar.EnablePrint=GetRight(@Title,"打印");
  470. UpdateForm(true, "");
  471. @Status=2;
  472. </View>
  473. <Modify>
  474. tbNo.ReadOnly=true;
  475. txtName.ReadOnly=false;
  476. dgEmployee.ReadOnly=false;
  477. toolBar.EnableSubmit=GetRight(@Title,"新增");
  478. toolBar.EnableModify=false;
  479. toolBar.EnableDelete=GetRight(@Title,"删除");
  480. toolBar.EnablePrint=false;
  481. UpdateForm(true, "");
  482. txtName.Focus();
  483. @Status=3;
  484. </Modify>
  485. <SubmitButtonClick>
  486. <![CDATA[
  487. if(txtName.CValue=="")
  488. {
  489. MessageBox("请输入区域名称!",@Title);
  490. txtName.Focus();
  491. return;
  492. }
  493. if(dgEmployee.RowCount==0)
  494. {
  495. MessageBox("请输入员工编号!",@Title);
  496. return;
  497. }
  498. UpdateForm(false, "");
  499. if(@Status==1)
  500. {
  501. SuspendLayout();
  502. for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1)
  503. {
  504. SetPosition("#Principal", @i);
  505. if(Equals(#Principal.ID_Principal,GuidEmpty()))
  506. #Principal.ID_Principal = NewGuid();
  507. if(Equals(#Principal.ID_Employee, GuidEmpty()))
  508. {
  509. dgEmployee.CurrentRowIndex=@i;
  510. tcOperMan.SelectedIndex=0;
  511. MessageBox("该员工不存在!",@Title);
  512. ResumeLayout();
  513. return;
  514. }
  515. #Principal.ID_RegionalLeader = #RegionalLeader.ID_RegionalLeader;
  516. }
  517. ResumeLayout();
  518. New();
  519. }
  520. else if(@Status == 3)
  521. {
  522. SuspendLayout();
  523. for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1)
  524. {
  525. SetPosition("#Principal", @i);
  526. if(Equals(#Principal.ID_Principal,GuidEmpty()))
  527. #Principal.ID_Principal = NewGuid();
  528. if(Equals(#Principal.ID_Employee, GuidEmpty()))
  529. {
  530. dgEmployee.CurrentRowIndex=@i;
  531. tcOperMan.SelectedIndex=0;
  532. MessageBox("该员工不存在!",@Title);
  533. ResumeLayout();
  534. return;
  535. }
  536. #Principal.ID_RegionalLeader = #RegionalLeader.ID_RegionalLeader;
  537. }
  538. ResumeLayout();
  539. Update();
  540. }
  541. ChangeMode("View");
  542. ]]>
  543. </SubmitButtonClick>
  544. </Lables>
  545. </Form>
  546. </Forms>