123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmRegionalLeader">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @SetFlag=1;
- @Title="业务区域设定";
- GetSchema();
- ChangeMode("Search");
- RecordHistoryRead("FrmRegionalLeader");
- ]]>
- </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="RegionalLeader.No_RegionalLeader">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchRegionalLeaderWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- if(GetRight(@Title,"新增"))
- ChangeMode("New");
- else
- MessageBox("您没有新增区域业务负责人的权限!",@Title);
- }
- }
- else
- {
- MessageBox("请输入区域编号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- @Temp = ShowSearchBox("RegionalLeaderSearch","INFOMATION",tbNo.CValue);
- if(@Temp != StringEmpty())
- {
- tbNo.CValue = @Temp;
- UpdateForm(false, "");
- if(Search("SearchRegionalLeaderWithNo",tbNo.CValue))
- {
- ChangeMode("View");
- }
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtName" DataSource="RegionalLeader.Name_RegionalLeader"/>
- <IKDataGridEx name="dgEmployee" DataSource="Principal" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Principal.No_Employee" >
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- @SetFlag=1;
- @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee);
- if(@temp != "")
- {
- ResumeColumnEvent("#Principal.No_Employee");
- #Principal.No_Employee = @temp;
- ClearColumnEvent();
- }
- </Click>
- <SetFlagBeforeClick>
- @SetFlag=0;
- </SetFlagBeforeClick>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="1" DataSource="Principal.Name_Employee" />
- <DataColumn Index="2" DataSource="Principal.Comment_Principal" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchRegionalLeaderFirst", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchRegionalLeaderPrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchRegionalLeaderNext", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchRegionalLeaderLast", tbNo.CValue))
- {
- 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>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="Principal">
- <Events>
- <ColumnsChanged>
- <No_Employee>
- if(@SetFlag==0)
- {
- return;
- }
- if(Search("GetEmployeeNameByNo",#Principal.No_Employee))
- {
- #Principal.Name_Employee=#Employee.Name_Employee;
- #Principal.ID_Employee=#Employee.ID_Employee;
- if(!Equals(#Employee.SuspendDate_Employee,DBNull()))
- MessageBox("该员工已停用!",@Title);
- }
- else
- {
- MessageBox("该员工不存在!",@Title);
- #Principal.Name_Employee="";
- #Principal.ID_Employee=GuidEmpty();
- @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee);
- if(@temp != "")
- {
- ResumeColumnEvent("#Principal.No_Employee");
- #Principal.No_Employee = @temp;
- ClearColumnEvent();
- }
- }
- </No_Employee>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_RegionalLeader" LockNO="No_RegionalLeader" LockSearchFunction="SearchRegionalLeaderWithNo"/>
- <ChildForms>
- <ChildForm name="RegionalLeaderSearch" DataSource="RegionalLeader" SearchFunction="SearchAllRegionalLeader" SearchFunctionCondition="SearchRegionalLeaderCondition" SearchFunctionByNo="SearchRegionalLeaderWithNo" MappingName="区域">
- <DataColumn Index="0" MappingName="#RegionalLeader.No_RegionalLeader" HeaderText="区域编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#RegionalLeader.Name_RegionalLeader" HeaderText="区域名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="EmployeeSearch" DataSource="Employee" SearchFunction="SearchAllEmployee" SearchFunctionByNo="SearchEmployeeWithNo" 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>
- </ChildForms>
- <FormatString>
- <Format name="SearchRegionalLeaderCondition">
- if(GetRight("区域业务负责人","全权查看"))
- {
- FormatString("");
- }
- </Format>
- </FormatString>
- </Client>
- <Server>
- <Tables>
- <Table name="RegionalLeader" Type="Parent">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 RegionalLeader.* FROM RegionalLeader"/>
- <New CmdType="Text" CmdText="INSERT INTO RegionalLeader
- (ID_RegionalLeader,No_RegionalLeader,Name_RegionalLeader)
- VALUES
- (@ID_RegionalLeader,@No_RegionalLeader,@Name_RegionalLeader)
- ">
- <Params>
- <Param name="@ID_RegionalLeader" type="RegionalLeader.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
- <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" sourceColumn="No_RegionalLeader" />
- <Param name="@Name_RegionalLeader" type="RegionalLeader.Name_RegionalLeader" sourceColumn="Name_RegionalLeader" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE RegionalLeader SET Name_RegionalLeader = @Name_RegionalLeader
- WHERE ID_RegionalLeader = @ID_RegionalLeader">
- <Params>
- <Param name="@ID_RegionalLeader" type="RegionalLeader.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
- <Param name="@Name_RegionalLeader" type="RegionalLeader.Name_RegionalLeader" sourceColumn="Name_RegionalLeader" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Principal WHERE ID_RegionalLeader = @ID_RegionalLeader
- DELETE RegionalLeader WHERE ID_RegionalLeader = @ID_RegionalLeader
- ">
- <Params>
- <Param name="@ID_RegionalLeader" type="RegionalLeader.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该区域业务负责人已被引用,删除失败!"/>
- <UNIQUEErrorReport ErrorMessage="该区域业务负责人编号已存在,提交失败!"/>
- </Table>
- <Table name="Principal" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 Principal.*,Employee.Name_Employee AS Name_Employee
- ,Employee.No_Employee AS No_Employee,Employee.Comment_Employee as Comment_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- " />
- <New CmdType="Text" CmdText=" INSERT INTO Principal (ID_Principal,ID_Person,ID_Employee,IsMain_Principal
- ,Comment_Principal,ID_RegionalLeader)
- VALUES(@ID_Principal,@ID_Person,@ID_Employee,@IsMain_Principal
- ,@Comment_Principal,@ID_RegionalLeader)
- " >
- <Params>
- <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
- <Param name="@ID_Person" type="Principal.ID_Person" sourceColumn="ID_Person" />
- <Param name="@ID_Employee" type="Principal.ID_Employee" sourceColumn="ID_Employee" />
- <Param name="@IsMain_Principal" type="Principal.IsMain_Principal" sourceColumn="IsMain_Principal" />
- <Param name="@Comment_Principal" type="Principal.Comment_Principal" sourceColumn="Comment_Principal" />
- <Param name="@ID_RegionalLeader" type="Principal.ID_RegionalLeader" sourceColumn="ID_RegionalLeader" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Principal SET ID_Employee = @ID_Employee,IsMain_Principal = @IsMain_Principal,Comment_Principal = @Comment_Principal
- WHERE ID_Principal = @ID_Principal">
- <Params>
- <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
- <Param name="@ID_Employee" type="Principal.ID_Employee" sourceColumn="ID_Employee" />
- <Param name="@IsMain_Principal" type="Principal.IsMain_Principal" sourceColumn="IsMain_Principal" />
- <Param name="@Comment_Principal" type="Principal.Comment_Principal" sourceColumn="Comment_Principal" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Principal WHERE ID_Principal = @ID_Principal">
- <Params>
- <Param name="@ID_Principal" type="Principal.ID_Principal" sourceColumn="ID_Principal" />
- </Params>
- </Delete>
- </Table>
- <Table name="Employee" Type="Other">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Employee" />
- </Table>
- </Tables>
- <Search>
- <SearchAllRegionalLeader CmdType="Text" CmdText="select * from RegionalLeader
- ">
- <Tables>
- <Table name="AllRegionalLeader" />
- </Tables>
- </SearchAllRegionalLeader>
- <SearchRegionalLeaderWithNo CmdType="Text" CmdText="DECLARE @ID_RegionalLeader uniqueidentifier
- SELECT RegionalLeader.* FROM RegionalLeader
- Where No_RegionalLeader=@No_RegionalLeader
- SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
- FROM RegionalLeader WHERE RegionalLeader.No_RegionalLeader = @No_RegionalLeader
- SELECT Principal.*,Employee.Name_Employee AS Name_Employee
- ,Employee.No_Employee AS No_Employee,Employee.Comment_Employee AS Comment_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
- ">
- <Params>
- <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
- </Params>
- <Tables>
- <Table name="RegionalLeader" />
- <Table name="Principal"/>
- </Tables>
- </SearchRegionalLeaderWithNo>
- <SearchRegionalLeaderNext CmdType="Text" CmdText="DECLARE @ID_RegionalLeader uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_RegionalLeader
- SELECT TOP 1 @NextNo = RegionalLeader.No_RegionalLeader
- FROM RegionalLeader
- WHERE RegionalLeader.No_RegionalLeader > @No_RegionalLeader
- ORDER BY RegionalLeader.No_RegionalLeader
- SELECT RegionalLeader.* FROM RegionalLeader
- Where No_RegionalLeader=@NextNo
- SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
- FROM RegionalLeader
- WHERE RegionalLeader.No_RegionalLeader = @NextNo
- SELECT Principal.*,Employee.Name_Employee AS Name_Employee
- ,Employee.No_Employee AS No_Employee,Employee.Comment_Employee AS Comment_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
- ">
- <Params>
- <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
- </Params>
- <Tables>
- <Table name="RegionalLeader" />
- <Table name="Principal"/>
- </Tables>
- </SearchRegionalLeaderNext>
- <SearchRegionalLeaderPrevious CmdType="Text" CmdText="DECLARE @ID_RegionalLeader uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_RegionalLeader
- SELECT TOP 1 @NextNo = RegionalLeader.No_RegionalLeader
- FROM RegionalLeader
- WHERE RegionalLeader.No_RegionalLeader < @No_RegionalLeader
- ORDER BY RegionalLeader.No_RegionalLeader Desc
- SELECT RegionalLeader.* FROM RegionalLeader
- where RegionalLeader.No_RegionalLeader = @NextNo
- SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
- FROM RegionalLeader WHERE RegionalLeader.No_RegionalLeader = @NextNo
- SELECT Principal.*,Employee.Name_Employee AS Name_Employee,Employee.No_Employee AS No_Employee ,Employee.Comment_Employee AS Comment_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
- ">
- <Params>
- <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
- </Params>
- <Tables>
- <Table name="RegionalLeader" />
- <Table name="Principal"/>
- </Tables>
- </SearchRegionalLeaderPrevious>
- <SearchRegionalLeaderFirst CmdType="Text" CmdText=" DECLARE @ID_RegionalLeader uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_RegionalLeader
- SELECT TOP 1 @NextNo = RegionalLeader.No_RegionalLeader
- FROM RegionalLeader
- ORDER BY RegionalLeader.No_RegionalLeader
- SELECT RegionalLeader.* FROM RegionalLeader
- Where RegionalLeader.No_RegionalLeader=@NextNo
-
- SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
- FROM RegionalLeader
- WHERE RegionalLeader.No_RegionalLeader = @NextNo
- SELECT Principal.*, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee
- ,Employee.Comment_Employee AS Comment_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
- ">
- <Params>
- <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
- </Params>
- <Tables>
- <Table name="RegionalLeader" />
- <Table name="Principal"/>
- </Tables>
- </SearchRegionalLeaderFirst>
- <SearchRegionalLeaderLast CmdType="Text" CmdText="DECLARE @ID_RegionalLeader uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_RegionalLeader
- SELECT TOP 1 @NextNo = RegionalLeader.No_RegionalLeader
- FROM RegionalLeader
- ORDER BY RegionalLeader.No_RegionalLeader DESC
- SELECT RegionalLeader.* FROM RegionalLeader
- Where RegionalLeader.No_RegionalLeader=@NextNo
-
- SELECT @ID_RegionalLeader = RegionalLeader.ID_RegionalLeader
- FROM RegionalLeader
- WHERE RegionalLeader.No_RegionalLeader = @NextNo
- SELECT Principal.*, Employee.Name_Employee AS Name_Employee
- ,Employee.No_Employee AS No_Employee ,Employee.Comment_Employee AS Comment_Employee
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- WHERE Principal.ID_RegionalLeader = @ID_RegionalLeader
- ">
- <Params>
- <Param name="@No_RegionalLeader" type="RegionalLeader.No_RegionalLeader" Index="0" />
- </Params>
- <Tables>
- <Table name="RegionalLeader" />
- <Table name="Principal"/>
- </Tables>
- </SearchRegionalLeaderLast>
- <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>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly=false;
- txtName.ReadOnly=true;
- dgEmployee.ReadOnly=true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- tbNo.ReadOnly=true;
- txtName.ReadOnly=false;
- dgEmployee.ReadOnly=false;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- #RegionalLeader.No_RegionalLeader=tbNo.CValue;
- #RegionalLeader.ID_RegionalLeader=NewGuid();
- UpdateForm(true, "");
- txtName.Focus();
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=false;
- txtName.ReadOnly=true;
- dgEmployee.ReadOnly=true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=GetRight(@Title,"打印");
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly=true;
- txtName.ReadOnly=false;
- dgEmployee.ReadOnly=false;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=false;
- UpdateForm(true, "");
- txtName.Focus();
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(txtName.CValue=="")
- {
- MessageBox("请输入区域名称!",@Title);
- txtName.Focus();
- return;
- }
- if(dgEmployee.RowCount==0)
- {
- MessageBox("请输入员工编号!",@Title);
- return;
- }
- UpdateForm(false, "");
- if(@Status==1)
- {
- SuspendLayout();
- for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Principal", @i);
- if(Equals(#Principal.ID_Principal,GuidEmpty()))
- #Principal.ID_Principal = NewGuid();
- if(Equals(#Principal.ID_Employee, GuidEmpty()))
- {
- dgEmployee.CurrentRowIndex=@i;
- tcOperMan.SelectedIndex=0;
- MessageBox("该员工不存在!",@Title);
- ResumeLayout();
- return;
- }
- #Principal.ID_RegionalLeader = #RegionalLeader.ID_RegionalLeader;
- }
- ResumeLayout();
- New();
- }
- else if(@Status == 3)
- {
- SuspendLayout();
- for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Principal", @i);
- if(Equals(#Principal.ID_Principal,GuidEmpty()))
- #Principal.ID_Principal = NewGuid();
- if(Equals(#Principal.ID_Employee, GuidEmpty()))
- {
- dgEmployee.CurrentRowIndex=@i;
- tcOperMan.SelectedIndex=0;
- MessageBox("该员工不存在!",@Title);
- ResumeLayout();
- return;
- }
- #Principal.ID_RegionalLeader = #RegionalLeader.ID_RegionalLeader;
- }
- ResumeLayout();
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|