123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883 |
- <?xml version="1.0" encoding="utf-8"?>
- <Forms>
- <Form Name="FrmApplicationBill">
- <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>
- <IKDateTimePicker name="timeMake" DataSource="ApplicationBill.Date_ApplicationBill"></IKDateTimePicker>
- <IKTextButton name="tbNo" DataSource="ApplicationBill.No_ApplicationBill">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchApplicationBillWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- MessageBox("该申请单不存在!",@Title);
- }
- }
- else
- {
- MessageBox("请输入申请单号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- @Temp = ShowSearchBox("ApplicationBillSearch","NODEPOT","tbNo",tbNo.CValue);
- if(@Temp != StringEmpty())
- {
- tbNo.CValue = @Temp;
- UpdateForm(false, "");
- if(Search("SearchApplicationBillWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBoxExText name="cbDepart" DisplaySource="ApplicationBill.Name_Department" NoSource="ApplicationBill.No_Department" ValueSource="ApplicationBill.ID_Department" DataSource="Department" DisplayMember="Name_Department" NoMember="No_Department" ValueMember="ID_Department">
- <Events>
- <Reload>
- UpdateForm(false, "cbDepart");
- Search("SearchDepartment");
- UpdateForm(true, "cbDepart");
- </Reload>
- </Events>
- </IKComboBoxExText>
- <IKComboBoxExText name="cbApplicant" DisplaySource="ApplicationBill.Name_Applicant" NoSource="ApplicationBill.No_Applicant" ValueSource="ApplicationBill.ID_Applicant" DataSource="Applicant" DisplayMember="Name_Employee" NoMember="No_Employee" ValueMember="ID_Employee">
- <Events>
- <Reload>
- UpdateForm(false, "cbApplicant");
- Search("SearchApplicant",cbDepart.SelectedValue1);
- UpdateForm(true, "cbApplicant");
- </Reload>
- </Events>
- </IKComboBoxExText>
- <IKComboBoxEx name="cbApplicationType" DisplaySource="ApplicationBill.Type_ApplicationBill" DataSource="ApplicationType" DisplayMember="Type">
- <Events>
- <Reload>
- UpdateForm(false, "cbApplicationType");
- Search("SearchApplicationType");
- UpdateForm(true, "cbApplicationType");
- </Reload>
-
- </Events>
-
- </IKComboBoxEx>
- <IKComboBoxEx name="cbApplicationItem" DisplaySource="ApplicationBill.Item_ApplicationBill" DataSource="ApplicationItem" DisplayMember="Item">
- <Events>
- <Reload>
- UpdateForm(false, "cbApplicationItem");
- Search("SearchApplicationItem",cbApplicationType.Text);
- UpdateForm(true, "cbApplicationItem");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKDateTimePicker name="StartDate" DataSource="ApplicationBill.StartDate_ApplicationBill"></IKDateTimePicker>
- <IKDateTimePicker name="EndDate" DataSource="ApplicationBill.EndDate_ApplicationBill"></IKDateTimePicker>
- <IKTextBox name="txtComment" DataSource="ApplicationBill.Comment_ApplicationBill"></IKTextBox>
- <IKTextBox name="txtMaker" DataSource="ApplicationBill.Name_Creator"></IKTextBox>
- <IKTextBox name="txtAssessor" DataSource="ApplicationBill.Name_Assessor"></IKTextBox>
- <IKDateTimeText name="dtAssessDate" DataSource="ApplicationBill.AssessDate_ApplicationBill"></IKDateTimeText>
- <IKTextBox name="txtLastModUser" DataSource="ApplicationBill.LastModUserName"></IKTextBox>
- <IKDateTimeText name="dtLastModDate" DataSource="ApplicationBill.LastModDate_ApplicationBill"></IKDateTimeText>
- <IKDataGridEx name="dgEmployee" DataSource="ApplicationBillEmployee" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="ApplicationBillEmployee.No_Employee" >
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- @SetFlag=1;
- @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#ApplicationBillEmployee.No_Employee);
- </Click>
- <SetFlagBeforeClick>
- @SetFlag=0;
- </SetFlagBeforeClick>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="1" DataSource="ApplicationBillEmployee.Name_Employee" />
- </IKDataGridEx>
-
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchApplicationBillFirst"))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchApplicationBillPrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchApplicationBillNext", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchApplicationBillLast"))
- {
- ChangeMode("View");
- }
- </ClickLast>
- <ClickNew>
- @NextNo = GetNextAutoNumber(true);
- if (!Equals(@NextNo, ""))
- {
- ChangeMode("New");
- #ApplicationBill.No_ApplicationBill = @NextNo;
- UpdateForm(true, "tbNo");
- }
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick"/>
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
-
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
- <ClickAudit>
- BeginAudit();
- #ApplicationBill.ID_Assessor = GetLoginUserID();
- #ApplicationBill.Name_Assessor = GetCurrentUser();
- #ApplicationBill.AssessDate_ApplicationBill = DateTimeNow();
- Audit();
- ChangeMode("View");
- EndAudit();
- </ClickAudit>
- <ClickUnAudit>
- BeginUnAudit();
- #ApplicationBill.ID_Assessor = DBNull();
- #ApplicationBill.Name_Assessor = "";
- UnAudit();
- ChangeMode("View");
- EndUnAudit();
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- ;
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="ApplicationBillEmployee">
- <Events>
- <ColumnsChanged>
- <No_Employee>
- if(@SetFlag==0)
- {
- return;
- }
- if(Search("GetEmployeeNameByNo",#ApplicationBillEmployee.No_Employee))
- {
- #ApplicationBillEmployee.Name_Employee=#Employee.Name_Employee;
- #ApplicationBillEmployee.ID_Employee=#Employee.ID_Employee;
- if(!Equals(#Employee.SuspendDate_Employee,DBNull()))
- MessageBox("该员工已停用!",@Title);
- }
- else
- {
- MessageBox("该员工不存在!",@Title);
- #ApplicationBillEmployee.Name_Employee="";
- #ApplicationBillEmployee.ID_Employee=GuidEmpty();
- @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#ApplicationBillEmployee.No_Employee);
- if(@temp != "")
- {
- ResumeColumnEvent("#ApplicationBillEmployee.No_Employee");
- #ApplicationBillEmployee.No_Employee = @temp;
- ClearColumnEvent();
- }
- }
- </No_Employee>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_ApplicationBill" LockNO="No_ApplicationBill" LockSearchFunction="SearchApplicationBillWithNo"/>
- <ChildForms>
- <ChildForm name="ApplicationBillSearch" DataSource="ApplicationBill" SearchFunction="SearchAllApplicationBill" SearchFunctionByNo="SearchApplicationBillWithNo" MappingName="申请单">
- <DataColumn Index="0" MappingName="#ApplicationBill.No_ApplicationBill" HeaderText="申请单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#ApplicationBill.Date_ApplicationBill" HeaderText="申请日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#ApplicationBill.Name_Applicant" HeaderText="申请人" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#ApplicationBill.Item_ApplicationBill" HeaderText="申请明细" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#ApplicationBill.Status_ApplicationBill" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="EmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="" MappingName="员工" ReturnDataSource="ApplicationBillEmployee" ShowCheckBox="true">
- <DataColumn Index="0" MappingName="#Employee.No_Employee" HeaderText="员工编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#ApplicationBillEmployee.No_Employee"/>
- <DataColumn Index="1" MappingName="#Employee.Name_Employee" HeaderText="员工名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="ApplicationBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
- FROM ApplicationBill
- LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
- LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
- Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
- LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department"/>
- <New CmdType="Text" CmdText="INSERT INTO ApplicationBill
- ([ID_ApplicationBill]
- ,[No_ApplicationBill]
- ,[Date_ApplicationBill]
- ,[ID_Department]
- ,[ID_Applicant]
- ,[Type_ApplicationBill]
- ,[Item_ApplicationBill]
- ,[StartDate_ApplicationBill]
- ,[EndDate_ApplicationBill]
- ,[Comment_ApplicationBill]
- ,[ID_Creator]
- ,[LastModUser_ApplicationBill]
- ,[LastModDate_ApplicationBill]
- ,[ID_Assessor]
- ,[AssessDate_ApplicationBill])
- VALUES
- (@ID_ApplicationBill
- ,@No_ApplicationBill
- ,@Date_ApplicationBill
- ,@ID_Department
- ,@ID_Applicant
- ,@Type_ApplicationBill
- ,@Item_ApplicationBill
- ,@StartDate_ApplicationBill
- ,@EndDate_ApplicationBill
- ,@Comment_ApplicationBill
- ,@ID_Creator
- ,@LastModUser_ApplicationBill
- ,@LastModDate_ApplicationBill
- ,@ID_Assessor
- ,@AssessDate_ApplicationBill)">
- <Params>
- <Param name="@ID_ApplicationBill" type="ApplicationBill.ID_ApplicationBill" sourceColumn="ID_ApplicationBill"/>
- <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" sourceColumn="No_ApplicationBill"/>
- <Param name="@Date_ApplicationBill" type="ApplicationBill.Date_ApplicationBill" sourceColumn="Date_ApplicationBill"/>
- <Param name="@ID_Department" type="ApplicationBill.ID_Department" sourceColumn="ID_Department"/>
- <Param name="@ID_Applicant" type="ApplicationBill.ID_Applicant" sourceColumn="ID_Applicant"/>
- <Param name="@Type_ApplicationBill" type="ApplicationBill.Type_ApplicationBill" sourceColumn="Type_ApplicationBill"/>
- <Param name="@Item_ApplicationBill" type="ApplicationBill.Item_ApplicationBill" sourceColumn="Item_ApplicationBill"/>
- <Param name="@StartDate_ApplicationBill" type="ApplicationBill.StartDate_ApplicationBill" sourceColumn="StartDate_ApplicationBill"/>
- <Param name="@EndDate_ApplicationBill" type="ApplicationBill.EndDate_ApplicationBill" sourceColumn="EndDate_ApplicationBill"/>
- <Param name="@Comment_ApplicationBill" type="ApplicationBill.Comment_ApplicationBill" sourceColumn="Comment_ApplicationBill"/>
- <Param name="@ID_Creator" type="ApplicationBill.ID_Creator" sourceColumn="ID_Creator"/>
- <Param name="@LastModUser_ApplicationBill" type="ApplicationBill.LastModUser_ApplicationBill" sourceColumn="LastModUser_ApplicationBill"/>
- <Param name="@LastModDate_ApplicationBill" type="ApplicationBill.LastModDate_ApplicationBill" sourceColumn="LastModDate_ApplicationBill"/>
- <Param name="@ID_Assessor" type="ApplicationBill.ID_Assessor" sourceColumn="ID_Assessor"/>
- <Param name="@AssessDate_ApplicationBill" type="ApplicationBill.AssessDate_ApplicationBill" sourceColumn="AssessDate_ApplicationBill"/>
-
- </Params>
- </New>
- <Update CmdType="Text" CmdText="
- Update ApplicationBill
- Set No_ApplicationBill=@No_ApplicationBill
- ,Date_ApplicationBill=@Date_ApplicationBill
- ,ID_Department=@ID_Department
- ,ID_Applicant=@ID_Applicant
- ,Type_ApplicationBill=@Type_ApplicationBill
- ,Item_ApplicationBill=@Item_ApplicationBill
- ,StartDate_ApplicationBill=@StartDate_ApplicationBill
- ,EndDate_ApplicationBill=@EndDate_ApplicationBill
- ,Comment_ApplicationBill=@Comment_ApplicationBill
- ,ID_Creator=@ID_Creator
- ,LastModUser_ApplicationBill=@LastModUser_ApplicationBill
- ,LastModDate_ApplicationBill=@LastModDate_ApplicationBill
- Where ID_ApplicationBill=@ID_ApplicationBill
- ">
- <Params>
- <Param name="@ID_ApplicationBill" type="ApplicationBill.ID_ApplicationBill" sourceColumn="ID_ApplicationBill"/>
- <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" sourceColumn="No_ApplicationBill"/>
- <Param name="@Date_ApplicationBill" type="ApplicationBill.Date_ApplicationBill" sourceColumn="Date_ApplicationBill"/>
- <Param name="@ID_Department" type="ApplicationBill.ID_Department" sourceColumn="ID_Department"/>
- <Param name="@ID_Applicant" type="ApplicationBill.ID_Applicant" sourceColumn="ID_Applicant"/>
- <Param name="@Type_ApplicationBill" type="ApplicationBill.Type_ApplicationBill" sourceColumn="Type_ApplicationBill"/>
- <Param name="@Item_ApplicationBill" type="ApplicationBill.Item_ApplicationBill" sourceColumn="Item_ApplicationBill"/>
- <Param name="@StartDate_ApplicationBill" type="ApplicationBill.StartDate_ApplicationBill" sourceColumn="StartDate_ApplicationBill"/>
- <Param name="@EndDate_ApplicationBill" type="ApplicationBill.EndDate_ApplicationBill" sourceColumn="EndDate_ApplicationBill"/>
- <Param name="@Comment_ApplicationBill" type="ApplicationBill.Comment_ApplicationBill" sourceColumn="Comment_ApplicationBill"/>
- <Param name="@ID_Creator" type="ApplicationBill.ID_Creator" sourceColumn="ID_Creator"/>
- <Param name="@LastModUser_ApplicationBill" type="ApplicationBill.LastModUser_ApplicationBill" sourceColumn="LastModUser_ApplicationBill"/>
- <Param name="@LastModDate_ApplicationBill" type="ApplicationBill.LastModDate_ApplicationBill" sourceColumn="LastModDate_ApplicationBill"/>
- </Params>
- </Update>
- <Audit CmdType="Text" CmdText="
- UPDATE ApplicationBill SET ID_Assessor = @ID_Assessor, AssessDate_ApplicationBill = @AssessDate_ApplicationBill WHERE ID_ApplicationBill = @ID_ApplicationBill
- ">
- <Params>
- <Param name="@ID_ApplicationBill" type="ApplicationBill.ID_ApplicationBill" sourceColumn="ID_ApplicationBill" />
- <Param name="@ID_Assessor" type="ApplicationBill.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_ApplicationBill" type="ApplicationBill.AssessDate_ApplicationBill" sourceColumn="AssessDate_ApplicationBill" />
- </Params>
- </Audit>
- <Delete CmdType="Text" CmdText="DELETE ApplicationBill WHERE ApplicationBill.ID_ApplicationBill = @ID_ApplicationBill">
- <Params>
- <Param name="@ID_ApplicationBill" type="ApplicationBill.ID_ApplicationBill" sourceColumn="ID_ApplicationBill"/>
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该申请单已被引用,删除失败!"/>
- <UNIQUEErrorReport ErrorMessage="该申请单号已存在,提交失败!"/>
- </Table>
- <Table name="ApplicationBillEmployee" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee" />
- <New CmdType="Text" CmdText=" INSERT INTO ApplicationBillEmployee (ID_ApplicationBillEmployee,ID_ApplicationBill,ID_Employee)
- VALUES(@ID_ApplicationBillEmployee,@ID_ApplicationBill,@ID_Employee)" >
- <Params>
- <Param name="@ID_ApplicationBillEmployee" type="ApplicationBillEmployee.ID_ApplicationBillEmployee" sourceColumn="ID_ApplicationBillEmployee" />
- <Param name="@ID_ApplicationBill" type="ApplicationBillEmployee.ID_ApplicationBill" sourceColumn="ID_ApplicationBill" />
- <Param name="@ID_Employee" type="ApplicationBillEmployee.ID_Employee" sourceColumn="ID_Employee" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE ApplicationBillEmployee SET ID_Employee = @ID_Employee
- WHERE ID_ApplicationBillEmployee = @ID_ApplicationBillEmployee">
- <Params>
- <Param name="@ID_ApplicationBillEmployee" type="ApplicationBillEmployee.ID_ApplicationBillEmployee" sourceColumn="ID_ApplicationBillEmployee" />
- <Param name="@ID_Employee" type="ApplicationBillEmployee.ID_Employee" sourceColumn="ID_Employee" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE ApplicationBillEmployee WHERE ID_ApplicationBillEmployee = @ID_ApplicationBillEmployee">
- <Params>
- <Param name="@ID_ApplicationBillEmployee" type="ApplicationBillEmployee.ID_ApplicationBillEmployee" sourceColumn="ID_ApplicationBillEmployee" />
- </Params>
- </Delete>
- </Table>
- </Tables>
- <Search>
- <SearchAllApplicationBill CmdType="Text" CmdText="SELECT ApplicationBill.No_ApplicationBill,ApplicationBill.Date_ApplicationBill,Item_ApplicationBill,Name_Employee As Name_Applicant
- ,Case When ApplicationBill.ID_Assessor Is Not Null Then '已审核' else '未审核' end As Status_ApplicationBill
- FROM ApplicationBill
- Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant">
- <Tables>
- <Table name="AllApplicationBill" />
- </Tables>
- </SearchAllApplicationBill>
-
- <SearchApplicationBillWithNo CmdType="Text" CmdText="
- SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
- FROM ApplicationBill
- LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
- LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
- Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
- LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
- Where No_ApplicationBill=@No_ApplicationBill
-
- SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee
- INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
- Join ApplicationBill On ApplicationBill.ID_ApplicationBill=ApplicationBillEmployee.ID_ApplicationBill
- Where No_ApplicationBill=@No_ApplicationBill
- ">
- <Params>
- <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" Index="0"/>
- </Params>
- <Tables>
- <Table name="ApplicationBill"/>
- <Table name="ApplicationBillEmployee"/>
- </Tables>
- </SearchApplicationBillWithNo>
- <SearchEmployeeInfo CmdType="Text" CmdText="
- Select Department.ID_Department,No_Department,Name_Department,Employee.ID_Employee,No_Employee,Name_Employee,OnStuffOne,OffStuffTwo
- From Employee
- Left Join AppUser On AppUser.ID_Employee=Employee.ID_Employee
- Left Join Department On Department.ID_Department=Employee.ID_Department
- Left Join dbo.AttendanceRuleEmployee On AttendanceRuleEmployee.ID_Employee=Employee.ID_Employee
- Left Join dbo.AttendanceRule ON AttendanceRule.ID_AttendanceRule=AttendanceRuleEmployee.ID_AttendanceRule
- Where ID_User=@ID_User
- ">
- <Params>
- <Param name="@ID_User" type="AppUser.ID_User" Index="0"/>
- </Params>
- <Tables>
- <Table name="EmployeeInfo"/>
- </Tables>
- </SearchEmployeeInfo>
- <SearchDepartment CmdType="Text" CmdText="SELECT ID_Department, Name_Department,No_Department FROM Department order by No_Department">
- <Tables>
- <Table name="Department"/>
- </Tables>
- </SearchDepartment>
- <SearchApplicant CmdType="Text" CmdText="SELECT ID_Employee, Name_Employee,No_Employee FROM Employee Where ID_Department=@ID_Department order by No_Employee ">
- <Params>
- <Param name="@ID_Department" type="AppUser.ID_Department" Index="0"/>
- </Params>
- <Tables>
- <Table name="Applicant"/>
- </Tables>
- </SearchApplicant>
- <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>
-
- <SearchApplicationType CmdType="Text" CmdText="
- IF Exists (Select * From tempdb.dbo.sysobjects Where id=Object_ID(N'tempdb.dbo.#Temp'))
- DROP TABLE #Temp
- Create Table #Temp
- ( Type nvarchar(64))
- Insert Into #Temp Values('请假')
- Insert Into #Temp Values('加班')
- Insert Into #Temp Values('出差')
- Insert Into #Temp Values('异常处理')
-
- Select * From #Temp
- ">
- <Tables>
- <Table name="ApplicationType"/>
- </Tables>
- </SearchApplicationType>
- <SearchApplicationItem CmdType="Text" CmdText="
- IF Exists (Select * From tempdb.dbo.sysobjects Where id=Object_ID(N'tempdb.dbo.#Temp'))
- DROP TABLE #Temp
- Create Table #Temp
- ( Item nvarchar(64))
- If(@Type_ApplicationBill='请假')
- Begin
- Insert Into #Temp Values('事假')
- Insert Into #Temp Values('病假')
- Insert Into #Temp Values('带薪假')
- End
- else if(@Type_ApplicationBill='加班')
- Insert Into #Temp Values('加班')
- else if(@Type_ApplicationBill='出差')
- Insert Into #Temp Values('出差')
- else if(@Type_ApplicationBill='异常处理')
- Insert Into #Temp Values('打卡异常')
- Select * From #Temp
- ">
- <Params>
- <Param name="@Type_ApplicationBill" type="ApplicationBill.Type_ApplicationBill" Index="0"/>
- </Params>
- <Tables>
- <Table name="ApplicationItem"/>
- </Tables>
- </SearchApplicationItem>
-
- <SearchApplicationBillFirst CmdType="Text" CmdText="
- Declare @ID_ApplicationBill uniqueidentifier
- Select Top 1 @ID_ApplicationBill=ID_ApplicationBill From ApplicationBill Order By No_ApplicationBill
-
- SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
- FROM ApplicationBill
- LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
- LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
- Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
- LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
- Where ID_ApplicationBill=@ID_ApplicationBill
-
- SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
- Where ID_ApplicationBill=@ID_ApplicationBill
- ">
- <Tables>
- <Table name="ApplicationBill"/>
- <Table name="ApplicationBillEmployee"/>
- </Tables>
- </SearchApplicationBillFirst>
- <SearchApplicationBillPrevious CmdType="Text" CmdText="
- Declare @ID_ApplicationBill uniqueidentifier
- SELECT Top 1 @ID_ApplicationBill=ID_ApplicationBill
- From ApplicationBill
- Where No_ApplicationBill < @No_ApplicationBill
- Order By No_ApplicationBill desc
-
- SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
- FROM ApplicationBill
- LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
- LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
- Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
- LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
- Where ID_ApplicationBill=@ID_ApplicationBill
-
- SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
- Where ID_ApplicationBill=@ID_ApplicationBill
- ">
- <Params>
- <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" Index="0"/>
- </Params>
- <Tables>
- <Table name="ApplicationBill"/>
- <Table name="ApplicationBillEmployee"/>
- </Tables>
- </SearchApplicationBillPrevious>
- <SearchApplicationBillNext CmdType="Text" CmdText="
- Declare @ID_ApplicationBill uniqueidentifier
- SELECT Top 1 @ID_ApplicationBill=ID_ApplicationBill
- From ApplicationBill
- Where No_ApplicationBill > @No_ApplicationBill
- Order By No_ApplicationBill
-
- SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
- FROM ApplicationBill
- LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
- LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
- Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
- LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
- Where ID_ApplicationBill=@ID_ApplicationBill
-
- SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
- Where ID_ApplicationBill=@ID_ApplicationBill ">
- <Params>
- <Param name="@No_ApplicationBill" type="ApplicationBill.No_ApplicationBill" Index="0"/>
- </Params>
- <Tables>
- <Table name="ApplicationBill"/>
- <Table name="ApplicationBillEmployee"/>
- </Tables>
- </SearchApplicationBillNext>
- <SearchApplicationBillLast CmdType="Text" CmdText="
- Declare @ID_ApplicationBill uniqueidentifier
- Select Top 1 @ID_ApplicationBill=ID_ApplicationBill From ApplicationBill Order By No_ApplicationBill desc
-
- SELECT ApplicationBill.*, a.Name_User AS Name_Creator,b.Name_User as LastModUserName,c.Name_User AS Name_Assessor,Department.No_Department, Department.Name_Department,No_Employee As No_Applicant,Name_Employee As Name_Applicant
- FROM ApplicationBill
- LEFT JOIN AppUser a ON a.ID_User = ApplicationBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = ApplicationBill.LastModUser_ApplicationBill
- LEFT JOIN AppUser c ON c.ID_User = ApplicationBill.ID_Assessor
- Left Join Employee On Employee.ID_Employee=ApplicationBill.ID_Applicant
- LEFT JOIN Department ON Department.ID_Department= ApplicationBill.ID_Department
- Where ID_ApplicationBill=@ID_ApplicationBill
-
- SELECT ApplicationBillEmployee.*,Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM ApplicationBillEmployee INNER JOIN Employee ON Employee.ID_Employee = ApplicationBillEmployee.ID_Employee
- Where ID_ApplicationBill=@ID_ApplicationBill
- ">
- <Tables>
- <Table name="ApplicationBill"/>
- <Table name="ApplicationBillEmployee"/>
- </Tables>
- </SearchApplicationBillLast>
- <SearchAllEmployee CmdType="Text" CmdText="SELECT Employee.No_Employee,Employee.Name_Employee FROM Employee ">
- <Tables>
- <Table name="AllEmployee" />
- </Tables>
- </SearchAllEmployee>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly=false;
- timeMake.Enabled=false;
- cbDepart.Enabled=false;
- cbApplicant.Enabled=false;
- cbApplicationType.Enabled=false;
- cbApplicationItem.Enabled=false;
- StartDate.Enabled=false;
- EndDate.Enabled=false;
- txtComment.ReadOnly=true;
- dgEmployee.ReadOnly=true;
- toolBar.EnableNew = true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- #ApplicationBill.ID_Creator=DBNull();
- #ApplicationBill.Name_Creator=DBNull();
- #ApplicationBill.LastModUser_ApplicationBill=DBNull();
- #ApplicationBill.LastModUserName=DBNull();
- #ApplicationBill.LastModDate_ApplicationBill=DBNull();
- #ApplicationBill.ID_Assessor = DBNull();
- #ApplicationBill.Name_Assessor = DBNull();
- #ApplicationBill.AssessDate_ApplicationBill = DBNull();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- tbNo.ReadOnly=true;
- timeMake.Enabled=true;
- cbDepart.Enabled=true;
- cbApplicant.Enabled=true;
- cbApplicationType.Enabled=true;
- cbApplicationItem.Enabled=true;
- StartDate.Enabled=true;
- EndDate.Enabled=true;
- txtComment.ReadOnly=false;
- dgEmployee.ReadOnly=false;
- toolBar.EnableNew = false;
- toolBar.EnableSubmit=true;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- if(Search("SearchEmployeeInfo",GetLoginUserID()))
- {
- if(!Equals(#EmployeeInfo.OnStuffOne,DBNull()))
- {
- @Now=DateTimeNow();
- #ApplicationBill.StartDate_ApplicationBill=AddDatePart(AddDatePart(@Now,"HOUR",(DatePart(#EmployeeInfo.OnStuffOne,"HOUR")-DatePart(@Now,"HOUR"))),"MINUTE",(DatePart(#EmployeeInfo.OnStuffOne,"MINUTE")-DatePart(@Now,"MINUTE")));
- #ApplicationBill.EndDate_ApplicationBill=AddDatePart(AddDatePart(@Now,"HOUR",(DatePart(#EmployeeInfo.OffStuffTwo,"HOUR")-DatePart(@Now,"HOUR"))),"MINUTE",(DatePart(#EmployeeInfo.OffStuffTwo,"MINUTE")-DatePart(@Now,"MINUTE")));
- }
- #ApplicationBill.ID_Department=#EmployeeInfo.ID_Department;
- #ApplicationBill.No_Department=#EmployeeInfo.No_Department;
- #ApplicationBill.Name_Department=#EmployeeInfo.Name_Department;
- #ApplicationBill.ID_Applicant=#EmployeeInfo.ID_Employee;
- #ApplicationBill.No_Applicant=#EmployeeInfo.No_Employee;
- #ApplicationBill.Name_Applicant=#EmployeeInfo.Name_Employee;
- }
- #ApplicationBill.ID_ApplicationBill = NewGuid();
- #ApplicationBill.ID_Creator=GetLoginUserID();
- #ApplicationBill.Name_Creator=GetCurrentUser();
- #ApplicationBill.LastModUser_ApplicationBill=DBNull();
- #ApplicationBill.LastModUserName=DBNull();
- #ApplicationBill.LastModDate_ApplicationBill=DBNull();
- #ApplicationBill.ID_Assessor = DBNull();
- #ApplicationBill.Name_Assessor = DBNull();
- #ApplicationBill.AssessDate_ApplicationBill = DBNull();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=false;
- timeMake.Enabled=false;
- cbDepart.Enabled=false;
- cbApplicant.Enabled=false;
- cbApplicationType.Enabled=false;
- cbApplicationItem.Enabled=false;
- StartDate.Enabled=false;
- EndDate.Enabled=false;
- txtComment.ReadOnly=true;
- dgEmployee.ReadOnly=true;
- toolBar.EnableSubmit=false;
- if(Equals(#ApplicationBill.ID_Assessor,DBNull()))
- {
- toolBar.EnableModify = GetRight(@Title,"修改");
- toolBar.EnableDelete = GetRight(@Title,"删除");
- toolBar.EnableAudit = GetRight(@Title,"审核");
- toolBar.EnableUnAudit = false;
- }
- else
- {
- toolBar.EnableAudit = false;
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableUnAudit = GetRight(@Title,"取消审核");
- }
- toolBar.EnablePrint = GetRight(@Title,"打印");
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly=true;
- timeMake.Enabled=true;
- cbDepart.Enabled=true;
- cbApplicant.Enabled=true;
- cbApplicationType.Enabled=true;
- cbApplicationItem.Enabled=true;
- StartDate.Enabled=true;
- EndDate.Enabled=true;
- txtComment.ReadOnly=false;
- dgEmployee.ReadOnly=false;
- toolBar.EnableNew = false;
- toolBar.EnableSubmit=true;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- #ApplicationBill.LastModUser_ApplicationBill = GetLoginUserID();
- #ApplicationBill.LastModUserName = GetCurrentUser();
- #ApplicationBill.LastModDate_ApplicationBill = DateTimeNow();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(!cbDepart.CheckSelectedItem())
- {
- MessageBox("请选择有效的任职部门!",@Title);
- cbDepart.Focus();
- return;
- }
-
- if(!cbApplicant.CheckSelectedItem())
- {
- MessageBox("请选择有效的申请人!",@Title);
- cbApplicant.Focus();
- return;
- }
- if(!cbApplicationType.CheckSelectedItem())
- {
- MessageBox("请选择有效的申请类型!",@Title);
- cbApplicant.Focus();
- return;
- }
- if(!cbApplicationItem.CheckSelectedItem())
- {
- MessageBox("请选择有效的申请明细!",@Title);
- cbApplicant.Focus();
- return;
- }
- if(StartDate.Value>=EndDate.Value)
- {
- MessageBox("开始时间不得大于等于结束时间!",@Title);
- cbApplicant.Focus();
- return;
- }
-
- if (RowCount("#ApplicationBillEmployee") == 0)
- {
- MessageBox("请假员工不能为空!",@Title);
- dgEmployee.Focus();
- return;
- }
-
- UpdateForm(false, "");
- SuspendLayout();
-
- for (@i=0;@i<RowCount("#ApplicationBillEmployee");@i=@i+1)
- {
- SetPosition("#ApplicationBillEmployee", @i);
- {
- if(Equals(#ApplicationBillEmployee.ID_Employee,GuidEmpty()))
- {
- MessageBox("请假员工不存在!",@Title);
- dgEmployee.Focus();
- dgEmployee.CurrentRowIndex = @i;
- ResumeLayout();
- return;
- }
- if (Equals(#ApplicationBillEmployee.ID_ApplicationBillEmployee,GuidEmpty()))
- #ApplicationBillEmployee.ID_ApplicationBillEmployee = NewGuid();
- #ApplicationBillEmployee.ID_ApplicationBill =#ApplicationBill.ID_ApplicationBill;
- }
-
- }
-
- ResumeLayout();
- if(@Status==1)
- {
- New();
- }
- if(@Status == 3)
- {
- #ApplicationBill.LastModDate_ApplicationBill=DateTimeNow();
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|