FrmAttendanceRuleSetting.xml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmAttendanceRuleSetting">
  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. <IKTextButton name="tbNo" DataSource="AttendanceRule.No_AttendanceRule">
  37. <Events>
  38. <Enter>
  39. <![CDATA[
  40. if(tbNo.ReadOnly == false)
  41. {
  42. if(tbNo.CValue != StringEmpty())
  43. {
  44. UpdateForm(false, "");
  45. if(Search("SearchAttendanceRuleWithNo", tbNo.CValue))
  46. {
  47. ChangeMode("View");
  48. }
  49. else
  50. {
  51. if(GetRight(@Title,"新增"))
  52. ChangeMode("New");
  53. }
  54. }
  55. else
  56. {
  57. MessageBox("请输入考勤班次设定编号!",@Title);
  58. }
  59. }
  60. ]]>
  61. </Enter>
  62. <Click>
  63. @Temp = ShowSearchBox("AttendanceRuleSearch","INFOMATION",tbNo.CValue);
  64. if(@Temp != StringEmpty())
  65. {
  66. tbNo.CValue = @Temp;
  67. UpdateForm(false, "");
  68. if(Search("SearchAttendanceRuleWithNo",tbNo.CValue))
  69. {
  70. ChangeMode("View");
  71. }
  72. }
  73. </Click>
  74. </Events>
  75. </IKTextButton>
  76. <IKTextBox name="txtName" DataSource="AttendanceRule.Name_AttendanceRule"/>
  77. <!--<IKComboBox name="cbPayLimitCurrency"/> -->
  78. <IKDateTimePicker name="dtpOnStuffOne" DataSource="AttendanceRule.OnStuffOne"/>
  79. <IKDateTimePicker name="dtpOffStuffOne" DataSource="AttendanceRule.OffStuffOne"/>
  80. <IKDateTimePicker name="dtpOnStuffTwo" DataSource="AttendanceRule.OnStuffTwo"/>
  81. <IKDateTimePicker name="dtpOffStuffTwo" DataSource="AttendanceRule.OffStuffTwo"/>
  82. <IKIntegralUpDown name="itbArriveLate" DataSource="AttendanceRule.ArriveLate_AttendanceRule"/>
  83. <IKIntegralUpDown name="itbLeaveEarly" DataSource="AttendanceRule.LeaveEarly_AttendanceRule"/>
  84. <IKTextBox name="txtComment" DataSource="AttendanceRule.Comment_AttendanceRule"/>
  85. <IKDateTimeText name="dttCreateDate" DataSource="AttendanceRule.CreateDate_AttendanceRule"/>
  86. <IKTextBox name="txtCreator" DataSource="AttendanceRule.Name_Creator"/>
  87. <IKTextBox name="txtMender" DataSource="AttendanceRule.LastModUser"/>
  88. <IKDateTimeText name="dttMendeDate" DataSource="AttendanceRule.LastModDate_AttendanceRule"/>
  89. <IKDataGridEx name="dgEmployee" DataSource="AttendanceRuleEmployee" TableStyleIndex="0">
  90. <DataColumn Index="0" DataSource="AttendanceRuleEmployee.No_Employee" >
  91. <IKDataGridTextButtonColumn>
  92. <Events>
  93. <Click>
  94. @SetFlag=1;
  95. ShowSearchBox("EmployeeSearch","INFOMATION",#AttendanceRuleEmployee.No_Employee);
  96. </Click>
  97. <SetFlagBeforeClick>
  98. @SetFlag=0;
  99. </SetFlagBeforeClick>
  100. </Events>
  101. </IKDataGridTextButtonColumn>
  102. </DataColumn>
  103. <DataColumn Index="1" DataSource="AttendanceRuleEmployee.Name_Employee" />
  104. </IKDataGridEx>
  105. <IKFormToolBar name="toolBar">
  106. <Events>
  107. <ClickFirst>
  108. if(Search("SearchAttendanceRuleFirst"))
  109. {
  110. ChangeMode("View");
  111. }
  112. </ClickFirst>
  113. <ClickPrev>
  114. if(Search("SearchAttendanceRulePrevious", tbNo.CValue))
  115. {
  116. ChangeMode("View");
  117. }
  118. </ClickPrev>
  119. <ClickNext>
  120. if(Search("SearchAttendanceRuleNext", tbNo.CValue))
  121. {
  122. ChangeMode("View");
  123. }
  124. </ClickNext>
  125. <ClickLast>
  126. if(Search("SearchAttendanceRuleLast"))
  127. {
  128. ChangeMode("View");
  129. }
  130. </ClickLast>
  131. <ClickNew>
  132. ;
  133. </ClickNew>
  134. <ClickEmpty>
  135. ChangeMode("Search");
  136. </ClickEmpty>
  137. <ClickSubmit>
  138. <Lable name="SubmitButtonClick"/>
  139. </ClickSubmit>
  140. <ClickModify>
  141. ChangeMode("Modify");
  142. </ClickModify>
  143. <ClickDelete>
  144. Delete();
  145. ChangeMode("Search");
  146. </ClickDelete>
  147. <ClickPrint>
  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. ;
  167. </ClickExpand>
  168. </Events>
  169. </IKFormToolBar>
  170. </Controls>
  171. <Tables>
  172. <Table name="AttendanceRuleEmployee">
  173. <Events>
  174. <ColumnsChanged>
  175. <No_Employee>
  176. if(@SetFlag==0)
  177. {
  178. return;
  179. }
  180. if(Search("GetEmployeeNameByNo",#AttendanceRuleEmployee.No_Employee))
  181. {
  182. #AttendanceRuleEmployee.Name_Employee=#Employee.Name_Employee;
  183. #AttendanceRuleEmployee.ID_Employee=#Employee.ID_Employee;
  184. if(!Equals(#Employee.SuspendDate_Employee,DBNull()))
  185. MessageBox("该员工已停用!",@Title);
  186. }
  187. else
  188. {
  189. MessageBox("该员工不存在!",@Title);
  190. #AttendanceRuleEmployee.Name_Employee="";
  191. #AttendanceRuleEmployee.ID_Employee=GuidEmpty();
  192. @temp = ShowSearchBox("InputEmployeeSearch","INFOMATION",#AttendanceRuleEmployee.No_Employee);
  193. if(@temp != "")
  194. {
  195. ResumeColumnEvent("#AttendanceRuleEmployee.No_Employee");
  196. #AttendanceRuleEmployee.No_Employee = @temp;
  197. ClearColumnEvent();
  198. }
  199. }
  200. </No_Employee>
  201. </ColumnsChanged>
  202. </Events>
  203. </Table>
  204. </Tables>
  205. <LockInfomation LockID="ID_AttendanceRule" LockNO="No_AttendanceRule" LockSearchFunction="SearchAttendanceRuleWithNo"/>
  206. <ChildForms>
  207. <ChildForm name="AttendanceRuleSearch" DataSource="AttendanceRule" SearchFunction="SearchAllAttendanceRule" SearchFunctionCondition="" SearchFunctionByNo="SearchAttendanceRuleWithNo" MappingName="考勤班次设定">
  208. <DataColumn Index="0" MappingName="#AttendanceRule.No_AttendanceRule" HeaderText="班次编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  209. <DataColumn Index="2" MappingName="#AttendanceRule.Name_AttendanceRule" HeaderText="班次名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  210. </ChildForm>
  211. <ChildForm name="InputEmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="" MappingName="员工">
  212. <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" />
  213. <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  214. </ChildForm>
  215. <ChildForm name="EmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="" MappingName="员工" ReturnDataSource="AttendanceRuleEmployee" ShowCheckBox="true">
  216. <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#AttendanceRuleEmployee.No_Employee"/>
  217. <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  218. </ChildForm>
  219. </ChildForms>
  220. <FormatString>
  221. </FormatString>
  222. </Client>
  223. <Server>
  224. <Tables>
  225. <Table name="AttendanceRule" Type="Parent">
  226. <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser
  227. FROM AttendanceRule
  228. LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
  229. LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule"/>
  230. <New CmdType="Text" CmdText="
  231. INSERT INTO [AttendanceRule]
  232. ([ID_AttendanceRule]
  233. ,[No_AttendanceRule]
  234. ,[Name_AttendanceRule]
  235. ,[OnStuffOne]
  236. ,[OffStuffOne]
  237. ,[OnStuffTwo]
  238. ,[OffStuffTwo]
  239. ,[ArriveLate_AttendanceRule]
  240. ,[LeaveEarly_AttendanceRule]
  241. ,[TakeOff_AttendanceRule]
  242. ,[Comment_AttendanceRule]
  243. ,[ID_Creator]
  244. ,[CreateDate_AttendanceRule]
  245. ,[LastModUser_AttendanceRule]
  246. ,[LastModDate_AttendanceRule])
  247. VALUES
  248. (@ID_AttendanceRule
  249. ,@No_AttendanceRule
  250. ,@Name_AttendanceRule
  251. ,@OnStuffOne
  252. ,@OffStuffOne
  253. ,@OnStuffTwo
  254. ,@OffStuffTwo
  255. ,@ArriveLate_AttendanceRule
  256. ,@LeaveEarly_AttendanceRule
  257. ,0
  258. ,@Comment_AttendanceRule
  259. ,@ID_Creator
  260. ,@CreateDate_AttendanceRule
  261. ,@LastModUser_AttendanceRule
  262. ,@LastModDate_AttendanceRule)
  263. " >
  264. <Params>
  265. <Param name="@ID_AttendanceRule" type="AttendanceRule.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
  266. <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" sourceColumn="No_AttendanceRule" />
  267. <Param name="@Name_AttendanceRule" type="AttendanceRule.Name_AttendanceRule" sourceColumn="Name_AttendanceRule" />
  268. <Param name="@OnStuffOne" type="AttendanceRule.OnStuffOne" sourceColumn="OnStuffOne" />
  269. <Param name="@OffStuffOne" type="AttendanceRule.OffStuffOne" sourceColumn="OffStuffOne" />
  270. <Param name="@OnStuffTwo" type="AttendanceRule.OnStuffTwo" sourceColumn="OnStuffTwo" />
  271. <Param name="@OffStuffTwo" type="AttendanceRule.OffStuffTwo" sourceColumn="OffStuffTwo" />
  272. <Param name="@ArriveLate_AttendanceRule" type="AttendanceRule.ArriveLate_AttendanceRule" sourceColumn="ArriveLate_AttendanceRule" />
  273. <Param name="@LeaveEarly_AttendanceRule" type="AttendanceRule.LeaveEarly_AttendanceRule" sourceColumn="LeaveEarly_AttendanceRule" />
  274. <Param name="@TakeOff_AttendanceRule" type="AttendanceRule.TakeOff_AttendanceRule" sourceColumn="TakeOff_AttendanceRule" />
  275. <Param name="@Comment_AttendanceRule" type="AttendanceRule.Comment_AttendanceRule" sourceColumn="Comment_AttendanceRule" />
  276. <Param name="@ID_Creator" type="AttendanceRule.ID_Creator" sourceColumn="ID_Creator" />
  277. <Param name="@CreateDate_AttendanceRule" type="AttendanceRule.CreateDate_AttendanceRule" sourceColumn="CreateDate_AttendanceRule" />
  278. <Param name="@LastModUser_AttendanceRule" type="AttendanceRule.LastModUser_AttendanceRule" sourceColumn="LastModUser_AttendanceRule" />
  279. <Param name="@LastModDate_AttendanceRule" type="AttendanceRule.LastModDate_AttendanceRule" sourceColumn="LastModDate_AttendanceRule" />
  280. </Params>
  281. </New>
  282. <Update CmdType="Text" CmdText="
  283. Update AttendanceRule Set
  284. [No_AttendanceRule] =@No_AttendanceRule
  285. ,[Name_AttendanceRule] =@Name_AttendanceRule
  286. ,[OnStuffOne] =@OnStuffOne
  287. ,[OffStuffOne] =@OffStuffOne
  288. ,[OnStuffTwo] =@OnStuffTwo
  289. ,[OffStuffTwo] =@OffStuffTwo
  290. ,[ArriveLate_AttendanceRule] =@ArriveLate_AttendanceRule
  291. ,[LeaveEarly_AttendanceRule] =@LeaveEarly_AttendanceRule
  292. ,[TakeOff_AttendanceRule] =0
  293. ,[Comment_AttendanceRule] =@Comment_AttendanceRule
  294. ,[ID_Creator] =@ID_Creator
  295. ,[CreateDate_AttendanceRule] =@CreateDate_AttendanceRule
  296. ,[LastModUser_AttendanceRule] =@LastModUser_AttendanceRule
  297. ,[LastModDate_AttendanceRule] =@LastModDate_AttendanceRule
  298. Where ID_AttendanceRule=@ID_AttendanceRule
  299. ">
  300. <Params>
  301. <Param name="@ID_AttendanceRule" type="AttendanceRule.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
  302. <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" sourceColumn="No_AttendanceRule" />
  303. <Param name="@Name_AttendanceRule" type="AttendanceRule.Name_AttendanceRule" sourceColumn="Name_AttendanceRule" />
  304. <Param name="@OnStuffOne" type="AttendanceRule.OnStuffOne" sourceColumn="OnStuffOne" />
  305. <Param name="@OffStuffOne" type="AttendanceRule.OffStuffOne" sourceColumn="OffStuffOne" />
  306. <Param name="@OnStuffTwo" type="AttendanceRule.OnStuffTwo" sourceColumn="OnStuffTwo" />
  307. <Param name="@OffStuffTwo" type="AttendanceRule.OffStuffTwo" sourceColumn="OffStuffTwo" />
  308. <Param name="@ArriveLate_AttendanceRule" type="AttendanceRule.ArriveLate_AttendanceRule" sourceColumn="ArriveLate_AttendanceRule" />
  309. <Param name="@LeaveEarly_AttendanceRule" type="AttendanceRule.LeaveEarly_AttendanceRule" sourceColumn="LeaveEarly_AttendanceRule" />
  310. <Param name="@TakeOff_AttendanceRule" type="AttendanceRule.TakeOff_AttendanceRule" sourceColumn="TakeOff_AttendanceRule" />
  311. <Param name="@Comment_AttendanceRule" type="AttendanceRule.Comment_AttendanceRule" sourceColumn="Comment_AttendanceRule" />
  312. <Param name="@ID_Creator" type="AttendanceRule.ID_Creator" sourceColumn="ID_Creator" />
  313. <Param name="@CreateDate_AttendanceRule" type="AttendanceRule.CreateDate_AttendanceRule" sourceColumn="CreateDate_AttendanceRule" />
  314. <Param name="@LastModUser_AttendanceRule" type="AttendanceRule.LastModUser_AttendanceRule" sourceColumn="LastModUser_AttendanceRule" />
  315. <Param name="@LastModDate_AttendanceRule" type="AttendanceRule.LastModDate_AttendanceRule" sourceColumn="LastModDate_AttendanceRule" />
  316. </Params>
  317. </Update>
  318. <Delete CmdType="Text" CmdText="
  319. DELETE AttendanceRuleEmployee WHERE ID_AttendanceRule = @ID_AttendanceRule
  320. DELETE AttendanceRule WHERE ID_AttendanceRule = @ID_AttendanceRule">
  321. <Params>
  322. <Param name="@ID_AttendanceRule" type="AttendanceRule.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
  323. </Params>
  324. </Delete>
  325. <FKErrorReport ErrorMessage="该考勤班次设定已被引用,删除失败!"/>
  326. <UNIQUEErrorReport ErrorMessage="该考勤班次设定已存在,提交失败!"/>
  327. </Table>
  328. <Table name="AttendanceRuleEmployee" Type="Child">
  329. <GetSchema CmdType="Text" CmdText="SELECT top 0 AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee " />
  330. <New CmdType="Text" CmdText="
  331. Declare @Error nvarchar(256)
  332. Declare @No_Employee nvarchar(64)
  333. IF(Not Exists (Select * From AttendanceRuleEmployee Where ID_Employee=@ID_Employee))
  334. Insert Into AttendanceRuleEmployee(ID_AttendanceRuleEmployee,ID_AttendanceRule,ID_Employee) Values(@ID_AttendanceRuleEmployee,@ID_AttendanceRule,@ID_Employee)
  335. else
  336. BEGIN
  337. Select @No_Employee=No_Employee From Employee Where ID_Employee=@ID_Employee
  338. SET @Error = N'员工编号为'+@No_Employee+N'的班次已设定,提交失败!'
  339. RAISERROR(@Error,16,1)
  340. RETURN
  341. END
  342. ">
  343. <Params>
  344. <Param name="@ID_AttendanceRuleEmployee" type="AttendanceRuleEmployee.ID_AttendanceRuleEmployee" sourceColumn="ID_AttendanceRuleEmployee" />
  345. <Param name="@ID_AttendanceRule" type="AttendanceRuleEmployee.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
  346. <Param name="@ID_Employee" type="AttendanceRuleEmployee.ID_Employee" sourceColumn="ID_Employee" />
  347. </Params>
  348. </New>
  349. <Update CmdType="Text" CmdText="
  350. Update AttendanceRuleEmployee Set ID_AttendanceRule=@ID_AttendanceRule,ID_Employee=@ID_Employee Where ID_AttendanceRuleEmployee=@ID_AttendanceRuleEmployee
  351. ">
  352. <Params>
  353. <Param name="@ID_AttendanceRuleEmployee" type="AttendanceRuleEmployee.ID_AttendanceRuleEmployee" sourceColumn="ID_AttendanceRuleEmployee" />
  354. <Param name="@ID_AttendanceRule" type="AttendanceRuleEmployee.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
  355. <Param name="@ID_Employee" type="AttendanceRuleEmployee.ID_Employee" sourceColumn="ID_Employee" />
  356. </Params>
  357. </Update>
  358. <Delete CmdType="Text" CmdText="DELETE AttendanceRuleEmployee WHERE ID_AttendanceRuleEmployee = @ID_AttendanceRuleEmployee">
  359. <Params>
  360. <Param name="@ID_AttendanceRuleEmployee" type="AttendanceRuleEmployee.ID_AttendanceRuleEmployee" sourceColumn="ID_AttendanceRuleEmployee" />
  361. </Params>
  362. </Delete>
  363. </Table>
  364. </Tables>
  365. <Search>
  366. <SearchAllAttendanceRule CmdType="Text" CmdText="
  367. SELECT AttendanceRule.* From AttendanceRule
  368. ">
  369. <Tables>
  370. <Table name="AllAttendanceRule" />
  371. </Tables>
  372. </SearchAllAttendanceRule>
  373. <SearchAttendanceRuleWithNo CmdType="Text" CmdText="
  374. DECLARE @ID_AttendanceRule uniqueidentifier
  375. SELECT @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule WHERE AttendanceRule.No_AttendanceRule = @No_AttendanceRule
  376. SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
  377. LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
  378. LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
  379. Where No_AttendanceRule=@No_AttendanceRule
  380. SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
  381. Where ID_AttendanceRule=@ID_AttendanceRule
  382. ">
  383. <Params>
  384. <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" Index="0" />
  385. </Params>
  386. <Tables>
  387. <Table name="AttendanceRule" />
  388. <Table name="AttendanceRuleEmployee" />
  389. </Tables>
  390. </SearchAttendanceRuleWithNo>
  391. <SearchAttendanceRuleFirst CmdType="Text" CmdText="
  392. DECLARE @ID_AttendanceRule uniqueidentifier
  393. SELECT Top 1 @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule Order By No_AttendanceRule
  394. SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
  395. LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
  396. LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
  397. Where ID_AttendanceRule=@ID_AttendanceRule
  398. SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
  399. Where ID_AttendanceRule=@ID_AttendanceRule
  400. ">
  401. <Tables>
  402. <Table name="AttendanceRule" />
  403. <Table name="AttendanceRuleEmployee" />
  404. </Tables>
  405. </SearchAttendanceRuleFirst>
  406. <SearchAttendanceRulePrevious CmdType="Text" CmdText="
  407. DECLARE @ID_AttendanceRule uniqueidentifier
  408. SELECT Top 1 @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule WHERE AttendanceRule.No_AttendanceRule &lt; @No_AttendanceRule Order By No_AttendanceRule desc
  409. SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
  410. LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
  411. LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
  412. Where ID_AttendanceRule=@ID_AttendanceRule
  413. SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
  414. Where ID_AttendanceRule=@ID_AttendanceRule
  415. ">
  416. <Params>
  417. <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" Index="0" />
  418. </Params>
  419. <Tables>
  420. <Table name="AttendanceRule" />
  421. <Table name="AttendanceRuleEmployee" />
  422. </Tables>
  423. </SearchAttendanceRulePrevious>
  424. <SearchAttendanceRuleNext CmdType="Text" CmdText="
  425. DECLARE @ID_AttendanceRule uniqueidentifier
  426. SELECT Top 1 @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule WHERE AttendanceRule.No_AttendanceRule &gt; @No_AttendanceRule Order By No_AttendanceRule
  427. SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
  428. LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
  429. LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
  430. Where ID_AttendanceRule=@ID_AttendanceRule
  431. SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
  432. Where ID_AttendanceRule=@ID_AttendanceRule
  433. ">
  434. <Params>
  435. <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" Index="0" />
  436. </Params>
  437. <Tables>
  438. <Table name="AttendanceRule" />
  439. <Table name="AttendanceRuleEmployee" />
  440. </Tables>
  441. </SearchAttendanceRuleNext>
  442. <SearchAttendanceRuleLast CmdType="Text" CmdText="
  443. DECLARE @ID_AttendanceRule uniqueidentifier
  444. SELECT Top 1 @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule Order By No_AttendanceRule desc
  445. SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
  446. LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
  447. LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
  448. Where ID_AttendanceRule=@ID_AttendanceRule
  449. SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
  450. Where ID_AttendanceRule=@ID_AttendanceRule
  451. ">
  452. <Tables>
  453. <Table name="AttendanceRule" />
  454. <Table name="AttendanceRuleEmployee" />
  455. </Tables>
  456. </SearchAttendanceRuleLast>
  457. <GetEmployeeNameByNo CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.No_Employee,Employee.Name_Employee,Employee.SuspendDate_Employee FROM Employee WHERE No_Employee = @No_Employee">
  458. <Params>
  459. <Param name="@No_Employee" type="Employee.No_Employee" Index="0" />
  460. </Params>
  461. <Tables>
  462. <Table name="Employee" />
  463. </Tables>
  464. </GetEmployeeNameByNo>
  465. <SearchAllEmployee CmdType="Text" CmdText="SELECT Employee.No_Employee,Employee.Name_Employee FROM Employee ">
  466. <Tables>
  467. <Table name="AllEmployee" />
  468. </Tables>
  469. </SearchAllEmployee>
  470. <SearchAttendanceRuleName CmdType="Text" CmdText="
  471. Select * From AttendanceRule Where Name_AttendanceRule=@Name And No_AttendanceRule!=@No">
  472. <Params>
  473. <Param name="@Name" type="Employee.No_Employee" Index="0" />
  474. <Param name="@No" type="Employee.No_Employee" Index="1" />
  475. </Params>
  476. <Tables>
  477. <Table name="AttendanceRuleNameLists" />
  478. </Tables>
  479. </SearchAttendanceRuleName>
  480. </Search>
  481. </Server>
  482. <Lables>
  483. <Search>
  484. Empty();
  485. NewInstance();
  486. tbNo.ReadOnly=false;
  487. txtName.ReadOnly=true;
  488. dtpOnStuffOne.Enabled=false;
  489. dtpOffStuffOne.Enabled=false;
  490. dtpOnStuffTwo.Enabled=false;
  491. dtpOffStuffTwo.Enabled=false;
  492. itbArriveLate.ReadOnly=true;
  493. itbLeaveEarly.ReadOnly=true;
  494. txtComment.ReadOnly=true;
  495. dgEmployee.ReadOnly=true;
  496. toolBar.EnableSubmit=false;
  497. toolBar.EnableModify=false;
  498. toolBar.EnableDelete=false;
  499. #AttendanceRule.ID_Creator=DBNull();
  500. #AttendanceRule.Name_Creator=DBNull();
  501. #AttendanceRule.CreateDate_AttendanceRule=DBNull();
  502. #AttendanceRule.LastModUser_AttendanceRule=DBNull();
  503. #AttendanceRule.LastModUser=DBNull();
  504. #AttendanceRule.LastModDate_AttendanceRule=DBNull();
  505. UpdateForm(true, "");
  506. tbNo.Focus();
  507. @Status=0;
  508. </Search>
  509. <New>
  510. Empty();
  511. NewInstance();
  512. tbNo.ReadOnly=true;
  513. txtName.ReadOnly=false;
  514. dtpOnStuffOne.Enabled=true;
  515. dtpOffStuffOne.Enabled=true;
  516. dtpOnStuffTwo.Enabled=true;
  517. dtpOffStuffTwo.Enabled=true;
  518. itbArriveLate.ReadOnly=false;
  519. itbLeaveEarly.ReadOnly=false;
  520. txtComment.ReadOnly=false;
  521. dgEmployee.ReadOnly=false;
  522. toolBar.EnableSubmit=true;
  523. toolBar.EnableModify=false;
  524. toolBar.EnableDelete=false;
  525. #AttendanceRule.ID_AttendanceRule = NewGuid();
  526. #AttendanceRule.No_AttendanceRule = tbNo.CValue;
  527. #AttendanceRule.ID_Creator=GetLoginUserID();
  528. #AttendanceRule.CreateDate_AttendanceRule=DateTimeNow();
  529. #AttendanceRule.Name_Creator=GetCurrentUser();
  530. #AttendanceRule.LastModUser_AttendanceRule=DBNull();
  531. #AttendanceRule.LastModUser=DBNull();
  532. #AttendanceRule.LastModDate_AttendanceRule=DBNull();
  533. UpdateForm(true, "");
  534. tbNo.Focus();
  535. @Status=1;
  536. </New>
  537. <View>
  538. tbNo.ReadOnly=false;
  539. txtName.ReadOnly=true;
  540. dtpOnStuffOne.Enabled=false;
  541. dtpOffStuffOne.Enabled=false;
  542. dtpOnStuffTwo.Enabled=false;
  543. dtpOffStuffTwo.Enabled=false;
  544. itbArriveLate.ReadOnly=true;
  545. itbLeaveEarly.ReadOnly=true;
  546. txtComment.ReadOnly=true;
  547. dgEmployee.ReadOnly=true;
  548. toolBar.EnableSubmit=false;
  549. toolBar.EnableModify = GetRight(@Title,"修改");
  550. toolBar.EnableDelete = GetRight(@Title,"删除");
  551. UpdateForm(true, "");
  552. tbNo.Focus();
  553. @Status=2;
  554. </View>
  555. <Modify>
  556. tbNo.ReadOnly=true;
  557. txtName.ReadOnly=false;
  558. dtpOnStuffOne.Enabled=true;
  559. dtpOffStuffOne.Enabled=true;
  560. dtpOnStuffTwo.Enabled=true;
  561. dtpOffStuffTwo.Enabled=true;
  562. itbArriveLate.ReadOnly=false;
  563. itbLeaveEarly.ReadOnly=false;
  564. txtComment.ReadOnly=false;
  565. dgEmployee.ReadOnly=false;
  566. toolBar.EnableSubmit=true;
  567. toolBar.EnableModify=false;
  568. toolBar.EnableDelete=false;
  569. #AttendanceRule.LastModUser_AttendanceRule = GetLoginUserID();
  570. #AttendanceRule.LastModUser = GetCurrentUser();
  571. #AttendanceRule.LastModDate_AttendanceRule = DateTimeNow();
  572. UpdateForm(true, "");
  573. tbNo.Focus();
  574. @Status=3;
  575. </Modify>
  576. <SubmitButtonClick>
  577. <![CDATA[
  578. if(txtName.CValue=="")
  579. {
  580. MessageBox("请输入班次名称!",@Title);
  581. txtName.Focus();
  582. return;
  583. }
  584. else
  585. {
  586. if(Search("SearchAttendanceRuleName",txtName.CValue,tbNo.CValue))
  587. {
  588. MessageBox("班次名称已存在!",@Title);
  589. txtName.Focus();
  590. return;
  591. }
  592. }
  593. UpdateForm(false, "");
  594. SuspendLayout();
  595. for(@i=RowCount("#AttendanceRuleEmployee")-1;@i>=0;@i=@i-1)
  596. {
  597. SetPosition("#AttendanceRuleEmployee", @i);
  598. if(Equals(#AttendanceRuleEmployee.ID_AttendanceRuleEmployee,GuidEmpty()))
  599. #AttendanceRuleEmployee.ID_AttendanceRuleEmployee = NewGuid();
  600. #AttendanceRuleEmployee.ID_AttendanceRule = #AttendanceRule.ID_AttendanceRule;
  601. if(Equals(#AttendanceRuleEmployee.ID_Employee, GuidEmpty()))
  602. {
  603. dgEmployee.CurrentRowIndex=@i;
  604. MessageBox("该员工不存在!",@Title);
  605. ResumeLayout();
  606. return;
  607. }
  608. Register_Set("1",#AttendanceRuleEmployee.ID_Employee);
  609. for(@j=@i+1;@j<=RowCount("#AttendanceRuleEmployee")-1;@j=@j+1)
  610. {
  611. SetPosition("#AttendanceRuleEmployee",@j);
  612. if(Equals(Register_Get("1"),#AttendanceRuleEmployee.ID_Employee))
  613. {
  614. dgEmployee.CurrentRowIndex=@j;
  615. MessageBox("员工列表中已存在该员工!",@Title);
  616. Register_Remove("1");
  617. ResumeLayout();
  618. return;
  619. }
  620. }
  621. }
  622. Register_Remove("1");
  623. ResumeLayout();
  624. if(@Status==1)
  625. {
  626. New();
  627. }
  628. if(@Status == 3)
  629. {
  630. #AttendanceRule.LastModDate_AttendanceRule=DateTimeNow();
  631. Update();
  632. }
  633. ChangeMode("View");
  634. ]]>
  635. </SubmitButtonClick>
  636. </Lables>
  637. </Form>
  638. </Forms>