FrmApplicationBill.xml 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Forms>
  3. <Form Name="FrmApplicationBill">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @SetFlag=1;
  9. @Title="请假/加班/出差申请单";
  10. GetSchema();
  11. ChangeMode("Search");
  12. ]]>
  13. </Load>
  14. <Closing>
  15. ;
  16. </Closing>
  17. <Closed>
  18. ;
  19. </Closed>
  20. </Events>
  21. <Mode>
  22. <Search>
  23. <Lable name="Search"/>
  24. </Search>
  25. <New>
  26. <Lable name="New"/>
  27. </New>
  28. <View>
  29. <Lable name="View"/>
  30. </View>
  31. <Modify>
  32. <Lable name="Modify"/>
  33. </Modify>
  34. </Mode>
  35. <Controls>
  36. <IKDateTimePicker name="timeMake" DataSource="ApplicationBill.Date_ApplicationBill"></IKDateTimePicker>
  37. <IKTextButton name="tbNo" DataSource="ApplicationBill.No_ApplicationBill">
  38. <Events>
  39. <Enter>
  40. <![CDATA[
  41. if(tbNo.ReadOnly == false)
  42. {
  43. if(tbNo.CValue != StringEmpty())
  44. {
  45. UpdateForm(false, "");
  46. if(Search("SearchApplicationBillWithNo", tbNo.CValue))
  47. {
  48. ChangeMode("View");
  49. }
  50. else
  51. {
  52. MessageBox("该申请单不存在!",@Title);
  53. }
  54. }
  55. else
  56. {
  57. MessageBox("请输入申请单号!",@Title);
  58. }
  59. }
  60. ]]>
  61. </Enter>
  62. <Click>
  63. @Temp = ShowSearchBox("ApplicationBillSearch","NODEPOT","tbNo",tbNo.CValue);
  64. if(@Temp != StringEmpty())
  65. {
  66. tbNo.CValue = @Temp;
  67. UpdateForm(false, "");
  68. if(Search("SearchApplicationBillWithNo", tbNo.CValue))
  69. {
  70. ChangeMode("View");
  71. }
  72. }
  73. </Click>
  74. </Events>
  75. </IKTextButton>
  76. <IKComboBoxExText name="cbDepart" DisplaySource="ApplicationBill.Name_Department" NoSource="ApplicationBill.No_Department" ValueSource="ApplicationBill.ID_Department" DataSource="Department" DisplayMember="Name_Department" NoMember="No_Department" ValueMember="ID_Department">
  77. <Events>
  78. <Reload>
  79. UpdateForm(false, "cbDepart");
  80. Search("SearchDepartment");
  81. UpdateForm(true, "cbDepart");
  82. </Reload>
  83. </Events>
  84. </IKComboBoxExText>
  85. <IKComboBoxExText name="cbApplicant" DisplaySource="ApplicationBill.Name_Applicant" NoSource="ApplicationBill.No_Applicant" ValueSource="ApplicationBill.ID_Applicant" DataSource="Applicant" DisplayMember="Name_Employee" NoMember="No_Employee" ValueMember="ID_Employee">
  86. <Events>
  87. <Reload>
  88. UpdateForm(false, "cbApplicant");
  89. Search("SearchApplicant",cbDepart.SelectedValue1);
  90. UpdateForm(true, "cbApplicant");
  91. </Reload>
  92. </Events>
  93. </IKComboBoxExText>
  94. <IKComboBoxEx name="cbApplicationType" DisplaySource="ApplicationBill.Type_ApplicationBill" DataSource="ApplicationType" DisplayMember="Type">
  95. <Events>
  96. <Reload>
  97. UpdateForm(false, "cbApplicationType");
  98. Search("SearchApplicationType");
  99. UpdateForm(true, "cbApplicationType");
  100. </Reload>
  101. </Events>
  102. </IKComboBoxEx>
  103. <IKComboBoxEx name="cbApplicationItem" DisplaySource="ApplicationBill.Item_ApplicationBill" DataSource="ApplicationItem" DisplayMember="Item">
  104. <Events>
  105. <Reload>
  106. UpdateForm(false, "cbApplicationItem");
  107. Search("SearchApplicationItem",cbApplicationType.Text);
  108. UpdateForm(true, "cbApplicationItem");
  109. </Reload>
  110. </Events>
  111. </IKComboBoxEx>
  112. <IKDateTimePicker name="StartDate" DataSource="ApplicationBill.StartDate_ApplicationBill"></IKDateTimePicker>
  113. <IKDateTimePicker name="EndDate" DataSource="ApplicationBill.EndDate_ApplicationBill"></IKDateTimePicker>
  114. <IKTextBox name="txtComment" DataSource="ApplicationBill.Comment_ApplicationBill"></IKTextBox>
  115. <IKTextBox name="txtMaker" DataSource="ApplicationBill.Name_Creator"></IKTextBox>
  116. <IKTextBox name="txtAssessor" DataSource="ApplicationBill.Name_Assessor"></IKTextBox>
  117. <IKDateTimeText name="dtAssessDate" DataSource="ApplicationBill.AssessDate_ApplicationBill"></IKDateTimeText>
  118. <IKTextBox name="txtLastModUser" DataSource="ApplicationBill.LastModUserName"></IKTextBox>
  119. <IKDateTimeText name="dtLastModDate" DataSource="ApplicationBill.LastModDate_ApplicationBill"></IKDateTimeText>
  120. <IKDataGridEx name="dgEmployee" DataSource="ApplicationBillEmployee" TableStyleIndex="0">
  121. <DataColumn Index="0" DataSource="ApplicationBillEmployee.No_Employee" >
  122. <IKDataGridTextButtonColumn>
  123. <Events>
  124. <Click>
  125. @SetFlag=1;
  126. @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#ApplicationBillEmployee.No_Employee);
  127. </Click>
  128. <SetFlagBeforeClick>
  129. @SetFlag=0;
  130. </SetFlagBeforeClick>
  131. </Events>
  132. </IKDataGridTextButtonColumn>
  133. </DataColumn>
  134. <DataColumn Index="1" DataSource="ApplicationBillEmployee.Name_Employee" />
  135. </IKDataGridEx>
  136. <IKFormToolBar name="toolBar">
  137. <Events>
  138. <ClickFirst>
  139. if(Search("SearchApplicationBillFirst"))
  140. {
  141. ChangeMode("View");
  142. }
  143. </ClickFirst>
  144. <ClickPrev>
  145. if(Search("SearchApplicationBillPrevious", tbNo.CValue))
  146. {
  147. ChangeMode("View");
  148. }
  149. </ClickPrev>
  150. <ClickNext>
  151. if(Search("SearchApplicationBillNext", tbNo.CValue))
  152. {
  153. ChangeMode("View");
  154. }
  155. </ClickNext>
  156. <ClickLast>
  157. if(Search("SearchApplicationBillLast"))
  158. {
  159. ChangeMode("View");
  160. }
  161. </ClickLast>
  162. <ClickNew>
  163. @NextNo = GetNextAutoNumber(true);
  164. if (!Equals(@NextNo, ""))
  165. {
  166. ChangeMode("New");
  167. #ApplicationBill.No_ApplicationBill = @NextNo;
  168. UpdateForm(true, "tbNo");
  169. }
  170. </ClickNew>
  171. <ClickEmpty>
  172. ChangeMode("Search");
  173. </ClickEmpty>
  174. <ClickSubmit>
  175. <Lable name="SubmitButtonClick"/>
  176. </ClickSubmit>
  177. <ClickModify>
  178. ChangeMode("Modify");
  179. </ClickModify>
  180. <ClickDelete>
  181. Delete();
  182. ChangeMode("Search");
  183. </ClickDelete>
  184. <ClickPrint>
  185. PrintReport();
  186. </ClickPrint>
  187. <ClickAudit>
  188. BeginAudit();
  189. #ApplicationBill.ID_Assessor = GetLoginUserID();
  190. #ApplicationBill.Name_Assessor = GetCurrentUser();
  191. #ApplicationBill.AssessDate_ApplicationBill = DateTimeNow();
  192. Audit();
  193. ChangeMode("View");
  194. EndAudit();
  195. </ClickAudit>
  196. <ClickUnAudit>
  197. BeginUnAudit();
  198. #ApplicationBill.ID_Assessor = DBNull();
  199. #ApplicationBill.Name_Assessor = "";
  200. UnAudit();
  201. ChangeMode("View");
  202. EndUnAudit();
  203. </ClickUnAudit>
  204. <ClickImport>
  205. ;
  206. </ClickImport>
  207. <ClickExport>
  208. ;
  209. </ClickExport>
  210. <ClickClose>
  211. ;
  212. </ClickClose>
  213. <ClickExpand>
  214. ;
  215. </ClickExpand>
  216. </Events>
  217. </IKFormToolBar>
  218. </Controls>
  219. <Tables>
  220. <Table name="ApplicationBillEmployee">
  221. <Events>
  222. <ColumnsChanged>
  223. <No_Employee>
  224. if(@SetFlag==0)
  225. {
  226. return;
  227. }
  228. if(Search("GetEmployeeNameByNo",#ApplicationBillEmployee.No_Employee))
  229. {
  230. #ApplicationBillEmployee.Name_Employee=#Employee.Name_Employee;
  231. #ApplicationBillEmployee.ID_Employee=#Employee.ID_Employee;
  232. if(!Equals(#Employee.SuspendDate_Employee,DBNull()))
  233. MessageBox("该员工已停用!",@Title);
  234. }
  235. else
  236. {
  237. MessageBox("该员工不存在!",@Title);
  238. #ApplicationBillEmployee.Name_Employee="";
  239. #ApplicationBillEmployee.ID_Employee=GuidEmpty();
  240. @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#ApplicationBillEmployee.No_Employee);
  241. if(@temp != "")
  242. {
  243. ResumeColumnEvent("#ApplicationBillEmployee.No_Employee");
  244. #ApplicationBillEmployee.No_Employee = @temp;
  245. ClearColumnEvent();
  246. }
  247. }
  248. </No_Employee>
  249. </ColumnsChanged>
  250. </Events>
  251. </Table>
  252. </Tables>
  253. <LockInfomation LockID="ID_ApplicationBill" LockNO="No_ApplicationBill" LockSearchFunction="SearchApplicationBillWithNo"/>
  254. <ChildForms>
  255. <ChildForm name="ApplicationBillSearch" DataSource="ApplicationBill" SearchFunction="SearchAllApplicationBill" SearchFunctionByNo="SearchApplicationBillWithNo" MappingName="申请单">
  256. <DataColumn Index="0" MappingName="#ApplicationBill.No_ApplicationBill" HeaderText="申请单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  257. <DataColumn Index="1" MappingName="#ApplicationBill.Date_ApplicationBill" HeaderText="申请日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  258. <DataColumn Index="2" MappingName="#ApplicationBill.Name_Applicant" HeaderText="申请人" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  259. <DataColumn Index="3" MappingName="#ApplicationBill.Item_ApplicationBill" HeaderText="申请明细" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  260. <DataColumn Index="4" MappingName="#ApplicationBill.Status_ApplicationBill" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  261. </ChildForm>
  262. <ChildForm name="EmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="" MappingName="员工" ReturnDataSource="ApplicationBillEmployee" ShowCheckBox="true">
  263. <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#ApplicationBillEmployee.No_Employee"/>
  264. <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  265. </ChildForm>
  266. </ChildForms>
  267. </Client>
  268. <Server>
  269. <Tables>
  270. <Table name="ApplicationBill" Type="Parent">
  271. <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
  272. FROM ApplicationBill
  273. LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
  274. LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
  275. LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
  276. Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
  277. LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department"/>
  278. <New CmdType="Text" CmdText="INSERT INTO ApplicationBill
  279. ([ID_ApplicationBill]
  280. ,[No_ApplicationBill]
  281. ,[Date_ApplicationBill]
  282. ,[ID_Department]
  283. ,[ID_Applicant]
  284. ,[Type_ApplicationBill]
  285. ,[Item_ApplicationBill]
  286. ,[StartDate_ApplicationBill]
  287. ,[EndDate_ApplicationBill]
  288. ,[Comment_ApplicationBill]
  289. ,[ID_Creator]
  290. ,[LastModUser_ApplicationBill]
  291. ,[LastModDate_ApplicationBill]
  292. ,[ID_Assessor]
  293. ,[AssessDate_ApplicationBill])
  294. VALUES
  295. (@ID_ApplicationBill
  296. ,@No_ApplicationBill
  297. ,@Date_ApplicationBill
  298. ,@ID_Department
  299. ,@ID_Applicant
  300. ,@Type_ApplicationBill
  301. ,@Item_ApplicationBill
  302. ,@StartDate_ApplicationBill
  303. ,@EndDate_ApplicationBill
  304. ,@Comment_ApplicationBill
  305. ,@ID_Creator
  306. ,@LastModUser_ApplicationBill
  307. ,@LastModDate_ApplicationBill
  308. ,@ID_Assessor
  309. ,@AssessDate_ApplicationBill)">
  310. <Params>
  311. <Param name="@ID_ApplicationBill" type="ApplicationBill.ID_ApplicationBill" sourceColumn="ID_ApplicationBill"/>
  312. <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" sourceColumn="No_ApplicationBill"/>
  313. <Param name="@Date_ApplicationBill" type="ApplicationBill.Date_ApplicationBill" sourceColumn="Date_ApplicationBill"/>
  314. <Param name="@ID_Department" type="ApplicationBill.ID_Department" sourceColumn="ID_Department"/>
  315. <Param name="@ID_Applicant" type="ApplicationBill.ID_Applicant" sourceColumn="ID_Applicant"/>
  316. <Param name="@Type_ApplicationBill" type="ApplicationBill.Type_ApplicationBill" sourceColumn="Type_ApplicationBill"/>
  317. <Param name="@Item_ApplicationBill" type="ApplicationBill.Item_ApplicationBill" sourceColumn="Item_ApplicationBill"/>
  318. <Param name="@StartDate_ApplicationBill" type="ApplicationBill.StartDate_ApplicationBill" sourceColumn="StartDate_ApplicationBill"/>
  319. <Param name="@EndDate_ApplicationBill" type="ApplicationBill.EndDate_ApplicationBill" sourceColumn="EndDate_ApplicationBill"/>
  320. <Param name="@Comment_ApplicationBill" type="ApplicationBill.Comment_ApplicationBill" sourceColumn="Comment_ApplicationBill"/>
  321. <Param name="@ID_Creator" type="ApplicationBill.ID_Creator" sourceColumn="ID_Creator"/>
  322. <Param name="@LastModUser_ApplicationBill" type="ApplicationBill.LastModUser_ApplicationBill" sourceColumn="LastModUser_ApplicationBill"/>
  323. <Param name="@LastModDate_ApplicationBill" type="ApplicationBill.LastModDate_ApplicationBill" sourceColumn="LastModDate_ApplicationBill"/>
  324. <Param name="@ID_Assessor" type="ApplicationBill.ID_Assessor" sourceColumn="ID_Assessor"/>
  325. <Param name="@AssessDate_ApplicationBill" type="ApplicationBill.AssessDate_ApplicationBill" sourceColumn="AssessDate_ApplicationBill"/>
  326. </Params>
  327. </New>
  328. <Update CmdType="Text" CmdText="
  329. Update ApplicationBill
  330. Set No_ApplicationBill=@No_ApplicationBill
  331. ,Date_ApplicationBill=@Date_ApplicationBill
  332. ,ID_Department=@ID_Department
  333. ,ID_Applicant=@ID_Applicant
  334. ,Type_ApplicationBill=@Type_ApplicationBill
  335. ,Item_ApplicationBill=@Item_ApplicationBill
  336. ,StartDate_ApplicationBill=@StartDate_ApplicationBill
  337. ,EndDate_ApplicationBill=@EndDate_ApplicationBill
  338. ,Comment_ApplicationBill=@Comment_ApplicationBill
  339. ,ID_Creator=@ID_Creator
  340. ,LastModUser_ApplicationBill=@LastModUser_ApplicationBill
  341. ,LastModDate_ApplicationBill=@LastModDate_ApplicationBill
  342. Where ID_ApplicationBill=@ID_ApplicationBill
  343. ">
  344. <Params>
  345. <Param name="@ID_ApplicationBill" type="ApplicationBill.ID_ApplicationBill" sourceColumn="ID_ApplicationBill"/>
  346. <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" sourceColumn="No_ApplicationBill"/>
  347. <Param name="@Date_ApplicationBill" type="ApplicationBill.Date_ApplicationBill" sourceColumn="Date_ApplicationBill"/>
  348. <Param name="@ID_Department" type="ApplicationBill.ID_Department" sourceColumn="ID_Department"/>
  349. <Param name="@ID_Applicant" type="ApplicationBill.ID_Applicant" sourceColumn="ID_Applicant"/>
  350. <Param name="@Type_ApplicationBill" type="ApplicationBill.Type_ApplicationBill" sourceColumn="Type_ApplicationBill"/>
  351. <Param name="@Item_ApplicationBill" type="ApplicationBill.Item_ApplicationBill" sourceColumn="Item_ApplicationBill"/>
  352. <Param name="@StartDate_ApplicationBill" type="ApplicationBill.StartDate_ApplicationBill" sourceColumn="StartDate_ApplicationBill"/>
  353. <Param name="@EndDate_ApplicationBill" type="ApplicationBill.EndDate_ApplicationBill" sourceColumn="EndDate_ApplicationBill"/>
  354. <Param name="@Comment_ApplicationBill" type="ApplicationBill.Comment_ApplicationBill" sourceColumn="Comment_ApplicationBill"/>
  355. <Param name="@ID_Creator" type="ApplicationBill.ID_Creator" sourceColumn="ID_Creator"/>
  356. <Param name="@LastModUser_ApplicationBill" type="ApplicationBill.LastModUser_ApplicationBill" sourceColumn="LastModUser_ApplicationBill"/>
  357. <Param name="@LastModDate_ApplicationBill" type="ApplicationBill.LastModDate_ApplicationBill" sourceColumn="LastModDate_ApplicationBill"/>
  358. </Params>
  359. </Update>
  360. <Audit CmdType="Text" CmdText="
  361. UPDATE ApplicationBill SET ID_Assessor = @ID_Assessor, AssessDate_ApplicationBill = @AssessDate_ApplicationBill WHERE ID_ApplicationBill = @ID_ApplicationBill
  362. ">
  363. <Params>
  364. <Param name="@ID_ApplicationBill" type="ApplicationBill.ID_ApplicationBill" sourceColumn="ID_ApplicationBill" />
  365. <Param name="@ID_Assessor" type="ApplicationBill.ID_Assessor" sourceColumn="ID_Assessor" />
  366. <Param name="@AssessDate_ApplicationBill" type="ApplicationBill.AssessDate_ApplicationBill" sourceColumn="AssessDate_ApplicationBill" />
  367. </Params>
  368. </Audit>
  369. <Delete CmdType="Text" CmdText="DELETE ApplicationBill WHERE ApplicationBill.ID_ApplicationBill = @ID_ApplicationBill">
  370. <Params>
  371. <Param name="@ID_ApplicationBill" type="ApplicationBill.ID_ApplicationBill" sourceColumn="ID_ApplicationBill"/>
  372. </Params>
  373. </Delete>
  374. <FKErrorReport ErrorMessage="该申请单已被引用,删除失败!"/>
  375. <UNIQUEErrorReport ErrorMessage="该申请单号已存在,提交失败!"/>
  376. </Table>
  377. <Table name="ApplicationBillEmployee" Type="Child">
  378. <GetSchema CmdType="Text" CmdText="SELECT top 0 ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee" />
  379. <New CmdType="Text" CmdText=" INSERT INTO ApplicationBillEmployee (ID_ApplicationBillEmployee,ID_ApplicationBill,ID_Employee)
  380. VALUES(@ID_ApplicationBillEmployee,@ID_ApplicationBill,@ID_Employee)" >
  381. <Params>
  382. <Param name="@ID_ApplicationBillEmployee" type="ApplicationBillEmployee.ID_ApplicationBillEmployee" sourceColumn="ID_ApplicationBillEmployee" />
  383. <Param name="@ID_ApplicationBill" type="ApplicationBillEmployee.ID_ApplicationBill" sourceColumn="ID_ApplicationBill" />
  384. <Param name="@ID_Employee" type="ApplicationBillEmployee.ID_Employee" sourceColumn="ID_Employee" />
  385. </Params>
  386. </New>
  387. <Update CmdType="Text" CmdText="UPDATE ApplicationBillEmployee SET ID_Employee = @ID_Employee
  388. WHERE ID_ApplicationBillEmployee = @ID_ApplicationBillEmployee">
  389. <Params>
  390. <Param name="@ID_ApplicationBillEmployee" type="ApplicationBillEmployee.ID_ApplicationBillEmployee" sourceColumn="ID_ApplicationBillEmployee" />
  391. <Param name="@ID_Employee" type="ApplicationBillEmployee.ID_Employee" sourceColumn="ID_Employee" />
  392. </Params>
  393. </Update>
  394. <Delete CmdType="Text" CmdText="DELETE ApplicationBillEmployee WHERE ID_ApplicationBillEmployee = @ID_ApplicationBillEmployee">
  395. <Params>
  396. <Param name="@ID_ApplicationBillEmployee" type="ApplicationBillEmployee.ID_ApplicationBillEmployee" sourceColumn="ID_ApplicationBillEmployee" />
  397. </Params>
  398. </Delete>
  399. </Table>
  400. </Tables>
  401. <Search>
  402. <SearchAllApplicationBill CmdType="Text" CmdText="SELECT ApplicationBill.No_ApplicationBill,ApplicationBill.Date_ApplicationBill,Item_ApplicationBill,Name_Employee As Name_Applicant
  403. ,Case When ApplicationBill.ID_Assessor Is Not Null Then '已审核' else '未审核' end As Status_ApplicationBill
  404. FROM ApplicationBill
  405. Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant">
  406. <Tables>
  407. <Table name="AllApplicationBill" />
  408. </Tables>
  409. </SearchAllApplicationBill>
  410. <SearchApplicationBillWithNo CmdType="Text" CmdText="
  411. SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
  412. FROM ApplicationBill
  413. LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
  414. LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
  415. LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
  416. Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
  417. LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
  418. Where No_ApplicationBill=@No_ApplicationBill
  419. SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee
  420. INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
  421. Join ApplicationBill On ApplicationBill.ID_ApplicationBill=ApplicationBillEmployee.ID_ApplicationBill
  422. Where No_ApplicationBill=@No_ApplicationBill
  423. ">
  424. <Params>
  425. <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" Index="0"/>
  426. </Params>
  427. <Tables>
  428. <Table name="ApplicationBill"/>
  429. <Table name="ApplicationBillEmployee"/>
  430. </Tables>
  431. </SearchApplicationBillWithNo>
  432. <SearchEmployeeInfo CmdType="Text" CmdText="
  433. Select Department.ID_Department,No_Department,Name_Department,Employee.ID_Employee,No_Employee,Name_Employee,OnStuffOne,OffStuffTwo
  434. From Employee
  435. Left Join AppUser On AppUser.ID_Employee=Employee.ID_Employee
  436. Left Join Department On Department.ID_Department=Employee.ID_Department
  437. Left Join dbo.AttendanceRuleEmployee On AttendanceRuleEmployee.ID_Employee=Employee.ID_Employee
  438. Left Join dbo.AttendanceRule ON AttendanceRule.ID_AttendanceRule=AttendanceRuleEmployee.ID_AttendanceRule
  439. Where ID_User=@ID_User
  440. ">
  441. <Params>
  442. <Param name="@ID_User" type="AppUser.ID_User" Index="0"/>
  443. </Params>
  444. <Tables>
  445. <Table name="EmployeeInfo"/>
  446. </Tables>
  447. </SearchEmployeeInfo>
  448. <SearchDepartment CmdType="Text" CmdText="SELECT ID_Department, Name_Department,No_Department FROM Department order by No_Department">
  449. <Tables>
  450. <Table name="Department"/>
  451. </Tables>
  452. </SearchDepartment>
  453. <SearchApplicant CmdType="Text" CmdText="SELECT ID_Employee, Name_Employee,No_Employee FROM Employee Where ID_Department=@ID_Department order by No_Employee ">
  454. <Params>
  455. <Param name="@ID_Department" type="AppUser.ID_Department" Index="0"/>
  456. </Params>
  457. <Tables>
  458. <Table name="Applicant"/>
  459. </Tables>
  460. </SearchApplicant>
  461. <GetEmployeeNameByNo CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.No_Employee,Employee.Name_Employee,Employee.SuspendDate_Employee FROM Employee WHERE No_Employee = @No_Employee">
  462. <Params>
  463. <Param name="@No_Employee" type="Employee.No_Employee" Index="0" />
  464. </Params>
  465. <Tables>
  466. <Table name="Employee" />
  467. </Tables>
  468. </GetEmployeeNameByNo>
  469. <SearchApplicationType CmdType="Text" CmdText="
  470. IF Exists (Select * From tempdb.dbo.sysobjects Where id=Object_ID(N'tempdb.dbo.#Temp'))
  471. DROP TABLE #Temp
  472. Create Table #Temp
  473. ( Type nvarchar(64))
  474. Insert Into #Temp Values('请假')
  475. Insert Into #Temp Values('加班')
  476. Insert Into #Temp Values('出差')
  477. Insert Into #Temp Values('异常处理')
  478. Select * From #Temp
  479. ">
  480. <Tables>
  481. <Table name="ApplicationType"/>
  482. </Tables>
  483. </SearchApplicationType>
  484. <SearchApplicationItem CmdType="Text" CmdText="
  485. IF Exists (Select * From tempdb.dbo.sysobjects Where id=Object_ID(N'tempdb.dbo.#Temp'))
  486. DROP TABLE #Temp
  487. Create Table #Temp
  488. ( Item nvarchar(64))
  489. If(@Type_ApplicationBill='请假')
  490. Begin
  491. Insert Into #Temp Values('事假')
  492. Insert Into #Temp Values('病假')
  493. Insert Into #Temp Values('带薪假')
  494. End
  495. else if(@Type_ApplicationBill='加班')
  496. Insert Into #Temp Values('加班')
  497. else if(@Type_ApplicationBill='出差')
  498. Insert Into #Temp Values('出差')
  499. else if(@Type_ApplicationBill='异常处理')
  500. Insert Into #Temp Values('打卡异常')
  501. Select * From #Temp
  502. ">
  503. <Params>
  504. <Param name="@Type_ApplicationBill" type="ApplicationBill.Type_ApplicationBill" Index="0"/>
  505. </Params>
  506. <Tables>
  507. <Table name="ApplicationItem"/>
  508. </Tables>
  509. </SearchApplicationItem>
  510. <SearchApplicationBillFirst CmdType="Text" CmdText="
  511. Declare @ID_ApplicationBill uniqueidentifier
  512. Select Top 1 @ID_ApplicationBill=ID_ApplicationBill From ApplicationBill Order By No_ApplicationBill
  513. SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
  514. FROM ApplicationBill
  515. LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
  516. LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
  517. LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
  518. Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
  519. LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
  520. Where ID_ApplicationBill=@ID_ApplicationBill
  521. SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
  522. Where ID_ApplicationBill=@ID_ApplicationBill
  523. ">
  524. <Tables>
  525. <Table name="ApplicationBill"/>
  526. <Table name="ApplicationBillEmployee"/>
  527. </Tables>
  528. </SearchApplicationBillFirst>
  529. <SearchApplicationBillPrevious CmdType="Text" CmdText="
  530. Declare @ID_ApplicationBill uniqueidentifier
  531. SELECT Top 1 @ID_ApplicationBill=ID_ApplicationBill
  532. From ApplicationBill
  533. Where No_ApplicationBill &lt; @No_ApplicationBill
  534. Order By No_ApplicationBill desc
  535. SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
  536. FROM ApplicationBill
  537. LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
  538. LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
  539. LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
  540. Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
  541. LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
  542. Where ID_ApplicationBill=@ID_ApplicationBill
  543. SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
  544. Where ID_ApplicationBill=@ID_ApplicationBill
  545. ">
  546. <Params>
  547. <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" Index="0"/>
  548. </Params>
  549. <Tables>
  550. <Table name="ApplicationBill"/>
  551. <Table name="ApplicationBillEmployee"/>
  552. </Tables>
  553. </SearchApplicationBillPrevious>
  554. <SearchApplicationBillNext CmdType="Text" CmdText="
  555. Declare @ID_ApplicationBill uniqueidentifier
  556. SELECT Top 1 @ID_ApplicationBill=ID_ApplicationBill
  557. From ApplicationBill
  558. Where No_ApplicationBill &gt; @No_ApplicationBill
  559. Order By No_ApplicationBill
  560. SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
  561. FROM ApplicationBill
  562. LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
  563. LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
  564. LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
  565. Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
  566. LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
  567. Where ID_ApplicationBill=@ID_ApplicationBill
  568. SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
  569. Where ID_ApplicationBill=@ID_ApplicationBill ">
  570. <Params>
  571. <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" Index="0"/>
  572. </Params>
  573. <Tables>
  574. <Table name="ApplicationBill"/>
  575. <Table name="ApplicationBillEmployee"/>
  576. </Tables>
  577. </SearchApplicationBillNext>
  578. <SearchApplicationBillLast CmdType="Text" CmdText="
  579. Declare @ID_ApplicationBill uniqueidentifier
  580. Select Top 1 @ID_ApplicationBill=ID_ApplicationBill From ApplicationBill Order By No_ApplicationBill desc
  581. SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
  582. FROM ApplicationBill
  583. LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
  584. LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
  585. LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
  586. Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
  587. LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
  588. Where ID_ApplicationBill=@ID_ApplicationBill
  589. SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
  590. Where ID_ApplicationBill=@ID_ApplicationBill
  591. ">
  592. <Tables>
  593. <Table name="ApplicationBill"/>
  594. <Table name="ApplicationBillEmployee"/>
  595. </Tables>
  596. </SearchApplicationBillLast>
  597. <SearchAllEmployee CmdType="Text" CmdText="SELECT Employee.No_Employee,Employee.Name_Employee FROM Employee ">
  598. <Tables>
  599. <Table name="AllEmployee" />
  600. </Tables>
  601. </SearchAllEmployee>
  602. </Search>
  603. </Server>
  604. <Lables>
  605. <Search>
  606. Empty();
  607. NewInstance();
  608. tbNo.ReadOnly=false;
  609. timeMake.Enabled=false;
  610. cbDepart.Enabled=false;
  611. cbApplicant.Enabled=false;
  612. cbApplicationType.Enabled=false;
  613. cbApplicationItem.Enabled=false;
  614. StartDate.Enabled=false;
  615. EndDate.Enabled=false;
  616. txtComment.ReadOnly=true;
  617. dgEmployee.ReadOnly=true;
  618. toolBar.EnableNew = true;
  619. toolBar.EnableSubmit=false;
  620. toolBar.EnableModify=false;
  621. toolBar.EnableDelete=false;
  622. toolBar.EnablePrint=false;
  623. toolBar.EnableAudit = false;
  624. toolBar.EnableUnAudit = false;
  625. #ApplicationBill.ID_Creator=DBNull();
  626. #ApplicationBill.Name_Creator=DBNull();
  627. #ApplicationBill.LastModUser_ApplicationBill=DBNull();
  628. #ApplicationBill.LastModUserName=DBNull();
  629. #ApplicationBill.LastModDate_ApplicationBill=DBNull();
  630. #ApplicationBill.ID_Assessor = DBNull();
  631. #ApplicationBill.Name_Assessor = DBNull();
  632. #ApplicationBill.AssessDate_ApplicationBill = DBNull();
  633. UpdateForm(true, "");
  634. tbNo.Focus();
  635. @Status=0;
  636. </Search>
  637. <New>
  638. Empty();
  639. NewInstance();
  640. tbNo.ReadOnly=true;
  641. timeMake.Enabled=true;
  642. cbDepart.Enabled=true;
  643. cbApplicant.Enabled=true;
  644. cbApplicationType.Enabled=true;
  645. cbApplicationItem.Enabled=true;
  646. StartDate.Enabled=true;
  647. EndDate.Enabled=true;
  648. txtComment.ReadOnly=false;
  649. dgEmployee.ReadOnly=false;
  650. toolBar.EnableNew = false;
  651. toolBar.EnableSubmit=true;
  652. toolBar.EnableModify=false;
  653. toolBar.EnableDelete=false;
  654. toolBar.EnablePrint=false;
  655. toolBar.EnableAudit = false;
  656. toolBar.EnableUnAudit = false;
  657. if(Search("SearchEmployeeInfo",GetLoginUserID()))
  658. {
  659. if(!Equals(#EmployeeInfo.OnStuffOne,DBNull()))
  660. {
  661. @Now=DateTimeNow();
  662. #ApplicationBill.StartDate_ApplicationBill=AddDatePart(AddDatePart(@Now,"HOUR",(DatePart(#EmployeeInfo.OnStuffOne,"HOUR")-DatePart(@Now,"HOUR"))),"MINUTE",(DatePart(#EmployeeInfo.OnStuffOne,"MINUTE")-DatePart(@Now,"MINUTE")));
  663. #ApplicationBill.EndDate_ApplicationBill=AddDatePart(AddDatePart(@Now,"HOUR",(DatePart(#EmployeeInfo.OffStuffTwo,"HOUR")-DatePart(@Now,"HOUR"))),"MINUTE",(DatePart(#EmployeeInfo.OffStuffTwo,"MINUTE")-DatePart(@Now,"MINUTE")));
  664. }
  665. #ApplicationBill.ID_Department=#EmployeeInfo.ID_Department;
  666. #ApplicationBill.No_Department=#EmployeeInfo.No_Department;
  667. #ApplicationBill.Name_Department=#EmployeeInfo.Name_Department;
  668. #ApplicationBill.ID_Applicant=#EmployeeInfo.ID_Employee;
  669. #ApplicationBill.No_Applicant=#EmployeeInfo.No_Employee;
  670. #ApplicationBill.Name_Applicant=#EmployeeInfo.Name_Employee;
  671. }
  672. #ApplicationBill.ID_ApplicationBill = NewGuid();
  673. #ApplicationBill.ID_Creator=GetLoginUserID();
  674. #ApplicationBill.Name_Creator=GetCurrentUser();
  675. #ApplicationBill.LastModUser_ApplicationBill=DBNull();
  676. #ApplicationBill.LastModUserName=DBNull();
  677. #ApplicationBill.LastModDate_ApplicationBill=DBNull();
  678. #ApplicationBill.ID_Assessor = DBNull();
  679. #ApplicationBill.Name_Assessor = DBNull();
  680. #ApplicationBill.AssessDate_ApplicationBill = DBNull();
  681. UpdateForm(true, "");
  682. tbNo.Focus();
  683. @Status=1;
  684. </New>
  685. <View>
  686. tbNo.ReadOnly=false;
  687. timeMake.Enabled=false;
  688. cbDepart.Enabled=false;
  689. cbApplicant.Enabled=false;
  690. cbApplicationType.Enabled=false;
  691. cbApplicationItem.Enabled=false;
  692. StartDate.Enabled=false;
  693. EndDate.Enabled=false;
  694. txtComment.ReadOnly=true;
  695. dgEmployee.ReadOnly=true;
  696. toolBar.EnableSubmit=false;
  697. if(Equals(#ApplicationBill.ID_Assessor,DBNull()))
  698. {
  699. toolBar.EnableModify = GetRight(@Title,"修改");
  700. toolBar.EnableDelete = GetRight(@Title,"删除");
  701. toolBar.EnableAudit = GetRight(@Title,"审核");
  702. toolBar.EnableUnAudit = false;
  703. }
  704. else
  705. {
  706. toolBar.EnableAudit = false;
  707. toolBar.EnableModify = false;
  708. toolBar.EnableDelete = false;
  709. toolBar.EnableUnAudit = GetRight(@Title,"取消审核");
  710. }
  711. toolBar.EnablePrint = GetRight(@Title,"打印");
  712. UpdateForm(true, "");
  713. tbNo.Focus();
  714. @Status=2;
  715. </View>
  716. <Modify>
  717. tbNo.ReadOnly=true;
  718. timeMake.Enabled=true;
  719. cbDepart.Enabled=true;
  720. cbApplicant.Enabled=true;
  721. cbApplicationType.Enabled=true;
  722. cbApplicationItem.Enabled=true;
  723. StartDate.Enabled=true;
  724. EndDate.Enabled=true;
  725. txtComment.ReadOnly=false;
  726. dgEmployee.ReadOnly=false;
  727. toolBar.EnableNew = false;
  728. toolBar.EnableSubmit=true;
  729. toolBar.EnableModify=false;
  730. toolBar.EnableDelete=false;
  731. toolBar.EnablePrint=false;
  732. toolBar.EnableAudit = false;
  733. toolBar.EnableUnAudit = false;
  734. #ApplicationBill.LastModUser_ApplicationBill = GetLoginUserID();
  735. #ApplicationBill.LastModUserName = GetCurrentUser();
  736. #ApplicationBill.LastModDate_ApplicationBill = DateTimeNow();
  737. UpdateForm(true, "");
  738. tbNo.Focus();
  739. @Status=3;
  740. </Modify>
  741. <SubmitButtonClick>
  742. <![CDATA[
  743. if(!cbDepart.CheckSelectedItem())
  744. {
  745. MessageBox("请选择有效的任职部门!",@Title);
  746. cbDepart.Focus();
  747. return;
  748. }
  749. if(!cbApplicant.CheckSelectedItem())
  750. {
  751. MessageBox("请选择有效的申请人!",@Title);
  752. cbApplicant.Focus();
  753. return;
  754. }
  755. if(!cbApplicationType.CheckSelectedItem())
  756. {
  757. MessageBox("请选择有效的申请类型!",@Title);
  758. cbApplicant.Focus();
  759. return;
  760. }
  761. if(!cbApplicationItem.CheckSelectedItem())
  762. {
  763. MessageBox("请选择有效的申请明细!",@Title);
  764. cbApplicant.Focus();
  765. return;
  766. }
  767. if(StartDate.Value>=EndDate.Value)
  768. {
  769. MessageBox("开始时间不得大于等于结束时间!",@Title);
  770. cbApplicant.Focus();
  771. return;
  772. }
  773. if (RowCount("#ApplicationBillEmployee") == 0)
  774. {
  775. MessageBox("请假员工不能为空!",@Title);
  776. dgEmployee.Focus();
  777. return;
  778. }
  779. UpdateForm(false, "");
  780. SuspendLayout();
  781. for (@i=0;@i<RowCount("#ApplicationBillEmployee");@i=@i+1)
  782. {
  783. SetPosition("#ApplicationBillEmployee", @i);
  784. {
  785. if(Equals(#ApplicationBillEmployee.ID_Employee,GuidEmpty()))
  786. {
  787. MessageBox("请假员工不存在!",@Title);
  788. dgEmployee.Focus();
  789. dgEmployee.CurrentRowIndex = @i;
  790. ResumeLayout();
  791. return;
  792. }
  793. if (Equals(#ApplicationBillEmployee.ID_ApplicationBillEmployee,GuidEmpty()))
  794. #ApplicationBillEmployee.ID_ApplicationBillEmployee = NewGuid();
  795. #ApplicationBillEmployee.ID_ApplicationBill =#ApplicationBill.ID_ApplicationBill;
  796. }
  797. }
  798. ResumeLayout();
  799. if(@Status==1)
  800. {
  801. New();
  802. }
  803. if(@Status == 3)
  804. {
  805. #ApplicationBill.LastModDate_ApplicationBill=DateTimeNow();
  806. Update();
  807. }
  808. ChangeMode("View");
  809. ]]>
  810. </SubmitButtonClick>
  811. </Lables>
  812. </Form>
  813. </Forms>