123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmAttendanceResult">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="考勤资料结转";
- GetSchema();
- ChangeMode("Search");
- ]]>
- </Load>
- <Closing>
- </Closing>
- <Closed>
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- <New>
- <Lable name="New" />
- </New>
- <View>
- <Lable name="View" />
- </View>
- <Modify>
- <Lable name="Modify" />
- </Modify>
- </Mode>
- <Controls>
- <IKTextButton name="tbNo" DataSource="AttendanceResult.No_AttendanceResult">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchAttendanceResultWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- if(GetRight(@Title,"新增"))
- {
- ChangeMode("New");
- }
- else
- MessageBox("您没有新增考勤资料结转的权限!",@Title);
- }
- }
- else
- {
- MessageBox("请输入考勤编号!",@Title);
- }
- }
- ]]>
- </Enter>
- </Events>
- </IKTextButton>
- <IKComboBoxEx name="cbDept" ValueSource="AttendanceResult.ID_Department" DisplaySource="AttendanceResult.Name_Department" DataSource="Department" ValueMember="ID_Department" DisplayMember="Name_Department" >
- <Events>
- <Reload>
- UpdateForm(false, "cbDept");
- Search("SearchAllDepartment");
- UpdateForm(true, "cbDept");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKDateTimePicker name="dtStart" DataSource="AttendanceResult.Begin_AttendanceResult"/>
- <IKDateTimePicker name="dtEnd" DataSource="AttendanceResult.End_AttendanceResult"/>
- <IKTextBox name="txtComment" DataSource="AttendanceResult.Comment_AttendanceResult"/>
- <IKTextBox name="txtCreator" DataSource="AttendanceResult.Name_Creator"/>
- <IKDateTimeText name="dttCreateDate" DataSource="AttendanceResult.CreateDate_AttendanceResult"/>
- <IKTextBox name="txtAssessor" DataSource="AttendanceResult.Name_Assessor"/>
- <IKDateTimeText name="dtAssessDate" DataSource="AttendanceResult.AssessDate_AttendanceResult"/>
- <IKTextBox name="txtLastModUser" DataSource="AttendanceResult.LastModUserName"/>
- <IKDateTimeText name="dtLastModDate" DataSource="AttendanceResult.LastModDate_AttendanceResult"/>
- <IKButton name="btnSearch">
- <Events>
- <Click>
- if(Search("SearchApplicationBill",dtStart.CValue,dtEnd.CValue,cbDept.SelectedName))
- {
- MergeTable("#ApplicationBill","#AttendanceResultData");
- MergeTable("#Basic","#LaterOrLeaveearly");
- }
- </Click>
- </Events>
- </IKButton>
- <IKDataGridEx name="ikDataGridEx2" DataSource="AttendanceResultData" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="AttendanceResultData.No_Employee" />
- <DataColumn Index="1" DataSource="AttendanceResultData.Name_Employee" />
- <DataColumn Index="2" DataSource="AttendanceResultData.WorkDays_AttendanceResultData" />
- <DataColumn Index="3" DataSource="AttendanceResultData.DutyDays_AttendanceResultData" />
- <DataColumn Index="4" DataSource="AttendanceResultData.OvertimeDays_AttendanceResultData" />
- <DataColumn Index="5" DataSource="AttendanceResultData.WeekendOtDays_AttendanceResultData" />
- <DataColumn Index="6" DataSource="AttendanceResultData.FeastOtDays_AttendanceResultData" />
- <DataColumn Index="7" DataSource="AttendanceResultData.EvectionDays_AttendanceResultData" />
- <DataColumn Index="8" DataSource="AttendanceResultData.AffairLeaveDays_AttendanceResultData" />
- <DataColumn Index="9" DataSource="AttendanceResultData.SickLeaveDays_AttendanceResultData" />
- <DataColumn Index="10" DataSource="AttendanceResultData.PayLeaveDays_AttendanceResultData" />
- <DataColumn Index="11" DataSource="AttendanceResultData.AbsentDays_AttendanceResultData" />
- <DataColumn Index="12" DataSource="AttendanceResultData.LaterTimes_AttendanceResultData" />
- <DataColumn Index="13" DataSource="AttendanceResultData.LaterMinutes_AttendanceResultData" />
- <DataColumn Index="14" DataSource="AttendanceResultData.EarlyLeaveTimes_AttendanceResultData" />
- <DataColumn Index="15" DataSource="AttendanceResultData.EarlyLeaveMinutes_AttendanceResultData" />
- <DataColumn Index="16" DataSource="AttendanceResultData.Comment_AttendanceResultData" />
- </IKDataGridEx>
- <IKDataGridEx name="ikDataGridEx1" DataSource="LaterOrLeaveearly" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="LaterOrLeaveearly.No_Employee" />
- <DataColumn Index="1" DataSource="LaterOrLeaveearly.Name_Employee" />
- <DataColumn Index="2" DataSource="LaterOrLeaveearly.Date_LaterOrLeaveearly" />
- <DataColumn Index="3" DataSource="LaterOrLeaveearly.Minute_Leaveearly" />
- <DataColumn Index="4" DataSource="LaterOrLeaveearly.Minute_Later" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchAttendanceResultByNoFirst", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchAttendanceResultByNoPrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchAttendanceResultByNoNext", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchAttendanceResultByNoLast", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickLast>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- @a = #AttendanceResult.No_AttendanceResult;
- Empty();
- NewInstance();
- Search("SearchAttendanceResultWithNo", @a);
- ChangeMode("View");
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickAudit>
- BeginAudit();
- #AttendanceResult.ID_Assessor = GetLoginUserID();
- #AttendanceResult.Name_Assessor = GetCurrentUser();
- #AttendanceResult.AssessDate_AttendanceResult = DateTimeNow();
- Audit();
- ChangeMode("View");
- EndAudit();
- </ClickAudit>
- <ClickUnAudit>
- BeginUnAudit();
- #AttendanceResult.ID_Assessor = DBNull();
- #AttendanceResult.Name_Assessor = "";
- UnAudit();
- ChangeMode("View");
- EndUnAudit();
- </ClickUnAudit>
- </Events>
- </IKFormToolBar>
- </Controls>
- </Client>
- <Server>
- <Tables>
- <Table name="AttendanceResult" Type="Parent">
- <GetSchema CmdType="Text" CmdText="Select Top 0 AttendanceResult.*
- , a.Name_User AS Name_Creator
- , b.Name_User AS Name_Assessor
- , c.Name_User AS LastModUserName
- , Name_Department
- From AttendanceResult
- Left Join AppUser a On a.ID_User = AttendanceResult.ID_Creator
- Left Join AppUser b On b.ID_User = AttendanceResult.ID_Assessor
- Left Join AppUser c On c.ID_User = AttendanceResult.LastModUser_AttendanceResult
- Left Join Department On Department.ID_Department = AttendanceResult.ID_Department"/>
- <New CmdType="Text" CmdText="Insert Into dbo.AttendanceResult (ID_AttendanceResult
- , No_AttendanceResult
- , Begin_AttendanceResult
- , End_AttendanceResult
- , FactDays_AttendanceResult
- , ID_Department
- , Comment_AttendanceResult
- , ID_Creator
- , CreateDate_AttendanceResult
- , LastModUser_AttendanceResult
- , LastModDate_AttendanceResult
- , ID_Assessor
- , AssessDate_AttendanceResult
- )
- Values (@ID_AttendanceResult
- , @No_AttendanceResult
- , @Begin_AttendanceResult
- , @End_AttendanceResult
- , @FactDays_AttendanceResult
- , @ID_Department
- , @Comment_AttendanceResult
- , @ID_Creator
- , @CreateDate_AttendanceResult
- , @LastModUser_AttendanceResult
- , @LastModDate_AttendanceResult
- , @ID_Assessor
- , @AssessDate_AttendanceResult
- )">
- <Params>
- <Param name="@ID_AttendanceResult" type="AttendanceResult.ID_AttendanceResult" sourceColumn="ID_AttendanceResult" />
- <Param name="@No_AttendanceResult" type="AttendanceResult.No_AttendanceResult" sourceColumn="No_AttendanceResult" />
- <Param name="@Begin_AttendanceResult" type="AttendanceResult.Begin_AttendanceResult" sourceColumn="Begin_AttendanceResult" />
- <Param name="@End_AttendanceResult" type="AttendanceResult.End_AttendanceResult" sourceColumn="End_AttendanceResult" />
- <Param name="@FactDays_AttendanceResult" type="AttendanceResult.FactDays_AttendanceResult" sourceColumn="FactDays_AttendanceResult" />
- <Param name="@ID_Department" type="AttendanceResult.ID_Department" sourceColumn="ID_Department" />
- <Param name="@Comment_AttendanceResult" type="AttendanceResult.Comment_AttendanceResult" sourceColumn="Comment_AttendanceResult" />
- <Param name="@ID_Creator" type="AttendanceResult.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_AttendanceResult" type="AttendanceResult.CreateDate_AttendanceResult" sourceColumn="CreateDate_AttendanceResult" />
- <Param name="@LastModUser_AttendanceResult" type="AttendanceResult.LastModUser_AttendanceResult" sourceColumn="LastModUser_AttendanceResult" />
- <Param name="@LastModDate_AttendanceResult" type="AttendanceResult.LastModDate_AttendanceResult" sourceColumn="LastModDate_AttendanceResult" />
- <Param name="@ID_Assessor" type="AttendanceResult.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_AttendanceResult" type="AttendanceResult.AssessDate_AttendanceResult" sourceColumn="AssessDate_AttendanceResult" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="Update dbo.AttendanceResult
- Set No_AttendanceResult = @No_AttendanceResult
- , Begin_AttendanceResult = @Begin_AttendanceResult
- , End_AttendanceResult = @End_AttendanceResult
- , FactDays_AttendanceResult = @FactDays_AttendanceResult
- , ID_Department = @ID_Department
- , Comment_AttendanceResult = @Comment_AttendanceResult
- , ID_Creator = @ID_Creator
- , CreateDate_AttendanceResult = @CreateDate_AttendanceResult
- , LastModUser_AttendanceResult = @LastModUser_AttendanceResult
- , LastModDate_AttendanceResult = @LastModDate_AttendanceResult
- , ID_Assessor = @ID_Assessor
- , AssessDate_AttendanceResult = @AssessDate_AttendanceResult
- Where ID_AttendanceResult = @ID_AttendanceResult">
- <Params>
- <Param name="@ID_AttendanceResult" type="AttendanceResult.ID_AttendanceResult" sourceColumn="ID_AttendanceResult" />
- <Param name="@No_AttendanceResult" type="AttendanceResult.No_AttendanceResult" sourceColumn="No_AttendanceResult" />
- <Param name="@Begin_AttendanceResult" type="AttendanceResult.Begin_AttendanceResult" sourceColumn="Begin_AttendanceResult" />
- <Param name="@End_AttendanceResult" type="AttendanceResult.End_AttendanceResult" sourceColumn="End_AttendanceResult" />
- <Param name="@FactDays_AttendanceResult" type="AttendanceResult.FactDays_AttendanceResult" sourceColumn="FactDays_AttendanceResult" />
- <Param name="@ID_Department" type="AttendanceResult.ID_Department" sourceColumn="ID_Department" />
- <Param name="@Comment_AttendanceResult" type="AttendanceResult.Comment_AttendanceResult" sourceColumn="Comment_AttendanceResult" />
- <Param name="@ID_Creator" type="AttendanceResult.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_AttendanceResult" type="AttendanceResult.CreateDate_AttendanceResult" sourceColumn="CreateDate_AttendanceResult" />
- <Param name="@LastModUser_AttendanceResult" type="AttendanceResult.LastModUser_AttendanceResult" sourceColumn="LastModUser_AttendanceResult" />
- <Param name="@LastModDate_AttendanceResult" type="AttendanceResult.LastModDate_AttendanceResult" sourceColumn="LastModDate_AttendanceResult" />
- <Param name="@ID_Assessor" type="AttendanceResult.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_AttendanceResult" type="AttendanceResult.AssessDate_AttendanceResult" sourceColumn="AssessDate_AttendanceResult" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="Delete LaterOrLeaveearly Where ID_AttendanceResult = @ID_AttendanceResult
- Delete AttendanceResultData Where ID_AttendanceResult = @ID_AttendanceResult
- Delete AttendanceResult Where ID_AttendanceResult = @ID_AttendanceResult">
- <Params>
- <Param name="@ID_AttendanceResult" type="AttendanceResult.ID_AttendanceResult" sourceColumn="ID_AttendanceResult" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该单据已被其他单据引用,删除失败!" />
- <UNIQUEErrorReport ErrorMessage="该考勤号已存在,提交失败!" />
- <Audit CmdType="Text" CmdText="Update AttendanceResult
- Set ID_Assessor = @ID_Assessor
- , AssessDate_AttendanceResult = @AssessDate_AttendanceResult
- Where ID_AttendanceResult = @ID_AttendanceResult">
- <Params>
- <Param name="@ID_AttendanceResult" type="AttendanceResult.ID_AttendanceResult" sourceColumn="ID_AttendanceResult" />
- <Param name="@ID_Assessor" type="AttendanceResult.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_AttendanceResult" type="AttendanceResult.AssessDate_AttendanceResult" sourceColumn="AssessDate_AttendanceResult" />
- </Params>
- </Audit>
- </Table>
- <Table name="AttendanceResultData" Type="Child">
- <GetSchema CmdType="Text" CmdText="Select Top 0 AttendanceResultData.*
- , No_Employee
- , Name_Employee
- From AttendanceResultData
- Left Join Employee On Employee.ID_Employee = AttendanceResultData.ID_Employee" />
- <New CmdType="Text" CmdText="Insert Into dbo.AttendanceResultData (ID_AttendanceResultData
- , ID_AttendanceResult
- , ID_Employee
- , WorkDays_AttendanceResultData
- , DutyDays_AttendanceResultData
- , OvertimeDays_AttendanceResultData
- , WeekendOtDays_AttendanceResultData
- , FeastOtDays_AttendanceResultData
- , EvectionDays_AttendanceResultData
- , AffairLeaveDays_AttendanceResultData
- , SickLeaveDays_AttendanceResultData
- , PayLeaveDays_AttendanceResultData
- , AbsentDays_AttendanceResultData
- , LaterTimes_AttendanceResultData
- , LaterMinutes_AttendanceResultData
- , EarlyLeaveTimes_AttendanceResultData
- , EarlyLeaveMinutes_AttendanceResultData
- , Comment_AttendanceResultData
- )
- Values (@ID_AttendanceResultData
- , @ID_AttendanceResult
- , @ID_Employee
- , @WorkDays_AttendanceResultData
- , @DutyDays_AttendanceResultData
- , @OvertimeDays_AttendanceResultData
- , @WeekendOtDays_AttendanceResultData
- , @FeastOtDays_AttendanceResultData
- , @EvectionDays_AttendanceResultData
- , @AffairLeaveDays_AttendanceResultData
- , @SickLeaveDays_AttendanceResultData
- , @PayLeaveDays_AttendanceResultData
- , @AbsentDays_AttendanceResultData
- , @LaterTimes_AttendanceResultData
- , @LaterMinutes_AttendanceResultData
- , @EarlyLeaveTimes_AttendanceResultData
- , @EarlyLeaveMinutes_AttendanceResultData
- , @Comment_AttendanceResultData
- )">
- <Params>
- <Param name="@ID_AttendanceResultData" type="AttendanceResultData.ID_AttendanceResultData" sourceColumn="ID_AttendanceResultData" />
- <Param name="@ID_AttendanceResult" type="AttendanceResultData.ID_AttendanceResult" sourceColumn="ID_AttendanceResult" />
- <Param name="@ID_Employee" type="AttendanceResultData.ID_Employee" sourceColumn="ID_Employee" />
- <Param name="@WorkDays_AttendanceResultData" type="AttendanceResultData.WorkDays_AttendanceResultData" sourceColumn="WorkDays_AttendanceResultData" />
- <Param name="@DutyDays_AttendanceResultData" type="AttendanceResultData.DutyDays_AttendanceResultData" sourceColumn="DutyDays_AttendanceResultData" />
- <Param name="@OvertimeDays_AttendanceResultData" type="AttendanceResultData.OvertimeDays_AttendanceResultData" sourceColumn="OvertimeDays_AttendanceResultData" />
- <Param name="@WeekendOtDays_AttendanceResultData" type="AttendanceResultData.WeekendOtDays_AttendanceResultData" sourceColumn="WeekendOtDays_AttendanceResultData" />
- <Param name="@FeastOtDays_AttendanceResultData" type="AttendanceResultData.FeastOtDays_AttendanceResultData" sourceColumn="FeastOtDays_AttendanceResultData" />
- <Param name="@EvectionDays_AttendanceResultData" type="AttendanceResultData.EvectionDays_AttendanceResultData" sourceColumn="EvectionDays_AttendanceResultData" />
- <Param name="@AffairLeaveDays_AttendanceResultData" type="AttendanceResultData.AffairLeaveDays_AttendanceResultData" sourceColumn="AffairLeaveDays_AttendanceResultData" />
- <Param name="@SickLeaveDays_AttendanceResultData" type="AttendanceResultData.SickLeaveDays_AttendanceResultData" sourceColumn="SickLeaveDays_AttendanceResultData" />
- <Param name="@PayLeaveDays_AttendanceResultData" type="AttendanceResultData.PayLeaveDays_AttendanceResultData" sourceColumn="PayLeaveDays_AttendanceResultData" />
- <Param name="@AbsentDays_AttendanceResultData" type="AttendanceResultData.AbsentDays_AttendanceResultData" sourceColumn="AbsentDays_AttendanceResultData" />
- <Param name="@LaterTimes_AttendanceResultData" type="AttendanceResultData.LaterTimes_AttendanceResultData" sourceColumn="LaterTimes_AttendanceResultData" />
- <Param name="@LaterMinutes_AttendanceResultData" type="AttendanceResultData.LaterMinutes_AttendanceResultData" sourceColumn="LaterMinutes_AttendanceResultData" />
- <Param name="@EarlyLeaveTimes_AttendanceResultData" type="AttendanceResultData.EarlyLeaveTimes_AttendanceResultData" sourceColumn="EarlyLeaveTimes_AttendanceResultData" />
- <Param name="@EarlyLeaveMinutes_AttendanceResultData" type="AttendanceResultData.EarlyLeaveMinutes_AttendanceResultData" sourceColumn="EarlyLeaveMinutes_AttendanceResultData" />
- <Param name="@Comment_AttendanceResultData" type="AttendanceResultData.Comment_AttendanceResultData" sourceColumn="Comment_AttendanceResultData" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="Update dbo.AttendanceResultData
- Set ID_AttendanceResult = @ID_AttendanceResult
- , ID_Employee = @ID_Employee
- , WorkDays_AttendanceResultData = @WorkDays_AttendanceResultData
- , DutyDays_AttendanceResultData = @DutyDays_AttendanceResultData
- , OvertimeDays_AttendanceResultData = @OvertimeDays_AttendanceResultData
- , WeekendOtDays_AttendanceResultData = @WeekendOtDays_AttendanceResultData
- , FeastOtDays_AttendanceResultData = @FeastOtDays_AttendanceResultData
- , EvectionDays_AttendanceResultData = @EvectionDays_AttendanceResultData
- , AffairLeaveDays_AttendanceResultData = @AffairLeaveDays_AttendanceResultData
- , SickLeaveDays_AttendanceResultData = @SickLeaveDays_AttendanceResultData
- , PayLeaveDays_AttendanceResultData = @PayLeaveDays_AttendanceResultData
- , AbsentDays_AttendanceResultData = @AbsentDays_AttendanceResultData
- , LaterTimes_AttendanceResultData = @LaterTimes_AttendanceResultData
- , LaterMinutes_AttendanceResultData = @LaterMinutes_AttendanceResultData
- , EarlyLeaveTimes_AttendanceResultData = @EarlyLeaveTimes_AttendanceResultData
- , EarlyLeaveMinutes_AttendanceResultData = @EarlyLeaveMinutes_AttendanceResultData
- , Comment_AttendanceResultData = @Comment_AttendanceResultData
- Where ID_AttendanceResultData = @ID_AttendanceResultData">
- <Params>
- <Param name="@ID_AttendanceResultData" type="AttendanceResultData.ID_AttendanceResultData" sourceColumn="ID_AttendanceResultData" />
- <Param name="@ID_AttendanceResult" type="AttendanceResultData.ID_AttendanceResult" sourceColumn="ID_AttendanceResult" />
- <Param name="@ID_Employee" type="AttendanceResultData.ID_Employee" sourceColumn="ID_Employee" />
- <Param name="@WorkDays_AttendanceResultData" type="AttendanceResultData.WorkDays_AttendanceResultData" sourceColumn="WorkDays_AttendanceResultData" />
- <Param name="@DutyDays_AttendanceResultData" type="AttendanceResultData.DutyDays_AttendanceResultData" sourceColumn="DutyDays_AttendanceResultData" />
- <Param name="@OvertimeDays_AttendanceResultData" type="AttendanceResultData.OvertimeDays_AttendanceResultData" sourceColumn="OvertimeDays_AttendanceResultData" />
- <Param name="@WeekendOtDays_AttendanceResultData" type="AttendanceResultData.WeekendOtDays_AttendanceResultData" sourceColumn="WeekendOtDays_AttendanceResultData" />
- <Param name="@FeastOtDays_AttendanceResultData" type="AttendanceResultData.FeastOtDays_AttendanceResultData" sourceColumn="FeastOtDays_AttendanceResultData" />
- <Param name="@EvectionDays_AttendanceResultData" type="AttendanceResultData.EvectionDays_AttendanceResultData" sourceColumn="EvectionDays_AttendanceResultData" />
- <Param name="@AffairLeaveDays_AttendanceResultData" type="AttendanceResultData.AffairLeaveDays_AttendanceResultData" sourceColumn="AffairLeaveDays_AttendanceResultData" />
- <Param name="@SickLeaveDays_AttendanceResultData" type="AttendanceResultData.SickLeaveDays_AttendanceResultData" sourceColumn="SickLeaveDays_AttendanceResultData" />
- <Param name="@PayLeaveDays_AttendanceResultData" type="AttendanceResultData.PayLeaveDays_AttendanceResultData" sourceColumn="PayLeaveDays_AttendanceResultData" />
- <Param name="@AbsentDays_AttendanceResultData" type="AttendanceResultData.AbsentDays_AttendanceResultData" sourceColumn="AbsentDays_AttendanceResultData" />
- <Param name="@LaterTimes_AttendanceResultData" type="AttendanceResultData.LaterTimes_AttendanceResultData" sourceColumn="LaterTimes_AttendanceResultData" />
- <Param name="@LaterMinutes_AttendanceResultData" type="AttendanceResultData.LaterMinutes_AttendanceResultData" sourceColumn="LaterMinutes_AttendanceResultData" />
- <Param name="@EarlyLeaveTimes_AttendanceResultData" type="AttendanceResultData.EarlyLeaveTimes_AttendanceResultData" sourceColumn="EarlyLeaveTimes_AttendanceResultData" />
- <Param name="@EarlyLeaveMinutes_AttendanceResultData" type="AttendanceResultData.EarlyLeaveMinutes_AttendanceResultData" sourceColumn="EarlyLeaveMinutes_AttendanceResultData" />
- <Param name="@Comment_AttendanceResultData" type="AttendanceResultData.Comment_AttendanceResultData" sourceColumn="Comment_AttendanceResultData" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="Delete AttendanceResultData Where ID_AttendanceResultData = @ID_AttendanceResultData">
- <Params>
- <Param name="@ID_AttendanceResultData" type="AttendanceResultData.ID_AttendanceResultData" sourceColumn="ID_AttendanceResultData" />
- </Params>
- </Delete>
- </Table>
- <Table name="LaterOrLeaveearly" Type="Child">
- <GetSchema CmdType="Text" CmdText="Select Top 0 LaterOrLeaveearly.*
- , No_Employee
- , Name_Employee
- From LaterOrLeaveearly
- Left Join Employee On Employee.ID_Employee = LaterOrLeaveearly.ID_Employee" />
- <New CmdType="Text" CmdText="Insert Into dbo.LaterOrLeaveearly (ID_LaterOrLeaveearly
- , ID_AttendanceResult
- , ID_Employee
- , Date_LaterOrLeaveearly
- , Minute_Later
- , Minute_Leaveearly
- )
- Values (@ID_LaterOrLeaveearly
- , @ID_AttendanceResult
- , @ID_Employee
- , @Date_LaterOrLeaveearly
- , @Minute_Later
- , @Minute_Leaveearly
- )">
- <Params>
- <Param name="@ID_LaterOrLeaveearly" type="LaterOrLeaveearly.ID_LaterOrLeaveearly" sourceColumn="ID_LaterOrLeaveearly" />
- <Param name="@ID_AttendanceResult" type="LaterOrLeaveearly.ID_AttendanceResult" sourceColumn="ID_AttendanceResult" />
- <Param name="@ID_Employee" type="LaterOrLeaveearly.ID_Employee" sourceColumn="ID_Employee" />
- <Param name="@Date_LaterOrLeaveearly" type="LaterOrLeaveearly.Date_LaterOrLeaveearly" sourceColumn="Date_LaterOrLeaveearly" />
- <Param name="@Minute_Later" type="LaterOrLeaveearly.Minute_Later" sourceColumn="Minute_Later" />
- <Param name="@Minute_Leaveearly" type="LaterOrLeaveearly.Minute_Leaveearly" sourceColumn="Minute_Leaveearly" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="Update dbo.LaterOrLeaveearly
- Set ID_AttendanceResult = @ID_AttendanceResult
- , ID_Employee = @ID_Employee
- , Date_LaterOrLeaveearly = @Date_LaterOrLeaveearly
- , Minute_Later = @Minute_Later
- , Minute_Leaveearly = @Minute_Leaveearly
- Where ID_LaterOrLeaveearly = @ID_LaterOrLeaveearly">
- <Params>
- <Param name="@ID_LaterOrLeaveearly" type="LaterOrLeaveearly.ID_LaterOrLeaveearly" sourceColumn="ID_LaterOrLeaveearly" />
- <Param name="@ID_AttendanceResult" type="LaterOrLeaveearly.ID_AttendanceResult" sourceColumn="ID_AttendanceResult" />
- <Param name="@ID_Employee" type="LaterOrLeaveearly.ID_Employee" sourceColumn="ID_Employee" />
- <Param name="@Date_LaterOrLeaveearly" type="LaterOrLeaveearly.Date_LaterOrLeaveearly" sourceColumn="Date_LaterOrLeaveearly" />
- <Param name="@Minute_Later" type="LaterOrLeaveearly.Minute_Later" sourceColumn="Minute_Later" />
- <Param name="@Minute_Leaveearly" type="LaterOrLeaveearly.Minute_Leaveearly" sourceColumn="Minute_Leaveearly" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="Delete LaterOrLeaveearly Where ID_LaterOrLeaveearly = @ID_LaterOrLeaveearly">
- <Params>
- <Param name="@ID_LaterOrLeaveearly" type="LaterOrLeaveearly.ID_LaterOrLeaveearly" sourceColumn="ID_LaterOrLeaveearly" />
- </Params>
- </Delete>
- </Table>
- </Tables>
- <Search>
- <SearchAttendanceResultWithNo CmdType="Text" CmdText="Declare @ID_AttendanceResult Uniqueidentifier
- Select @ID_AttendanceResult = ID_AttendanceResult
- From AttendanceResult
- Where No_AttendanceResult = @No_AttendanceResult
- Select AttendanceResult.*
- , a.Name_User AS Name_Creator
- , b.Name_User AS Name_Assessor
- , c.Name_User AS LastModUserName
- , Case AttendanceResult.ID_Department
- When '12345678-1234-1234-1234-123456789012' then '全部'
- else Name_Department end As Name_Department
- From AttendanceResult
- Left Join AppUser a On a.ID_User = AttendanceResult.ID_Creator
- Left Join AppUser b On b.ID_User = AttendanceResult.ID_Assessor
- Left Join AppUser c On c.ID_User = AttendanceResult.LastModUser_AttendanceResult
- Left Join Department On Department.ID_Department = AttendanceResult.ID_Department
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select AttendanceResultData.*
- , No_Employee
- , Name_Employee
- From AttendanceResultData
- Left Join Employee On Employee.ID_Employee = AttendanceResultData.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select LaterOrLeaveearly.*
- , No_Employee
- , Name_Employee
- From LaterOrLeaveearly
- Left Join Employee On Employee.ID_Employee = LaterOrLeaveearly.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult">
- <Params>
- <Param name="@No_AttendanceResult" type="AttendanceResult.No_AttendanceResult" sourceColumn="No_AttendanceResult" />
- </Params>
- <Tables>
- <Table name="AttendanceResult" />
- <Table name="AttendanceResultData" />
- <Table name="LaterOrLeaveearly" />
- </Tables>
- </SearchAttendanceResultWithNo>
- <SearchAllDepartment CmdType="Text" CmdText="Select '12345678-1234-1234-1234-123456789012' As ID_Department
- , '全部' As Name_Department
- Union All
- Select ID_Department
- , Name_Department
- From Department">
- <Tables>
- <Table name="Department" />
- </Tables>
- </SearchAllDepartment>
- <SearchApplicationBill CmdType="Text" CmdText="
- Declare @ID_Applicant uniqueidentifier
- Declare @No_ApplicationBill nvarchar(64)
- Declare @Item_ApplicationBill nvarchar(64)
- Declare @StartDate_ApplicationBill datetime
- Declare @EndDate_ApplicationBill datetime
- Declare @OnStuffOne datetime
- Declare @OffStuffOne datetime
- Declare @OnStuffTwo datetime
- Declare @OffStuffTwo datetime
- Declare @AppHour decimal(14,1)
- Declare @LoopDate datetime
- Declare @ID_Department Uniqueidentifier
- Select @ID_Department = ID_Department
- From Department
- Where Name_Department = @Name_Department
-
- IF Exists (Select * From tempdb.dbo.sysobjects Where id=Object_ID(N'tempdb.dbo.#department'))
- DROP TABLE #department
- Create table #department
- (
- ID_Department Uniqueidentifier
- )
- if (@Name_Department = '全部')
- Insert Into #department Select ID_Department From Department
- else
- Insert Into #department Select ID_Department From Department Where Name_Department = @Name_Department
- IF Exists (Select * From tempdb.dbo.sysobjects Where id=Object_ID(N'tempdb.dbo.#TempApp'))
- DROP TABLE #TempApp
- Create Table #TempApp
- (
- ID_Applicant uniqueidentifier,
- Date varchar(10),
- OvertimeHour decimal(14,1),
- BusinessHour decimal(14,1),
- CompassionateHour decimal(14,1),
- SickHour decimal(14,1),
- SalaryHour decimal(14,1),
- exception bit,
- Comment nvarchar(256)
- )
- Declare cur cursor
- for
- Select ApplicationBillEmployee.ID_Employee As ID_Applicant,No_ApplicationBill,Item_ApplicationBill,StartDate_ApplicationBill,EndDate_ApplicationBill
- ,OnStuffOne,OffStuffOne,OnStuffTwo,OffStuffTwo
- From dbo.ApplicationBill
- Join dbo.ApplicationBillEmployee On ApplicationBillEmployee.ID_ApplicationBill=ApplicationBill.ID_ApplicationBill
- Join dbo.AttendanceRuleEmployee On ApplicationBillEmployee.ID_Employee=dbo.AttendanceRuleEmployee.ID_Employee
- Join dbo.AttendanceRule On AttendanceRuleEmployee.ID_AttendanceRule=AttendanceRule.ID_AttendanceRule
- Join Employee ON Employee.ID_Employee=dbo.AttendanceRuleEmployee.ID_Employee
- Where ApplicationBill.ID_Assessor Is Not Null
- --And No_Employee Between IsNull(@StartNo_Employee,No_Employee) And IsNull(@EndNo_Employee,No_Employee)
- And DateDiff(day,@StartDate,EndDate_ApplicationBill)>=0 And DateDiff(day,@EndDate,StartDate_ApplicationBill) <=0
- And Employee.ID_Department in (Select ID_Department From #department )
- Open cur
- Fetch Next From cur Into @ID_Applicant,@No_ApplicationBill,@Item_ApplicationBill,@StartDate_ApplicationBill,@EndDate_ApplicationBill
- ,@OnStuffOne,@OffStuffOne,@OnStuffTwo,@OffStuffTwo
- while @@fetch_status=0
- BEGIN
- Set @LoopDate=@StartDate_ApplicationBill
- while(DateDiff(day,@LoopDate,@EndDate_ApplicationBill)>=0)
- BEGIN
- IF(DateDiff(day,@StartDate,@LoopDate)>=0 and DateDiff(day,@EndDate,@LoopDate)<=0)
- BEGIN
- IF(DateDiff(day,@StartDate_ApplicationBill,@LoopDate)>0 and DateDiff(day,@EndDate_ApplicationBill,@LoopDate)<0)
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@OnStuffOne,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@OffStuffTwo))/60.0)
- Else IF(DateDiff(day,@StartDate_ApplicationBill,@LoopDate)=0)
- BEGIN
- IF(DateDiff(day,@EndDate_ApplicationBill,@LoopDate)<0)
- BEGIN
- IF(dbo.TimeDiff(@LoopDate,@OnStuffOne)>0)
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@OnStuffOne,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@OffStuffTwo))/60.0)
- Else IF(dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffOne)>0)
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@OffStuffTwo))/60.0)
- else if(dbo.TimeDiff(@StartDate_ApplicationBill,@OnStuffTwo)>0)
- Set @AppHour=dbo.TimeDiff(@OnStuffTwo,@OffStuffTwo)
- else if(dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffTwo)>0)
- Set @AppHour=dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffTwo)/60.0
- else
- Set @AppHour=0
- END
- Else
- BEGIN
- IF(dbo.TimeDiff(@StartDate_ApplicationBill,@OnStuffOne)>0)
- BEGIN
- IF(dbo.TimeDiff(@EndDate_ApplicationBill,@OnStuffOne)>0)
- Set @AppHour=0
- Else IF (dbo.TimeDiff(@EndDate_ApplicationBill,@OffStuffOne)>0)
- Set @AppHour=Convert(decimal(14,1),dbo.TimeDiff(@OnStuffOne,@EndDate_ApplicationBill)/60.0)
- Else if (dbo.TimeDiff(@EndDate_ApplicationBill,@OnStuffTwo)>0)
- Set @AppHour=Convert(decimal(14,1),dbo.TimeDiff(@OnStuffOne,@OffStuffOne))
- else if(dbo.TimeDiff(@EndDate_ApplicationBill,@OffStuffTwo)>0)
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@OnStuffOne,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@EndDate_ApplicationBill))/60.0)
- else
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@OnStuffOne,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@OffStuffTwo))/60.0)
- END
- Else IF(dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffOne)>0)
- BEGIN
- IF (dbo.TimeDiff(@EndDate_ApplicationBill,@OffStuffOne)>0)
- Set @AppHour=Convert(decimal(14,1),dbo.TimeDiff(@StartDate_ApplicationBill,@EndDate_ApplicationBill)/60.0)
- Else if (dbo.TimeDiff(@EndDate_ApplicationBill,@OnStuffTwo)>0)
- Set @AppHour=Convert(decimal(14,1),dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffOne)/60.0)
- else if(dbo.TimeDiff(@EndDate_ApplicationBill,@OffStuffTwo)>0)
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@EndDate_ApplicationBill))/60.0)
- else
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@OffStuffTwo))/60.0)
- END
- else if(dbo.TimeDiff(@StartDate_ApplicationBill,@OnStuffTwo)>0)
- BEGIN
- IF (dbo.TimeDiff(@EndDate_ApplicationBill,@OnStuffTwo)>0)
- Set @AppHour=0
- Else if (dbo.TimeDiff(@EndDate_ApplicationBill,@OffStuffTwo)>0)
- Set @AppHour=Convert(decimal(14,1),dbo.TimeDiff(@OnStuffTwo,@EndDate_ApplicationBill)/60.0)
- else
- Set @AppHour=Convert(decimal(14,1),dbo.TimeDiff(@OnStuffTwo,@OffStuffTwo)/60.0)
- END
- else if(dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffTwo)>0)
- BEGIN
- IF (dbo.TimeDiff(@EndDate_ApplicationBill,@OffStuffTwo)>0)
- Set @AppHour=Convert(decimal(14,1),dbo.TimeDiff(@StartDate_ApplicationBill,@EndDate_ApplicationBill)/60.0)
- else
- Set @AppHour=Convert(decimal(14,1),dbo.TimeDiff(@StartDate_ApplicationBill,@OffStuffTwo)/60.0)
- END
- else
- Set @AppHour=0
- END
- END
- ELSE
- BEGIN
- IF(dbo.TimeDiff(@EndDate_ApplicationBill,@OnStuffOne)>0)
- Set @AppHour=0
- Else IF(dbo.TimeDiff(@EndDate_ApplicationBill,@OffStuffOne)>0)
- Set @AppHour=dbo.TimeDiff(@OnStuffOne,@EndDate_ApplicationBill)/60.0
- else if(dbo.TimeDiff(@EndDate_ApplicationBill,@OnStuffTwo)>0)
- Set @AppHour=dbo.TimeDiff(@OnStuffOne,@OffStuffOne)/60.0
- else if(dbo.TimeDiff(@EndDate_ApplicationBill,@OffStuffTwo)>0)
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@OnStuffOne,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@EndDate_ApplicationBill))/60.0)
- else
- Set @AppHour=Convert(decimal(14,1),(dbo.TimeDiff(@OnStuffOne,@OffStuffOne)+dbo.TimeDiff(@OnStuffTwo,@OffStuffTwo))/60.0)
- END
-
- IF(Not Exists (Select * From #TempApp Where ID_Applicant=@ID_Applicant And Date=convert(varchar(10),@LoopDate,120)))
- BEGIN
- IF(@Item_ApplicationBill='加班')
- Insert Into #TempApp(ID_Applicant,Date,OvertimeHour,Comment)
- Values(@ID_Applicant,convert(varchar(10),@LoopDate,120),@AppHour,'加班:'+@No_ApplicationBill)
- else if(@Item_ApplicationBill='出差')
- Insert Into #TempApp(ID_Applicant,Date,BusinessHour,Comment)
- Values(@ID_Applicant,convert(varchar(10),@LoopDate,120),@AppHour,'出差:'+@No_ApplicationBill)
- else if(@Item_ApplicationBill='事假')
- Insert Into #TempApp(ID_Applicant,Date,CompassionateHour,Comment)
- Values(@ID_Applicant,convert(varchar(10),@LoopDate,120),@AppHour,'事假:'+@No_ApplicationBill)
- else if(@Item_ApplicationBill='病假')
- Insert Into #TempApp(ID_Applicant,Date,SickHour,Comment)
- Values(@ID_Applicant,convert(varchar(10),@LoopDate,120),@AppHour,'病假:'+@No_ApplicationBill)
- else if(@Item_ApplicationBill='带薪假')
- Insert Into #TempApp(ID_Applicant,Date,SalaryHour,Comment)
- Values(@ID_Applicant,convert(varchar(10),@LoopDate,120),@AppHour,'带薪假:'+@No_ApplicationBill)
- else if(@Item_ApplicationBill='打卡异常')
- Insert Into #TempApp(ID_Applicant,Date,exception,Comment)
- Values(@ID_Applicant,convert(varchar(10),@LoopDate,120),1,'打卡异常:'+@No_ApplicationBill)
- END
- else
- Begin
- IF(@Item_ApplicationBill='加班')
- Update #TempApp Set OvertimeHour=IsNull(OvertimeHour,0)+@AppHour,Comment=Comment+' 加班:'+@No_ApplicationBill Where ID_Applicant=@ID_Applicant And Date=convert(varchar(10),@LoopDate,120)
- else if(@Item_ApplicationBill='出差')
- Update #TempApp Set BusinessHour=IsNull(BusinessHour,0)+@AppHour,Comment=Comment+' 出差:'+@No_ApplicationBill Where ID_Applicant=@ID_Applicant And Date=convert(varchar(10),@LoopDate,120)
- else if(@Item_ApplicationBill='事假')
- Update #TempApp Set CompassionateHour=IsNull(CompassionateHour,0)+@AppHour,Comment=Comment+' 事假:'+@No_ApplicationBill Where ID_Applicant=@ID_Applicant And Date=convert(varchar(10),@LoopDate,120)
- else if(@Item_ApplicationBill='病假')
- Update #TempApp Set SickHour=IsNull(SickHour,0)+@AppHour,Comment=Comment+' 病假:'+@No_ApplicationBill Where ID_Applicant=@ID_Applicant And Date=convert(varchar(10),@LoopDate,120)
- else if(@Item_ApplicationBill='带薪假')
- Update #TempApp Set SalaryHour=IsNull(SalaryHour,0)+@AppHour,Comment=Comment+' 带薪假:'+@No_ApplicationBill Where ID_Applicant=@ID_Applicant And Date=convert(varchar(10),@LoopDate,120)
- else if(@Item_ApplicationBill='打卡异常')
- Update #TempApp Set exception=1,Comment=Comment+' 打卡异常:'+@No_ApplicationBill Where ID_Applicant=@ID_Applicant And Date=convert(varchar(10),@LoopDate,120)
- End
-
- END
- Set @LoopDate=DateAdd(day,1,@LoopDate)
- END
- Fetch Next From cur Into @ID_Applicant,@No_ApplicationBill,@Item_ApplicationBill,@StartDate_ApplicationBill,@EndDate_ApplicationBill
- ,@OnStuffOne,@OffStuffOne,@OnStuffTwo,@OffStuffTwo
- END
- Close cur
- Deallocate cur
- ---------------------------------------------------------------------------------------------------
- IF Exists (Select * From tempdb.dbo.sysobjects Where id=Object_ID(N'tempdb.dbo.#Basic'))
- DROP TABLE #Basic
- Create Table #Basic
- (
- No_Employee nvarchar(64)
- ,Name_Employee nvarchar(64)
- ,Name_Department nvarchar(64)
- ,Date varchar(10)
- ,WeekDay nvarchar(8)
- ,Type_HolidaySetting nvarchar(64)
- ,Name_AttendanceRule nvarchar(64)
- ,StuffHour decimal(14,1)
- ,OnAttendance datetime
- ,OffAttendance datetime
- ,AttendanceHour decimal(14,1)
- ,OvertimeHour decimal(14,1)
- ,BusinessHour decimal(14,1)
- ,CompassionateHour decimal(14,1)
- ,SickHour decimal(14,1)
- ,SalaryHour decimal(14,1)
- ,AbsentHour decimal(14,1)
- ,ArriveLateMinute int
- ,LeaveEarlyMinute int
- ,Comment nvarchar(256)
- )
-
- Insert Into #Basic
- Select No_Employee,Name_Employee,Name_Department,EmployeeInfo.Date,case WeekDay_HolidaySetting when 1 then '日' when 2 then '一' when 3 then '二' when 4 then '三' when 5 then '四' when 6 then '五' else '六' end As WeekDay,Type_HolidaySetting,Name_AttendanceRule,StuffHour
- ,OnAttendance,OffAttendance
- --,OnAttendanceTwo,OffAttendanceTwo
- ,case Type_HolidaySetting when '工作日' then
- case when exception=1 then StuffHour
- else AttendanceHour end
- else null end As AttendanceHour
- ,case when #TempApp.OvertimeHour>StuffHour then StuffHour
- else #TempApp.OvertimeHour end As OvertimeHour
- ,case when #TempApp.BusinessHour>StuffHour then StuffHour
- else #TempApp.BusinessHour end As BusinessHour
- ,case when Type_HolidaySetting='工作日' then
- case when #TempApp.CompassionateHour>StuffHour then StuffHour
- else #TempApp.CompassionateHour end
- else null end As CompassionateHour
- ,case when Type_HolidaySetting='工作日' then
- case when #TempApp.SickHour>StuffHour then StuffHour
- else #TempApp.SickHour end
- else null end As SickHour
- ,case when Type_HolidaySetting='工作日' then
- case when #TempApp.SalaryHour>StuffHour then StuffHour
- else #TempApp.SalaryHour end
- else null end As SalaryHour
- ,case when Type_HolidaySetting='工作日' then
- case when exception=1 then null
- else
- case when (StuffHour-IsNull(AttendanceHour,0)-IsNull(BusinessHour,0)-IsNull(CompassionateHour,0)-IsNull(SickHour,0)-IsNull(SalaryHour,0)
- -case when dbo.TimeDiff(OnStuffOne,OnAttendance) <=30 and dbo.TimeDiff(OnStuffOne,OnAttendance)>0 then dbo.TimeDiff(OnStuffOne,OnAttendance) else 0 end
- -case when dbo.TimeDiff(OffAttendance,OffStuffTwo)<30 and dbo.TimeDiff(OffAttendance,OffStuffTwo)>0 then dbo.TimeDiff(OffAttendance,OffStuffTwo) else 0 end ) >0 then
- (StuffHour-IsNull(AttendanceHour,0)-IsNull(BusinessHour,0)-IsNull(CompassionateHour,0)-IsNull(SickHour,0)-IsNull(SalaryHour,0)
- -case when dbo.TimeDiff(OnStuffOne,OnAttendance) <=30 and dbo.TimeDiff(OnStuffOne,OnAttendance)>0 then dbo.TimeDiff(OnStuffOne,OnAttendance) else 0 end
- -case when dbo.TimeDiff(OffAttendance,OffStuffTwo)<30 and dbo.TimeDiff(OffAttendance,OffStuffTwo)>0 then dbo.TimeDiff(OffAttendance,OffStuffTwo) else 0 end )
- else null end
- end
- else null end As AbsentHour
- ,case when Type_HolidaySetting='工作日' And OnAttendance Is Not Null then
- case when exception=1 then null
- else
- case when dbo.TimeDiff(OnStuffOne,OnAttendance)<=ArriveLate_AttendanceRule or dbo.TimeDiff(OnStuffOne,OnAttendance)>30 then null
- else (dbo.TimeDiff(OnStuffOne,OnAttendance)-ArriveLate_AttendanceRule) end
- end
- else null end As ArriveLateMinute
- ,case when Type_HolidaySetting='工作日' And OnAttendance Is Not Null then
- case when exception=1 then null
- else
- case when dbo.TimeDiff(OffAttendance,OffStuffTwo)<=LeaveEarly_AttendanceRule or dbo.TimeDiff(OffAttendance,OffStuffTwo)>30 then null
- else dbo.TimeDiff(OffAttendance,OffStuffTwo)-LeaveEarly_AttendanceRule end
- end
- else null end As LeaveEarlyMinute
- ,Comment
- From
- (
- Select a.*,dbo.GetAttendanceHour(OnStuffOne,OffStuffOne,OnStuffTwo,OffStuffTwo,OnAttendance,OffAttendance) As AttendanceHour
- From
- (
- Select EmployeeCalendar.ID_Employee,No_Employee,Name_Employee,Name_Department,convert(varchar(10),Date_HolidaySetting,120) As Date,WeekDay_HolidaySetting,Type_HolidaySetting,Name_AttendanceRule
- ,(Select Top 1 Date_AttendanceRecord From dbo.AttendanceRecord Join Employee On Employee.CardNo_Employee=AttendanceRecord.No_Card Where Employee.ID_Employee=EmployeeCalendar.ID_Employee And DateDiff(day,Date_AttendanceRecord,EmployeeCalendar.Date_HolidaySetting)=0 Order By Date_AttendanceRecord) As OnAttendance
- ,(Select Top 1 Date_AttendanceRecord From dbo.AttendanceRecord Join Employee On Employee.CardNo_Employee=AttendanceRecord.No_Card Where Employee.ID_Employee=EmployeeCalendar.ID_Employee And DateDiff(day,Date_AttendanceRecord,EmployeeCalendar.Date_HolidaySetting)=0 Order By Date_AttendanceRecord desc) As OffAttendance
- ,OnStuffOne,OffStuffOne,OnStuffTwo,OffStuffTwo,ArriveLate_AttendanceRule,LeaveEarly_AttendanceRule,TakeOff_AttendanceRule
- ,Convert(decimal(14,1),(dbo.TimeDiff(OnStuffOne,OffStuffOne)+dbo.TimeDiff(OnStuffTwo,OffStuffTwo))/60.0) As StuffHour
- From
- (
- Select *
- From Employee,HolidaySetting
- --Where No_Employee Between IsNull(@StartNo_Employee,No_Employee) And IsNull(@EndNo_Employee,No_Employee)
- Where DateDiff(day,@StartDate,Date_HolidaySetting)>=0 And DateDiff(day,@EndDate,Date_HolidaySetting)<=0
- And Employee.ID_Department in (Select ID_Department From #department )
- )EmployeeCalendar
- Left Join Department On Department.ID_Department=EmployeeCalendar.ID_Department
- Join dbo.AttendanceRuleEmployee On AttendanceRuleEmployee.ID_Employee=EmployeeCalendar.ID_Employee
- Left Join dbo.AttendanceRule On AttendanceRule.ID_AttendanceRule=dbo.AttendanceRuleEmployee.ID_AttendanceRule
- )a
- )EmployeeInfo
- Left Join #TempApp On #TempApp.ID_Applicant=EmployeeInfo.ID_Employee And #TempApp.Date=EmployeeInfo.Date
- -------------------------------------------------------------------------------------------
- Select No_Employee,Name_Employee
- ,IsNull(Sum(case Type_HolidaySetting when '工作日' then 1 end),0) As WorkDays_AttendanceResultData --工作日
- ,IsNull(Sum(case when AttendanceHour Is Not Null then
- case when AttendanceHour>StuffHour then StuffHour else AttendanceHour end
- end)/StuffHour,0) As DutyDays_AttendanceResultData --出勤天数
- ,IsNull(Sum(case Type_HolidaySetting when '工作日' then OvertimeHour end)/StuffHour,0) As OvertimeDays_AttendanceResultData --平时加班天数
- ,IsNull(Sum(case Type_HolidaySetting when '周末' then OvertimeHour end)/StuffHour,0) As WeekendOtDays_AttendanceResultData --周末加班天数
- ,IsNull(Sum(case Type_HolidaySetting when '节日' then OvertimeHour end)/StuffHour,0) As FeastOtDays_AttendanceResultData --节日加班天数
- ,IsNull(Sum(BusinessHour)/StuffHour,0) As EvectionDays_AttendanceResultData --出差天数
- ,IsNull(Sum(CompassionateHour)/StuffHour,0) As AffairLeaveDays_AttendanceResultData --事假天数
- ,IsNull(Sum(SickHour)/StuffHour,0) As SickLeaveDays_AttendanceResultData --病假天数
- ,IsNull(Sum(SalaryHour)/StuffHour,0) As PayLeaveDays_AttendanceResultData --带薪假天数
- ,IsNull(Sum(AbsentHour)/StuffHour,0) As AbsentDays_AttendanceResultData --旷工天数
- ,IsNull(Sum(case when ArriveLateMinute is Not Null then 1 end),0) As LaterTimes_AttendanceResultData --迟到次数
- ,IsNull(Sum(ArriveLateMinute),0) As LaterMinutes_AttendanceResultData --迟到分钟
- ,IsNull(Sum(case when LeaveEarlyMinute is Not Null then 1 end),0) As EarlyLeaveTimes_AttendanceResultData --早退次数
- ,IsNull(Sum(LeaveEarlyMinute),0) As EarlyLeaveMinutes_AttendanceResultData --早退分钟
- From
- #Basic
- Group By No_Employee,Name_Employee,StuffHour
- Select No_Employee,Name_Employee,IsNull(Date,0) As Date_LaterOrLeaveearly,IsNull(ArriveLateMinute,0) As Minute_Later,IsNull(LeaveEarlyMinute,0) As Minute_Leaveearly
- From
- #Basic
- Where ArriveLateMinute Is Not Null Or LeaveEarlyMinute Is Not Null
- Order By No_Employee,Date
-
- drop table #department
- ">
- <Params>
- <Param name="@StartDate" type="SaleBill.Date_SaleBill" Index="0" />
- <Param name="@EndDate" type="SaleBill.Date_SaleBill" Index="1" />
- <Param name="@Name_Department" type="Department.Name_Department" Index="2" />
- </Params>
- <Tables>
- <Table name="ApplicationBill" />
- <Table name="Basic" />
- </Tables>
- </SearchApplicationBill>
- <SearchEmployeeID CmdType="Text" CmdText="Select ID_Employee From Employee Where No_Employee = @No_Employee">
- <Params>
- <Param name="@No_Employee" type="Employee.No_Employee" sourceColumn="No_Employee" />
- </Params>
- <Tables>
- <Table name="EmployeeID" />
- </Tables>
- </SearchEmployeeID>
- <SearchAttendanceResultByNoFirst CmdType="Text" CmdText="
- Declare @ID_AttendanceResult Uniqueidentifier
- Select Top 1 @ID_AttendanceResult = ID_AttendanceResult
- From AttendanceResult
- Order By AttendanceResult.No_AttendanceResult
-
- Select AttendanceResult.*
- , a.Name_User AS Name_Creator
- , b.Name_User AS Name_Assessor
- , c.Name_User AS LastModUserName
- , Case AttendanceResult.ID_Department
- When '12345678-1234-1234-1234-123456789012' then '全部'
- else Name_Department end As Name_Department
- From AttendanceResult
- Left Join AppUser a On a.ID_User = AttendanceResult.ID_Creator
- Left Join AppUser b On b.ID_User = AttendanceResult.ID_Assessor
- Left Join AppUser c On c.ID_User = AttendanceResult.LastModUser_AttendanceResult
- Left Join Department On Department.ID_Department = AttendanceResult.ID_Department
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select AttendanceResultData.*
- , No_Employee
- , Name_Employee
- From AttendanceResultData
- Left Join Employee On Employee.ID_Employee = AttendanceResultData.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select LaterOrLeaveearly.*
- , No_Employee
- , Name_Employee
- From LaterOrLeaveearly
- Left Join Employee On Employee.ID_Employee = LaterOrLeaveearly.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult">
- <Params>
- <Param name="@No_AttendanceResult" type="AttendanceResult.No_AttendanceResult" sourceColumn="No_AttendanceResult" />
- </Params>
- <Tables>
- <Table name="AttendanceResult" />
- <Table name="AttendanceResultData" />
- <Table name="LaterOrLeaveearly" />
- </Tables>
- </SearchAttendanceResultByNoFirst>
- <SearchAttendanceResultByNoPrevious CmdType="Text" CmdText="Declare @ID_AttendanceResult Uniqueidentifier
- Select Top 1 @ID_AttendanceResult = ID_AttendanceResult
- From AttendanceResult
- Where AttendanceResult.No_AttendanceResult < @No_AttendanceResult
- Order By AttendanceResult.No_AttendanceResult Desc
-
- Select AttendanceResult.*
- , a.Name_User AS Name_Creator
- , b.Name_User AS Name_Assessor
- , c.Name_User AS LastModUserName
- , Case AttendanceResult.ID_Department
- When '12345678-1234-1234-1234-123456789012' then '全部'
- else Name_Department end As Name_Department
- From AttendanceResult
- Left Join AppUser a On a.ID_User = AttendanceResult.ID_Creator
- Left Join AppUser b On b.ID_User = AttendanceResult.ID_Assessor
- Left Join AppUser c On c.ID_User = AttendanceResult.LastModUser_AttendanceResult
- Left Join Department On Department.ID_Department = AttendanceResult.ID_Department
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select AttendanceResultData.*
- , No_Employee
- , Name_Employee
- From AttendanceResultData
- Left Join Employee On Employee.ID_Employee = AttendanceResultData.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select LaterOrLeaveearly.*
- , No_Employee
- , Name_Employee
- From LaterOrLeaveearly
- Left Join Employee On Employee.ID_Employee = LaterOrLeaveearly.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult">
- <Params>
- <Param name="@No_AttendanceResult" type="AttendanceResult.No_AttendanceResult" sourceColumn="No_AttendanceResult" />
- </Params>
- <Tables>
- <Table name="AttendanceResult" />
- <Table name="AttendanceResultData" />
- <Table name="LaterOrLeaveearly" />
- </Tables>
- </SearchAttendanceResultByNoPrevious>
- <SearchAttendanceResultByNoNext CmdType="Text" CmdText="Declare @ID_AttendanceResult Uniqueidentifier
- Select Top 1 @ID_AttendanceResult = ID_AttendanceResult
- From AttendanceResult
- Where AttendanceResult.No_AttendanceResult > @No_AttendanceResult
- ORDER BY AttendanceResult.No_AttendanceResult
-
- Select AttendanceResult.*
- , a.Name_User AS Name_Creator
- , b.Name_User AS Name_Assessor
- , c.Name_User AS LastModUserName
- , Case AttendanceResult.ID_Department
- When '12345678-1234-1234-1234-123456789012' then '全部'
- else Name_Department end As Name_Department
- From AttendanceResult
- Left Join AppUser a On a.ID_User = AttendanceResult.ID_Creator
- Left Join AppUser b On b.ID_User = AttendanceResult.ID_Assessor
- Left Join AppUser c On c.ID_User = AttendanceResult.LastModUser_AttendanceResult
- Left Join Department On Department.ID_Department = AttendanceResult.ID_Department
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select AttendanceResultData.*
- , No_Employee
- , Name_Employee
- From AttendanceResultData
- Left Join Employee On Employee.ID_Employee = AttendanceResultData.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select LaterOrLeaveearly.*
- , No_Employee
- , Name_Employee
- From LaterOrLeaveearly
- Left Join Employee On Employee.ID_Employee = LaterOrLeaveearly.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult">
- <Params>
- <Param name="@No_AttendanceResult" type="AttendanceResult.No_AttendanceResult" sourceColumn="No_AttendanceResult" />
- </Params>
- <Tables>
- <Table name="AttendanceResult" />
- <Table name="AttendanceResultData" />
- <Table name="LaterOrLeaveearly" />
- </Tables>
- </SearchAttendanceResultByNoNext>
- <SearchAttendanceResultByNoLast CmdType="Text" CmdText="Declare @ID_AttendanceResult Uniqueidentifier
- Select Top 1 @ID_AttendanceResult = ID_AttendanceResult
- From AttendanceResult
- Order By AttendanceResult.No_AttendanceResult desc
-
- Select AttendanceResult.*
- , a.Name_User AS Name_Creator
- , b.Name_User AS Name_Assessor
- , c.Name_User AS LastModUserName
- , Case AttendanceResult.ID_Department
- When '12345678-1234-1234-1234-123456789012' then '全部'
- else Name_Department end As Name_Department
- From AttendanceResult
- Left Join AppUser a On a.ID_User = AttendanceResult.ID_Creator
- Left Join AppUser b On b.ID_User = AttendanceResult.ID_Assessor
- Left Join AppUser c On c.ID_User = AttendanceResult.LastModUser_AttendanceResult
- Left Join Department On Department.ID_Department = AttendanceResult.ID_Department
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select AttendanceResultData.*
- , No_Employee
- , Name_Employee
- From AttendanceResultData
- Left Join Employee On Employee.ID_Employee = AttendanceResultData.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult
- Select LaterOrLeaveearly.*
- , No_Employee
- , Name_Employee
- From LaterOrLeaveearly
- Left Join Employee On Employee.ID_Employee = LaterOrLeaveearly.ID_Employee
- Where ID_AttendanceResult = @ID_AttendanceResult">
- <Params>
- <Param name="@No_AttendanceResult" type="AttendanceResult.No_AttendanceResult" sourceColumn="No_AttendanceResult" />
- </Params>
- <Tables>
- <Table name="AttendanceResult" />
- <Table name="AttendanceResultData" />
- <Table name="LaterOrLeaveearly" />
- </Tables>
- </SearchAttendanceResultByNoLast>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly = false;
- cbDept.Enabled = false;
- dtStart.Enabled = false;
- dtEnd.Enabled = false;
- txtComment.ReadOnly = true;
- txtCreator.ReadOnly = true;
- dttCreateDate.ReadOnly = true;
- txtAssessor.ReadOnly = true;
- dtAssessDate.ReadOnly = true;
- txtLastModUser.ReadOnly = true;
- dtLastModDate.ReadOnly = true;
- btnSearch.Enabled = false;
- ikDataGridEx2.ReadOnly = true;
- ikDataGridEx1.ReadOnly = true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- #AttendanceResult.CreateDate_AttendanceResult=DBNull();
- #AttendanceResult.LastModUser_AttendanceResult=DBNull();
- #AttendanceResult.LastModDate_AttendanceResult=DBNull();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- tbNo.ReadOnly = true;
- cbDept.Enabled = true;
- dtStart.Enabled = true;
- dtEnd.Enabled = true;
- txtComment.ReadOnly = false;
- txtCreator.ReadOnly = true;
- dttCreateDate.ReadOnly = true;
- txtAssessor.ReadOnly = true;
- dtAssessDate.ReadOnly = true;
- txtLastModUser.ReadOnly = true;
- dtLastModDate.ReadOnly = true;
- btnSearch.Enabled = true;
- ikDataGridEx2.ReadOnly = false;
- ikDataGridEx1.ReadOnly = false;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- #AttendanceResult.No_AttendanceResult=tbNo.CValue;
- #AttendanceResult.Name_Creator=GetCurrentUser();
- #AttendanceResult.ID_AttendanceResult=NewGuid();
- #AttendanceResult.ID_Creator=GetLoginUserID();
- #AttendanceResult.CreateDate_AttendanceResult=DateTimeNow();
- #AttendanceResult.LastModUser_AttendanceResult=DBNull();
- #AttendanceResult.LastModDate_AttendanceResult=DBNull();
- #AttendanceResult.ID_Assessor = DBNull();
- #AttendanceResult.Name_Assessor = DBNull();
- #AttendanceResult.AssessDate_AttendanceResult = DBNull();
- UpdateForm(true, "");
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly = true;
- cbDept.Enabled = false;
- dtStart.Enabled = false;
- dtEnd.Enabled = false;
- txtComment.ReadOnly = true;
- txtCreator.ReadOnly = true;
- dttCreateDate.ReadOnly = true;
- txtAssessor.ReadOnly = true;
- dtAssessDate.ReadOnly = true;
- txtLastModUser.ReadOnly = true;
- dtLastModDate.ReadOnly = true;
- btnSearch.Enabled = false;
- ikDataGridEx2.ReadOnly = true;
- ikDataGridEx1.ReadOnly = true;
- toolBar.EnableSubmit=false;
- if(Equals(#AttendanceResult.ID_Assessor,DBNull()))
- {
- toolBar.EnableModify = GetRight(@Title,"修改");
- toolBar.EnableDelete = GetRight(@Title,"删除");
- toolBar.EnableAudit = GetRight(@Title,"审核");;
- toolBar.EnableUnAudit = false;
- }
- else
- {
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = GetRight(@Title,"取消审核");
- }
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly = true;
- cbDept.Enabled = true;
- dtStart.Enabled = true;
- dtEnd.Enabled = true;
- txtComment.ReadOnly = false;
- txtCreator.ReadOnly = true;
- dttCreateDate.ReadOnly = true;
- txtAssessor.ReadOnly = true;
- dtAssessDate.ReadOnly = true;
- txtLastModUser.ReadOnly = true;
- dtLastModDate.ReadOnly = true;
- btnSearch.Enabled = true;
- ikDataGridEx2.ReadOnly = false;
- ikDataGridEx1.ReadOnly = false;
- toolBar.EnableSubmit = GetRight(@Title,"新增");
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- #AttendanceResult.LastModUser_AttendanceResult = GetLoginUserID();
- #AttendanceResult.LastModUserName = GetCurrentUser();
- #AttendanceResult.LastModDate_AttendanceResult = DateTimeNow();
- UpdateForm(true, "");
- @Status = 3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if (dtStart.CValue == "")
- {
- MessageBox("请输入考勤开始日!",@Title);
- dtStart.Focus();
- return;
- }
- if (dtEnd.CValue == "")
- {
- MessageBox("请输入考勤结束日!",@Title);
- dtEnd.Focus();
- return;
- }
- if(cbDept.SelectedName=="")
- {
- MessageBox("请输入考勤部门!",@Title);
- cbDept.Focus();
- return;
- }
- UpdateForm(false, "");
- SuspendLayout();
- for (@i=0;@i < RowCount("#AttendanceResultData");@i=@i+1)
- {
- SetPosition("#AttendanceResultData", @i);
-
- Search("SearchEmployeeID",#AttendanceResultData.No_Employee);
- #AttendanceResultData.ID_Employee = #EmployeeID.ID_Employee;
-
- if (Equals(#AttendanceResultData.ID_AttendanceResultData,GuidEmpty()))
- #AttendanceResultData.ID_AttendanceResultData = NewGuid();
- #AttendanceResultData.ID_AttendanceResult = #AttendanceResult.ID_AttendanceResult;
- }
-
- for (@i=0;@i < RowCount("#LaterOrLeaveearly");@i=@i+1)
- {
- SetPosition("#LaterOrLeaveearly", @i);
-
- Search("SearchEmployeeID",#LaterOrLeaveearly.No_Employee);
- #LaterOrLeaveearly.ID_Employee = #EmployeeID.ID_Employee;
-
- if (Equals(#LaterOrLeaveearly.ID_LaterOrLeaveearly,GuidEmpty()))
- #LaterOrLeaveearly.ID_LaterOrLeaveearly = NewGuid();
- #LaterOrLeaveearly.ID_AttendanceResult = #AttendanceResult.ID_AttendanceResult;
- }
- ResumeLayout();
- if(@Status == 1)
- {
- #AttendanceResult.CreateDate_AttendanceResult=GetCurrentTime();
- New();
- }
- else if(@Status == 3)
- {
- #AttendanceResult.LastModDate_AttendanceResult=GetCurrentTime();
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|