123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmAttendanceRuleSetting">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @SetFlag=1;
- @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="AttendanceRule.No_AttendanceRule">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchAttendanceRuleWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- if(GetRight(@Title,"新增"))
- ChangeMode("New");
- }
- }
- else
- {
- MessageBox("请输入考勤班次设定编号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- @Temp = ShowSearchBox("AttendanceRuleSearch","INFOMATION",tbNo.CValue);
- if(@Temp != StringEmpty())
- {
- tbNo.CValue = @Temp;
- UpdateForm(false, "");
- if(Search("SearchAttendanceRuleWithNo",tbNo.CValue))
- {
- ChangeMode("View");
- }
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtName" DataSource="AttendanceRule.Name_AttendanceRule"/>
-
- <!--<IKComboBox name="cbPayLimitCurrency"/> -->
- <IKDateTimePicker name="dtpOnStuffOne" DataSource="AttendanceRule.OnStuffOne"/>
- <IKDateTimePicker name="dtpOffStuffOne" DataSource="AttendanceRule.OffStuffOne"/>
- <IKDateTimePicker name="dtpOnStuffTwo" DataSource="AttendanceRule.OnStuffTwo"/>
- <IKDateTimePicker name="dtpOffStuffTwo" DataSource="AttendanceRule.OffStuffTwo"/>
- <IKIntegralUpDown name="itbArriveLate" DataSource="AttendanceRule.ArriveLate_AttendanceRule"/>
- <IKIntegralUpDown name="itbLeaveEarly" DataSource="AttendanceRule.LeaveEarly_AttendanceRule"/>
-
- <IKTextBox name="txtComment" DataSource="AttendanceRule.Comment_AttendanceRule"/>
-
- <IKDateTimeText name="dttCreateDate" DataSource="AttendanceRule.CreateDate_AttendanceRule"/>
- <IKTextBox name="txtCreator" DataSource="AttendanceRule.Name_Creator"/>
- <IKTextBox name="txtMender" DataSource="AttendanceRule.LastModUser"/>
- <IKDateTimeText name="dttMendeDate" DataSource="AttendanceRule.LastModDate_AttendanceRule"/>
- <IKDataGridEx name="dgEmployee" DataSource="AttendanceRuleEmployee" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="AttendanceRuleEmployee.No_Employee" >
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- @SetFlag=1;
- ShowSearchBox("EmployeeSearch","INFOMATION",#AttendanceRuleEmployee.No_Employee);
- </Click>
- <SetFlagBeforeClick>
- @SetFlag=0;
- </SetFlagBeforeClick>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="1" DataSource="AttendanceRuleEmployee.Name_Employee" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchAttendanceRuleFirst"))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchAttendanceRulePrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchAttendanceRuleNext", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchAttendanceRuleLast"))
- {
- ChangeMode("View");
- }
- </ClickLast>
- <ClickNew>
- ;
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick"/>
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
- <ClickAudit>
- ;
- </ClickAudit>
- <ClickUnAudit>
- ;
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- ;
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="AttendanceRuleEmployee">
- <Events>
- <ColumnsChanged>
- <No_Employee>
- if(@SetFlag==0)
- {
- return;
- }
- if(Search("GetEmployeeNameByNo",#AttendanceRuleEmployee.No_Employee))
- {
- #AttendanceRuleEmployee.Name_Employee=#Employee.Name_Employee;
- #AttendanceRuleEmployee.ID_Employee=#Employee.ID_Employee;
- if(!Equals(#Employee.SuspendDate_Employee,DBNull()))
- MessageBox("该员工已停用!",@Title);
- }
- else
- {
- MessageBox("该员工不存在!",@Title);
- #AttendanceRuleEmployee.Name_Employee="";
- #AttendanceRuleEmployee.ID_Employee=GuidEmpty();
- @temp = ShowSearchBox("InputEmployeeSearch","INFOMATION",#AttendanceRuleEmployee.No_Employee);
- if(@temp != "")
- {
- ResumeColumnEvent("#AttendanceRuleEmployee.No_Employee");
- #AttendanceRuleEmployee.No_Employee = @temp;
- ClearColumnEvent();
- }
- }
- </No_Employee>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_AttendanceRule" LockNO="No_AttendanceRule" LockSearchFunction="SearchAttendanceRuleWithNo"/>
- <ChildForms>
- <ChildForm name="AttendanceRuleSearch" DataSource="AttendanceRule" SearchFunction="SearchAllAttendanceRule" SearchFunctionCondition="" SearchFunctionByNo="SearchAttendanceRuleWithNo" MappingName="考勤班次设定">
- <DataColumn Index="0" MappingName="#AttendanceRule.No_AttendanceRule" HeaderText="班次编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#AttendanceRule.Name_AttendanceRule" HeaderText="班次名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="InputEmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="" MappingName="员工">
- <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="EmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="" MappingName="员工" ReturnDataSource="AttendanceRuleEmployee" ShowCheckBox="true">
- <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#AttendanceRuleEmployee.No_Employee"/>
- <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- <FormatString>
-
- </FormatString>
- </Client>
- <Server>
- <Tables>
- <Table name="AttendanceRule" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser
- FROM AttendanceRule
- LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
- LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule"/>
- <New CmdType="Text" CmdText="
- INSERT INTO [AttendanceRule]
- ([ID_AttendanceRule]
- ,[No_AttendanceRule]
- ,[Name_AttendanceRule]
- ,[OnStuffOne]
- ,[OffStuffOne]
- ,[OnStuffTwo]
- ,[OffStuffTwo]
- ,[ArriveLate_AttendanceRule]
- ,[LeaveEarly_AttendanceRule]
- ,[TakeOff_AttendanceRule]
- ,[Comment_AttendanceRule]
- ,[ID_Creator]
- ,[CreateDate_AttendanceRule]
- ,[LastModUser_AttendanceRule]
- ,[LastModDate_AttendanceRule])
- VALUES
- (@ID_AttendanceRule
- ,@No_AttendanceRule
- ,@Name_AttendanceRule
- ,@OnStuffOne
- ,@OffStuffOne
- ,@OnStuffTwo
- ,@OffStuffTwo
- ,@ArriveLate_AttendanceRule
- ,@LeaveEarly_AttendanceRule
- ,0
- ,@Comment_AttendanceRule
- ,@ID_Creator
- ,@CreateDate_AttendanceRule
- ,@LastModUser_AttendanceRule
- ,@LastModDate_AttendanceRule)
-
- " >
- <Params>
- <Param name="@ID_AttendanceRule" type="AttendanceRule.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
- <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" sourceColumn="No_AttendanceRule" />
- <Param name="@Name_AttendanceRule" type="AttendanceRule.Name_AttendanceRule" sourceColumn="Name_AttendanceRule" />
- <Param name="@OnStuffOne" type="AttendanceRule.OnStuffOne" sourceColumn="OnStuffOne" />
- <Param name="@OffStuffOne" type="AttendanceRule.OffStuffOne" sourceColumn="OffStuffOne" />
- <Param name="@OnStuffTwo" type="AttendanceRule.OnStuffTwo" sourceColumn="OnStuffTwo" />
- <Param name="@OffStuffTwo" type="AttendanceRule.OffStuffTwo" sourceColumn="OffStuffTwo" />
- <Param name="@ArriveLate_AttendanceRule" type="AttendanceRule.ArriveLate_AttendanceRule" sourceColumn="ArriveLate_AttendanceRule" />
- <Param name="@LeaveEarly_AttendanceRule" type="AttendanceRule.LeaveEarly_AttendanceRule" sourceColumn="LeaveEarly_AttendanceRule" />
- <Param name="@TakeOff_AttendanceRule" type="AttendanceRule.TakeOff_AttendanceRule" sourceColumn="TakeOff_AttendanceRule" />
- <Param name="@Comment_AttendanceRule" type="AttendanceRule.Comment_AttendanceRule" sourceColumn="Comment_AttendanceRule" />
- <Param name="@ID_Creator" type="AttendanceRule.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_AttendanceRule" type="AttendanceRule.CreateDate_AttendanceRule" sourceColumn="CreateDate_AttendanceRule" />
- <Param name="@LastModUser_AttendanceRule" type="AttendanceRule.LastModUser_AttendanceRule" sourceColumn="LastModUser_AttendanceRule" />
- <Param name="@LastModDate_AttendanceRule" type="AttendanceRule.LastModDate_AttendanceRule" sourceColumn="LastModDate_AttendanceRule" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="
- Update AttendanceRule Set
- [No_AttendanceRule] =@No_AttendanceRule
- ,[Name_AttendanceRule] =@Name_AttendanceRule
- ,[OnStuffOne] =@OnStuffOne
- ,[OffStuffOne] =@OffStuffOne
- ,[OnStuffTwo] =@OnStuffTwo
- ,[OffStuffTwo] =@OffStuffTwo
- ,[ArriveLate_AttendanceRule] =@ArriveLate_AttendanceRule
- ,[LeaveEarly_AttendanceRule] =@LeaveEarly_AttendanceRule
- ,[TakeOff_AttendanceRule] =0
- ,[Comment_AttendanceRule] =@Comment_AttendanceRule
- ,[ID_Creator] =@ID_Creator
- ,[CreateDate_AttendanceRule] =@CreateDate_AttendanceRule
- ,[LastModUser_AttendanceRule] =@LastModUser_AttendanceRule
- ,[LastModDate_AttendanceRule] =@LastModDate_AttendanceRule
- Where ID_AttendanceRule=@ID_AttendanceRule
-
- ">
- <Params>
- <Param name="@ID_AttendanceRule" type="AttendanceRule.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
- <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" sourceColumn="No_AttendanceRule" />
- <Param name="@Name_AttendanceRule" type="AttendanceRule.Name_AttendanceRule" sourceColumn="Name_AttendanceRule" />
- <Param name="@OnStuffOne" type="AttendanceRule.OnStuffOne" sourceColumn="OnStuffOne" />
- <Param name="@OffStuffOne" type="AttendanceRule.OffStuffOne" sourceColumn="OffStuffOne" />
- <Param name="@OnStuffTwo" type="AttendanceRule.OnStuffTwo" sourceColumn="OnStuffTwo" />
- <Param name="@OffStuffTwo" type="AttendanceRule.OffStuffTwo" sourceColumn="OffStuffTwo" />
- <Param name="@ArriveLate_AttendanceRule" type="AttendanceRule.ArriveLate_AttendanceRule" sourceColumn="ArriveLate_AttendanceRule" />
- <Param name="@LeaveEarly_AttendanceRule" type="AttendanceRule.LeaveEarly_AttendanceRule" sourceColumn="LeaveEarly_AttendanceRule" />
- <Param name="@TakeOff_AttendanceRule" type="AttendanceRule.TakeOff_AttendanceRule" sourceColumn="TakeOff_AttendanceRule" />
- <Param name="@Comment_AttendanceRule" type="AttendanceRule.Comment_AttendanceRule" sourceColumn="Comment_AttendanceRule" />
- <Param name="@ID_Creator" type="AttendanceRule.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_AttendanceRule" type="AttendanceRule.CreateDate_AttendanceRule" sourceColumn="CreateDate_AttendanceRule" />
- <Param name="@LastModUser_AttendanceRule" type="AttendanceRule.LastModUser_AttendanceRule" sourceColumn="LastModUser_AttendanceRule" />
- <Param name="@LastModDate_AttendanceRule" type="AttendanceRule.LastModDate_AttendanceRule" sourceColumn="LastModDate_AttendanceRule" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="
- DELETE AttendanceRuleEmployee WHERE ID_AttendanceRule = @ID_AttendanceRule
- DELETE AttendanceRule WHERE ID_AttendanceRule = @ID_AttendanceRule">
- <Params>
- <Param name="@ID_AttendanceRule" type="AttendanceRule.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该考勤班次设定已被引用,删除失败!"/>
- <UNIQUEErrorReport ErrorMessage="该考勤班次设定已存在,提交失败!"/>
- </Table>
-
- <Table name="AttendanceRuleEmployee" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee " />
- <New CmdType="Text" CmdText="
- Declare @Error nvarchar(256)
- Declare @No_Employee nvarchar(64)
- IF(Not Exists (Select * From AttendanceRuleEmployee Where ID_Employee=@ID_Employee))
- Insert Into AttendanceRuleEmployee(ID_AttendanceRuleEmployee,ID_AttendanceRule,ID_Employee) Values(@ID_AttendanceRuleEmployee,@ID_AttendanceRule,@ID_Employee)
- else
- BEGIN
- Select @No_Employee=No_Employee From Employee Where ID_Employee=@ID_Employee
- SET @Error = N'员工编号为'+@No_Employee+N'的班次已设定,提交失败!'
- RAISERROR(@Error,16,1)
- RETURN
- END
- ">
- <Params>
- <Param name="@ID_AttendanceRuleEmployee" type="AttendanceRuleEmployee.ID_AttendanceRuleEmployee" sourceColumn="ID_AttendanceRuleEmployee" />
- <Param name="@ID_AttendanceRule" type="AttendanceRuleEmployee.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
- <Param name="@ID_Employee" type="AttendanceRuleEmployee.ID_Employee" sourceColumn="ID_Employee" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="
- Update AttendanceRuleEmployee Set ID_AttendanceRule=@ID_AttendanceRule,ID_Employee=@ID_Employee Where ID_AttendanceRuleEmployee=@ID_AttendanceRuleEmployee
- ">
- <Params>
- <Param name="@ID_AttendanceRuleEmployee" type="AttendanceRuleEmployee.ID_AttendanceRuleEmployee" sourceColumn="ID_AttendanceRuleEmployee" />
- <Param name="@ID_AttendanceRule" type="AttendanceRuleEmployee.ID_AttendanceRule" sourceColumn="ID_AttendanceRule" />
- <Param name="@ID_Employee" type="AttendanceRuleEmployee.ID_Employee" sourceColumn="ID_Employee" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE AttendanceRuleEmployee WHERE ID_AttendanceRuleEmployee = @ID_AttendanceRuleEmployee">
- <Params>
- <Param name="@ID_AttendanceRuleEmployee" type="AttendanceRuleEmployee.ID_AttendanceRuleEmployee" sourceColumn="ID_AttendanceRuleEmployee" />
- </Params>
- </Delete>
- </Table>
- </Tables>
- <Search>
- <SearchAllAttendanceRule CmdType="Text" CmdText="
- SELECT AttendanceRule.* From AttendanceRule
- ">
- <Tables>
- <Table name="AllAttendanceRule" />
- </Tables>
- </SearchAllAttendanceRule>
-
- <SearchAttendanceRuleWithNo CmdType="Text" CmdText="
- DECLARE @ID_AttendanceRule uniqueidentifier
- SELECT @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule WHERE AttendanceRule.No_AttendanceRule = @No_AttendanceRule
-
- SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
- LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
- LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
- Where No_AttendanceRule=@No_AttendanceRule
-
- SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
- Where ID_AttendanceRule=@ID_AttendanceRule
- ">
- <Params>
- <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" Index="0" />
- </Params>
- <Tables>
- <Table name="AttendanceRule" />
- <Table name="AttendanceRuleEmployee" />
- </Tables>
- </SearchAttendanceRuleWithNo>
- <SearchAttendanceRuleFirst CmdType="Text" CmdText="
- DECLARE @ID_AttendanceRule uniqueidentifier
- SELECT Top 1 @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule Order By No_AttendanceRule
-
- SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
- LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
- LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
- Where ID_AttendanceRule=@ID_AttendanceRule
-
- SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
- Where ID_AttendanceRule=@ID_AttendanceRule
- ">
-
- <Tables>
- <Table name="AttendanceRule" />
- <Table name="AttendanceRuleEmployee" />
- </Tables>
- </SearchAttendanceRuleFirst>
- <SearchAttendanceRulePrevious CmdType="Text" CmdText="
- DECLARE @ID_AttendanceRule uniqueidentifier
- SELECT Top 1 @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule WHERE AttendanceRule.No_AttendanceRule < @No_AttendanceRule Order By No_AttendanceRule desc
-
- SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
- LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
- LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
- Where ID_AttendanceRule=@ID_AttendanceRule
-
- SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
- Where ID_AttendanceRule=@ID_AttendanceRule
- ">
- <Params>
- <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" Index="0" />
- </Params>
- <Tables>
- <Table name="AttendanceRule" />
- <Table name="AttendanceRuleEmployee" />
- </Tables>
- </SearchAttendanceRulePrevious>
- <SearchAttendanceRuleNext CmdType="Text" CmdText="
-
- DECLARE @ID_AttendanceRule uniqueidentifier
- SELECT Top 1 @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule WHERE AttendanceRule.No_AttendanceRule > @No_AttendanceRule Order By No_AttendanceRule
-
- SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
- LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
- LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
- Where ID_AttendanceRule=@ID_AttendanceRule
-
- SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
- Where ID_AttendanceRule=@ID_AttendanceRule
- ">
- <Params>
- <Param name="@No_AttendanceRule" type="AttendanceRule.No_AttendanceRule" Index="0" />
- </Params>
- <Tables>
- <Table name="AttendanceRule" />
- <Table name="AttendanceRuleEmployee" />
- </Tables>
- </SearchAttendanceRuleNext>
-
-
- <SearchAttendanceRuleLast CmdType="Text" CmdText="
- DECLARE @ID_AttendanceRule uniqueidentifier
- SELECT Top 1 @ID_AttendanceRule = AttendanceRule.ID_AttendanceRule FROM AttendanceRule Order By No_AttendanceRule desc
-
- SELECT AttendanceRule.*,A.Name_User AS Name_Creator,B.Name_User As LastModUser FROM AttendanceRule
- LEFT JOIN AppUser A ON A.ID_User = AttendanceRule.ID_Creator
- LEFT Join AppUser B ON B.ID_User=AttendanceRule.LastModUser_AttendanceRule
- Where ID_AttendanceRule=@ID_AttendanceRule
-
- SELECT AttendanceRuleEmployee.*,No_Employee,Name_Employee From AttendanceRuleEmployee Left Join Employee On Employee.ID_Employee=AttendanceRuleEmployee.ID_Employee
- Where ID_AttendanceRule=@ID_AttendanceRule
- ">
-
- <Tables>
- <Table name="AttendanceRule" />
- <Table name="AttendanceRuleEmployee" />
- </Tables>
- </SearchAttendanceRuleLast>
- <GetEmployeeNameByNo CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.No_Employee,Employee.Name_Employee,Employee.SuspendDate_Employee FROM Employee WHERE No_Employee = @No_Employee">
- <Params>
- <Param name="@No_Employee" type="Employee.No_Employee" Index="0" />
- </Params>
- <Tables>
- <Table name="Employee" />
- </Tables>
- </GetEmployeeNameByNo>
- <SearchAllEmployee CmdType="Text" CmdText="SELECT Employee.No_Employee,Employee.Name_Employee FROM Employee ">
- <Tables>
- <Table name="AllEmployee" />
- </Tables>
- </SearchAllEmployee>
- <SearchAttendanceRuleName CmdType="Text" CmdText="
- Select * From AttendanceRule Where Name_AttendanceRule=@Name And No_AttendanceRule!=@No">
- <Params>
- <Param name="@Name" type="Employee.No_Employee" Index="0" />
- <Param name="@No" type="Employee.No_Employee" Index="1" />
- </Params>
- <Tables>
- <Table name="AttendanceRuleNameLists" />
- </Tables>
- </SearchAttendanceRuleName>
-
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly=false;
- txtName.ReadOnly=true;
- dtpOnStuffOne.Enabled=false;
- dtpOffStuffOne.Enabled=false;
- dtpOnStuffTwo.Enabled=false;
- dtpOffStuffTwo.Enabled=false;
- itbArriveLate.ReadOnly=true;
- itbLeaveEarly.ReadOnly=true;
-
- txtComment.ReadOnly=true;
- dgEmployee.ReadOnly=true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- #AttendanceRule.ID_Creator=DBNull();
- #AttendanceRule.Name_Creator=DBNull();
- #AttendanceRule.CreateDate_AttendanceRule=DBNull();
- #AttendanceRule.LastModUser_AttendanceRule=DBNull();
- #AttendanceRule.LastModUser=DBNull();
- #AttendanceRule.LastModDate_AttendanceRule=DBNull();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- tbNo.ReadOnly=true;
- txtName.ReadOnly=false;
- dtpOnStuffOne.Enabled=true;
- dtpOffStuffOne.Enabled=true;
- dtpOnStuffTwo.Enabled=true;
- dtpOffStuffTwo.Enabled=true;
- itbArriveLate.ReadOnly=false;
- itbLeaveEarly.ReadOnly=false;
-
- txtComment.ReadOnly=false;
- dgEmployee.ReadOnly=false;
- toolBar.EnableSubmit=true;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- #AttendanceRule.ID_AttendanceRule = NewGuid();
- #AttendanceRule.No_AttendanceRule = tbNo.CValue;
- #AttendanceRule.ID_Creator=GetLoginUserID();
- #AttendanceRule.CreateDate_AttendanceRule=DateTimeNow();
- #AttendanceRule.Name_Creator=GetCurrentUser();
- #AttendanceRule.LastModUser_AttendanceRule=DBNull();
- #AttendanceRule.LastModUser=DBNull();
- #AttendanceRule.LastModDate_AttendanceRule=DBNull();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=false;
- txtName.ReadOnly=true;
- dtpOnStuffOne.Enabled=false;
- dtpOffStuffOne.Enabled=false;
- dtpOnStuffTwo.Enabled=false;
- dtpOffStuffTwo.Enabled=false;
- itbArriveLate.ReadOnly=true;
- itbLeaveEarly.ReadOnly=true;
-
- txtComment.ReadOnly=true;
- dgEmployee.ReadOnly=true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify = GetRight(@Title,"修改");
- toolBar.EnableDelete = GetRight(@Title,"删除");
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly=true;
- txtName.ReadOnly=false;
- dtpOnStuffOne.Enabled=true;
- dtpOffStuffOne.Enabled=true;
- dtpOnStuffTwo.Enabled=true;
- dtpOffStuffTwo.Enabled=true;
- itbArriveLate.ReadOnly=false;
- itbLeaveEarly.ReadOnly=false;
-
- txtComment.ReadOnly=false;
- dgEmployee.ReadOnly=false;
- toolBar.EnableSubmit=true;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- #AttendanceRule.LastModUser_AttendanceRule = GetLoginUserID();
- #AttendanceRule.LastModUser = GetCurrentUser();
- #AttendanceRule.LastModDate_AttendanceRule = DateTimeNow();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(txtName.CValue=="")
- {
- MessageBox("请输入班次名称!",@Title);
- txtName.Focus();
- return;
- }
- else
- {
- if(Search("SearchAttendanceRuleName",txtName.CValue,tbNo.CValue))
- {
- MessageBox("班次名称已存在!",@Title);
- txtName.Focus();
- return;
- }
- }
-
- UpdateForm(false, "");
-
-
- SuspendLayout();
-
- for(@i=RowCount("#AttendanceRuleEmployee")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#AttendanceRuleEmployee", @i);
- if(Equals(#AttendanceRuleEmployee.ID_AttendanceRuleEmployee,GuidEmpty()))
- #AttendanceRuleEmployee.ID_AttendanceRuleEmployee = NewGuid();
- #AttendanceRuleEmployee.ID_AttendanceRule = #AttendanceRule.ID_AttendanceRule;
- if(Equals(#AttendanceRuleEmployee.ID_Employee, GuidEmpty()))
- {
- dgEmployee.CurrentRowIndex=@i;
- MessageBox("该员工不存在!",@Title);
- ResumeLayout();
- return;
- }
- Register_Set("1",#AttendanceRuleEmployee.ID_Employee);
- for(@j=@i+1;@j<=RowCount("#AttendanceRuleEmployee")-1;@j=@j+1)
- {
- SetPosition("#AttendanceRuleEmployee",@j);
- if(Equals(Register_Get("1"),#AttendanceRuleEmployee.ID_Employee))
- {
- dgEmployee.CurrentRowIndex=@j;
- MessageBox("员工列表中已存在该员工!",@Title);
- Register_Remove("1");
- ResumeLayout();
- return;
- }
- }
- }
- Register_Remove("1");
- ResumeLayout();
- if(@Status==1)
- {
- New();
- }
- if(@Status == 3)
- {
- #AttendanceRule.LastModDate_AttendanceRule=DateTimeNow();
- Update();
- }
-
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|