123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmSupplier">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @SetFlag=1;
- @HaveSearchSupplierList=false;
- @Title="供应商基本资料";
- GetSchema();
- ChangeMode("Search");
- Search("SearchDepartment");
- Search("SearchDuty");
- Search("SearchIsMain");
- ]]>
- </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="Supplier.No_Supplier">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchSupplierWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- if(GetRight(@Title,"新增"))
- ChangeMode("New");
- else
- MessageBox("您没有新增供应商基本资料的权限!",@Title);
- }
- }
- else
- {
- MessageBox("请输入供应商编号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- @Temp = ShowSearchBox("SupplierSearch","INFOMATION",tbNo.CValue);
- if(@Temp != StringEmpty())
- {
- tbNo.CValue = @Temp;
- UpdateForm(false, "");
- if(Search("SearchSupplierWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtShortName" DataSource="Supplier.ShortName_Supplier">
- <Events>
- <Enter>
- if( txtName.CValue == "")
- {
- txtName.CValue = txtShortName.CValue;
- txtName.Focus();
- }
- </Enter>
- </Events>
- </IKTextBox>
- <IKTextBox name="txtName" DataSource="Supplier.Name_Supplier"/>
- <IKTextBox name="txtRegistedAddress" DataSource="Supplier.RegistedAddress_Supplier"/>
- <IKCountryCombo name="cbCountry" DataSource="Supplier.Country_Supplier"/>
- <IKTextBox name="txtPostalCode" DataSource="Supplier.PostalCode_Supplier"/>
- <IKPhoneControl name="pcPhone" DataSource="Telephone" ValueMember="ID_Telephone" DisplayMember="Name_Telephone" NoMember="No_Telephone" FocusMember="Focus_Telephone">
- </IKPhoneControl>
- <IKPhoneControl name="pcFax" DataSource="Fax" ValueMember="ID_Fax" DisplayMember="Name_Fax" NoMember="No_Fax" FocusMember="Focus_Fax">
- </IKPhoneControl>
- <IKDateTimeText name="dttCreateDate" DataSource="Supplier.CreateDate_Supplier"/>
- <IKTextBox name="txtCreator" DataSource="Supplier.CreatorName_Supplier"/><!--Supplier.CreatorName_Supplier isn't DB's Field-->
- <IKDateTimePause name="dtpIsSuspend" DataSource="Supplier.SuspendDate_Supplier"/>
- <IKTextBox name="txtComment" DataSource="Supplier.Comment_Supplier"/>
- <IKTextBox name="txtMender" DataSource="Supplier.LastModUser_SupplierName"/>
- <IKDateTimeText name="dttMendDate" DataSource="Supplier.LastModDate_Supplier"/>
-
- <IKDataGridEx name="dtLinkMan" DataSource="Linkman" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Linkman.Name_Linkman" />
- <DataColumn Index="1" DataSource="Linkman.Department_Linkman">
- <IKDataGridComboBoxColumn DisplaySourceEx="Linkman.Department_Linkman" ValueSourceEx="Linkman.Department_Linkman" DataSourceEx="Department" DisplayMemberEx="Result" ValueMemberEx="Result">
- <Events>
- <Reload>
- Search("SearchDepartment");
- SetDataGridColumnDataSource(1,"dtLinkMan");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="2" DataSource="Linkman.Duty_Linkman" >
- <IKDataGridComboBoxColumn DisplaySourceEx="Linkman.Duty_Linkman" ValueSourceEx="Linkman.Duty_Linkman" DataSourceEx="Duty" DisplayMemberEx="Result" ValueMemberEx="Result">
- <Events>
- <Reload>
- Search("SearchDuty");
- SetDataGridColumnDataSource(2,"dtLinkMan");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="3" DataSource="Linkman.Tel_Linkman" />
- <DataColumn Index="4" DataSource="Linkman.Fax_Linkman" />
- <DataColumn Index="5" DataSource="Linkman.Mobile_Linkman" />
- <DataColumn Index="6" DataSource="Linkman.Email_Linkman" />
- <DataColumn Index="7" DataSource="Linkman.IsMainDis_Linkman" >
- <IKDataGridComboBoxColumn DisplaySourceEx="Linkman.IsMainDis_Linkman" ValueSourceEx="Linkman.IsMain_Linkman" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
- <Events>
- <Reload>
- Search("SearchIsMain");
- SetDataGridColumnDataSource(7,"dtLinkMan");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="8" DataSource="Linkman.Comment_Linkman" />
- </IKDataGridEx>
- <IKDataGridEx name="dtPrinciple" 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.IsMainStr_Principal" >
- <IKDataGridComboBoxColumn DisplaySourceEx="Principal.IsMainStr_Principal" ValueSourceEx="Principal.IsMain_Principal" DataSourceEx="IsMain" DisplayMemberEx="Result" ValueMemberEx="Value">
- <Events>
- <Reload>
- Search("SearchIsMain");
- SetDataGridColumnDataSource(2,"dtPrinciple");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="3" DataSource="Principal.Comment_Principal" />
- </IKDataGridEx>
- <IKDataGridEx name="dgSupplier" DataSource="SupplierList" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="SupplierList.No_Supplier" />
- <DataColumn Index="1" DataSource="SupplierList.ShortName_Supplier" />
- <Events>
- <RowHeaderDoubleClick>
- if(Search("SearchSupplierWithNo",#SupplierList.No_Supplier))
- {
- ChangeMode("View");
- }
- </RowHeaderDoubleClick>
- </Events>
- </IKDataGridEx>
- <IKCheckBox name="ckDisplay" DataSource="Supplier.IsDisplay" >
- <Events>
- <CheckedChanged>
- if(ckDisplay.Checked)
- Search("SearchAllSupplierList");
- else
- Search("SearchSupplierList");
- </CheckedChanged>
- </Events>
- </IKCheckBox>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- <!--if(CreateThread("Search","SearchSupplierFirst", tbNo.CValue))
- {
- ChangeMode("View");
- }
- MessageBox("thread ok");-->
- if(Search("SearchSupplierFirst", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchSupplierPrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchSupplierNext", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchSupplierLast", 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>
- #Supplier.CountryName = cbCountry.Text;
- PrintReport();
- </ClickPrint>
- <ClickAudit>
- ;
- </ClickAudit>
- <ClickUnAudit>
- ;
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- if(toolBar.ExpandForm==true)
- {
- pnRight.Visible=true;<!--PanelRight is not existed-->
- if(!@HaveSearchSupplierList)
- {
- Search("SearchSupplierList");
- @HaveSearchSupplierList=true;
- }
- }
- else
- {
- pnRight.Visible=false;
- }
- </ClickExpand>
- </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>
- <IsMain_Principal>
- ;<!--SetDefaultColoumn("Principal.IsMain_Principal");-->
- </IsMain_Principal>
- </ColumnsChanged>
- </Events>
- </Table>
- <Table name="Linkman">
- <Events>
- <ColumnsChanged>
- <IsMain_Linkman>
- ;<!--SetDefaultColoumn("Linkman.IsMain_Linkman");-->
- </IsMain_Linkman>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_Supplier" LockNO="No_Supplier" LockSearchFunction="SearchSupplierWithNo"/>
- <ChildForms>
- <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="SearchSupplierWithNo" MappingName="供应商">
- <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" 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>
- </Client>
- <Server>
- <Tables>
- <Table name="Supplier" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 Supplier.*,convert(nvarchar(64),'') as CountryName,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName,Convert(bit,1) As IsDisplay
- FROM Supplier
- LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier" />
- <New CmdType="Text" CmdText=" INSERT INTO Supplier (ID_Supplier,No_Supplier,ShortName_Supplier,Name_Supplier,RegistedAddress_Supplier,Country_Supplier,PostalCode_Supplier,CreateDate_Supplier,ID_Creator,Comment_Supplier,SuspendDate_Supplier,LastModUser_Supplier,LastModDate_Supplier)
- VALUES(@ID_Supplier,@No_Supplier,@ShortName_Supplier,@Name_Supplier,@RegistedAddress_Supplier,@Country_Supplier,@PostalCode_Supplier,@CreateDate_Supplier,@ID_Creator,@Comment_Supplier,@SuspendDate_Supplier,@LastModUser_Supplier,@LastModDate_Supplier)" >
- <Params>
- <Param name="@ID_Supplier" type="Supplier.ID_Supplier" sourceColumn="ID_Supplier" />
- <Param name="@No_Supplier" type="Supplier.No_Supplier" sourceColumn="No_Supplier" />
- <Param name="@ShortName_Supplier" type="Supplier.ShortName_Supplier" sourceColumn="ShortName_Supplier" />
- <Param name="@Name_Supplier" type="Supplier.Name_Supplier" sourceColumn="Name_Supplier" />
- <Param name="@RegistedAddress_Supplier" type="Supplier.RegistedAddress_Supplier" sourceColumn="RegistedAddress_Supplier" />
- <Param name="@Country_Supplier" type="Supplier.Country_Supplier" sourceColumn="Country_Supplier" />
- <Param name="@PostalCode_Supplier" type="Supplier.PostalCode_Supplier" sourceColumn="PostalCode_Supplier" />
- <Param name="@CreateDate_Supplier" type="Supplier.CreateDate_Supplier" sourceColumn="CreateDate_Supplier" />
- <Param name="@ID_Creator" type="Supplier.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@Comment_Supplier" type="Supplier.Comment_Supplier" sourceColumn="Comment_Supplier" />
- <Param name="@SuspendDate_Supplier" type="Supplier.SuspendDate_Supplier" sourceColumn="SuspendDate_Supplier" />
- <Param name="@LastModUser_Supplier" type="Supplier.LastModUser_Supplier" sourceColumn="LastModUser_Supplier" />
- <Param name="@LastModDate_Supplier" type="Supplier.LastModDate_Supplier" sourceColumn="LastModDate_Supplier" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Supplier SET ShortName_Supplier = @ShortName_Supplier,Name_Supplier = @Name_Supplier,RegistedAddress_Supplier = @RegistedAddress_Supplier,Country_Supplier = @Country_Supplier,PostalCode_Supplier = @PostalCode_Supplier,ID_Creator = @ID_Creator,Comment_Supplier = @Comment_Supplier,SuspendDate_Supplier = @SuspendDate_Supplier,LastModUser_Supplier=@LastModUser_Supplier,LastModDate_Supplier=@LastModDate_Supplier WHERE ID_Supplier = @ID_Supplier">
- <Params>
- <Param name="@ID_Supplier" type="Supplier.ID_Supplier" sourceColumn="ID_Supplier" />
- <!--<Param name="@No_Supplier" type="Supplier.No_Supplier" sourceColumn="No_Supplier" />-->
- <Param name="@ShortName_Supplier" type="Supplier.ShortName_Supplier" sourceColumn="ShortName_Supplier" />
- <Param name="@Name_Supplier" type="Supplier.Name_Supplier" sourceColumn="Name_Supplier" />
- <Param name="@RegistedAddress_Supplier" type="Supplier.RegistedAddress_Supplier" sourceColumn="RegistedAddress_Supplier" />
- <Param name="@Country_Supplier" type="Supplier.Country_Supplier" sourceColumn="Country_Supplier" />
- <Param name="@PostalCode_Supplier" type="Supplier.PostalCode_Supplier" sourceColumn="PostalCode_Supplier" />
- <Param name="@CreateDate_Supplier" type="Supplier.CreateDate_Supplier" sourceColumn="CreateDate_Supplier" />
- <Param name="@ID_Creator" type="Supplier.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@Comment_Supplier" type="Supplier.Comment_Supplier" sourceColumn="Comment_Supplier" />
- <Param name="@SuspendDate_Supplier" type="Supplier.SuspendDate_Supplier" sourceColumn="SuspendDate_Supplier" />
- <Param name="@LastModUser_Supplier" type="Supplier.LastModUser_Supplier" sourceColumn="LastModUser_Supplier" />
- <Param name="@LastModDate_Supplier" type="Supplier.LastModDate_Supplier" sourceColumn="LastModDate_Supplier" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Supplier WHERE ID_Supplier = @ID_Supplier
- DELETE Fax WHERE ID_Person = @ID_Supplier
- DELETE Telephone WHERE ID_Person = @ID_Supplier
- DELETE Linkman WHERE ID_Person = @ID_Supplier
- DELETE Principal WHERE ID_Person = @ID_Supplier">
- <Params>
- <Param name="@ID_Supplier" type="Supplier.ID_Supplier" sourceColumn="ID_Supplier" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该供应商已被引用,删除失败!"/>
- <UNIQUEErrorReport ErrorMessage="该供应商编号已存在,提交失败!"/>
- </Table>
- <Table name="Linkman" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 '' As IsMainDis_Linkman,Linkman.* FROM Linkman" />
- <New CmdType="Text" CmdText=" INSERT INTO Linkman ( ID_Linkman,ID_Person,Name_Linkman,Department_Linkman,Duty_Linkman,Tel_Linkman,Fax_Linkman,Mobile_Linkman,Email_Linkman,IsMain_Linkman,Comment_Linkman)
- VALUES(@ID_Linkman,@ID_Person,@Name_Linkman,@Department_Linkman,@Duty_Linkman,@Tel_Linkman,@Fax_Linkman,@Mobile_Linkman,@Email_Linkman,@IsMain_Linkman,@Comment_Linkman)">
- <Params>
- <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
- <Param name="@ID_Person" type="Linkman.ID_Person" sourceColumn="ID_Person" />
- <Param name="@Name_Linkman" type="Linkman.Name_Linkman" sourceColumn="Name_Linkman" />
- <Param name="@Department_Linkman" type="Linkman.Department_Linkman" sourceColumn="Department_Linkman" />
- <Param name="@Duty_Linkman" type="Linkman.Duty_Linkman" sourceColumn="Duty_Linkman" />
- <Param name="@Tel_Linkman" type="Linkman.Tel_Linkman" sourceColumn="Tel_Linkman" />
- <Param name="@Fax_Linkman" type="Linkman.Fax_Linkman" sourceColumn="Fax_Linkman" />
- <Param name="@Mobile_Linkman" type="Linkman.Mobile_Linkman" sourceColumn="Mobile_Linkman" />
- <Param name="@Email_Linkman" type="Linkman.Email_Linkman" sourceColumn="Email_Linkman" />
- <Param name="@IsMain_Linkman" type="Linkman.IsMain_Linkman" sourceColumn="IsMain_Linkman" />
- <Param name="@Comment_Linkman" type="Linkman.Comment_Linkman" sourceColumn="Comment_Linkman" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Linkman SET Name_Linkman = @Name_Linkman, Department_Linkman = @Department_Linkman, Duty_Linkman = @Duty_Linkman, Tel_Linkman = @Tel_Linkman, Fax_Linkman = @Fax_Linkman ,Mobile_Linkman = @Mobile_Linkman, Email_Linkman = @Email_Linkman, IsMain_Linkman = @IsMain_Linkman, Comment_Linkman = @Comment_Linkman
- WHERE ID_Linkman = @ID_Linkman">
- <Params>
- <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
- <Param name="@Name_Linkman" type="Linkman.Name_Linkman" sourceColumn="Name_Linkman" />
- <Param name="@Department_Linkman" type="Linkman.Department_Linkman" sourceColumn="Department_Linkman" />
- <Param name="@Duty_Linkman" type="Linkman.Duty_Linkman" sourceColumn="Duty_Linkman" />
- <Param name="@Tel_Linkman" type="Linkman.Tel_Linkman" sourceColumn="Tel_Linkman" />
- <Param name="@Fax_Linkman" type="Linkman.Fax_Linkman" sourceColumn="Fax_Linkman" />
- <Param name="@Mobile_Linkman" type="Linkman.Mobile_Linkman" sourceColumn="Mobile_Linkman" />
- <Param name="@Email_Linkman" type="Linkman.Email_Linkman" sourceColumn="Email_Linkman" />
- <Param name="@IsMain_Linkman" type="Linkman.IsMain_Linkman" sourceColumn="IsMain_Linkman" />
- <Param name="@Comment_Linkman" type="Linkman.Comment_Linkman" sourceColumn="Comment_Linkman" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Linkman WHERE ID_Linkman=@ID_Linkman">
- <Params>
- <Param name="@ID_Linkman" type="Linkman.ID_Linkman" sourceColumn="ID_Linkman" />
- </Params>
- </Delete>
- </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,'' as IsMainStr_Principal 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)
- VALUES(@ID_Principal,@ID_Person,@ID_Employee,@IsMain_Principal,@Comment_Principal)" >
- <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" />
- </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="Fax" Type="Association">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Fax" />
- <New CmdType="Text" CmdText=" INSERT INTO Fax (ID_Fax,ID_Person,Name_Fax,No_Fax,Focus_Fax)
- VALUES(@ID_Fax,@ID_Person,@Name_Fax,@No_Fax,@Focus_Fax)">
- <Params>
- <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
- <Param name="@ID_Person" type="Fax.ID_Person" sourceColumn="ID_Person" />
- <Param name="@Name_Fax" type="Fax.Name_Fax" sourceColumn="Name_Fax" />
- <Param name="@No_Fax" type="Fax.No_Fax" sourceColumn="No_Fax" />
- <Param name="@Focus_Fax" type="Fax.Focus_Fax" sourceColumn="Focus_Fax" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Fax SET Name_Fax=@Name_Fax,No_Fax=@No_Fax,Focus_Fax=@Focus_Fax WHERE ID_Fax=@ID_Fax">
- <Params>
- <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
- <Param name="@Name_Fax" type="Fax.Name_Fax" sourceColumn="Name_Fax" />
- <Param name="@No_Fax" type="Fax.No_Fax" sourceColumn="No_Fax" />
- <Param name="@Focus_Fax" type="Fax.Focus_Fax" sourceColumn="Focus_Fax" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Fax WHERE ID_Fax=@ID_Fax">
- <Params>
- <Param name="@ID_Fax" type="Fax.ID_Fax" sourceColumn="ID_Fax" />
- </Params>
- </Delete>
- <UNIQUEErrorReport ErrorMessage="传真名称或传真号码已经存在!"/>
- </Table>
- <Table name="Telephone" Type="Association">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Telephone" />
- <New CmdType="Text" CmdText=" INSERT INTO Telephone (ID_Telephone,ID_Person,Name_Telephone,No_Telephone,Focus_Telephone)
- VALUES(@ID_Telephone,@ID_Person,@Name_Telephone,@No_Telephone,@Focus_Telephone)">
- <Params>
- <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
- <Param name="@ID_Person" type="Telephone.ID_Person" sourceColumn="ID_Person" />
- <Param name="@Name_Telephone" type="Telephone.Name_Telephone" sourceColumn="Name_Telephone" />
- <Param name="@No_Telephone" type="Telephone.No_Telephone" sourceColumn="No_Telephone" />
- <Param name="@Focus_Telephone" type="Telephone.Focus_Telephone" sourceColumn="Focus_Telephone" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Telephone SET Name_Telephone=@Name_Telephone,No_Telephone=@No_Telephone,Focus_Telephone=@Focus_Telephone WHERE ID_Telephone=@ID_Telephone">
- <Params>
- <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
- <Param name="@Name_Telephone" type="Telephone.Name_Telephone" sourceColumn="Name_Telephone" />
- <Param name="@No_Telephone" type="Telephone.No_Telephone" sourceColumn="No_Telephone" />
- <Param name="@Focus_Telephone" type="Telephone.Focus_Telephone" sourceColumn="Focus_Telephone" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE Telephone WHERE ID_Telephone=@ID_Telephone">
- <Params>
- <Param name="@ID_Telephone" type="Telephone.ID_Telephone" sourceColumn="ID_Telephone" />
- </Params>
- </Delete>
- <UNIQUEErrorReport ErrorMessage="电话名称或电话号码已经存在!"/>
- </Table>
- <Table name="Employee" Type="Other">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 * FROM Employee" />
- </Table>
- <Table name="SupplierList" Type="Other">
- <GetSchema CmdType="Text" CmdText="SELECT top 0 Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier" />
- </Table>
- </Tables>
- <Search>
- <SearchDefaultPhone CmdType="Text" CmdText="Select newid() as ID_Telephone, CAST('{00000000-0000-0000-0000-000000000000}' AS uniqueidentifier) as ID_Person, CAST(Name_TypeDef AS NVARCHAR(64))As Name_Telephone, CAST(''AS NVARCHAR(128)) As No_Telephone, CAST(0 AS bit) As Focus_Telephone From TypeDef Where Type_TypeDef = 24">
- <Tables>
- <Table name="DefaultTelephone" />
- </Tables>
- </SearchDefaultPhone>
- <SearchDefaultFax CmdType="Text" CmdText="Select newid() as ID_Fax, CAST('{00000000-0000-0000-0000-000000000000}' AS uniqueidentifier) as ID_Person, CAST(Name_TypeDef AS NVARCHAR(64)) As Name_Fax, CAST(''AS NVARCHAR(128)) As No_Fax, CAST(0 AS bit) As Focus_Fax From TypeDef Where Type_TypeDef = 25 order by No_TypeDef">
- <Tables>
- <Table name="DefaultFax" />
- </Tables>
- </SearchDefaultFax>
- <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
- <Tables>
- <Table name="AllSupplier" />
- </Tables>
- </SearchAllSupplier>
- <SearchSupplierList CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier Where SuspendDate_Supplier Is Null">
- <Tables>
- <Table name="SupplierList" />
- </Tables>
- </SearchSupplierList>
- <SearchAllSupplierList CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
- <Tables>
- <Table name="SupplierList" />
- </Tables>
- </SearchAllSupplierList>
- <SearchDepartment CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 17">
- <Tables>
- <Table name="Department" />
- </Tables>
- </SearchDepartment>
- <SearchDuty CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Result FROM TypeDef WHERE Type_TypeDef = 18">
- <Tables>
- <Table name="Duty" />
- </Tables>
- </SearchDuty>
- <SearchIsMain CmdType="Text" CmdText=" Create Table #IsMain
- (
- Result nvarchar(64),
- Value bit
- )
- Insert into #IsMain Values('是',1)
- Insert into #IsMain Values('否',0)
- Select * From #IsMain
- Drop Table #IsMain">
- <Tables>
- <Table name="IsMain" />
- </Tables>
- </SearchIsMain>
- <SearchSupplierWithNo CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
- SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
- LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
- where Supplier.No_Supplier = @No_Supplier
- SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @No_Supplier
- SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
- SELECT * from Fax where Fax.ID_Person = @ID_Supplier
- SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
- SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
- <Params>
- <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
- </Params>
- <Tables>
- <Table name="Supplier" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- </Tables>
- </SearchSupplierWithNo>
- <SearchSupplierFirst CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Supplier
- SELECT TOP 1 @NextNo = Supplier.No_Supplier FROM Supplier ORDER BY Supplier.No_Supplier
- SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
- LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
- where Supplier.No_Supplier = @NextNo
- SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @NextNo
- SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
- SELECT * from Fax where Fax.ID_Person = @ID_Supplier
- SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
- SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
- <Params>
- <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
- </Params>
- <Tables>
- <Table name="Supplier" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- </Tables>
- </SearchSupplierFirst>
- <SearchSupplierPrevious CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Supplier
- SELECT TOP 1 @NextNo = Supplier.No_Supplier FROM Supplier WHERE Supplier.No_Supplier < @No_Supplier ORDER BY Supplier.No_Supplier Desc
- SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
- LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
- where Supplier.No_Supplier = @NextNo
- SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @NextNo
- SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
- SELECT * from Fax where Fax.ID_Person = @ID_Supplier
- SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
- SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
- <Params>
- <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
- </Params>
- <Tables>
- <Table name="Supplier" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- </Tables>
- </SearchSupplierPrevious>
- <SearchSupplierNext CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Supplier
- SELECT TOP 1 @NextNo = Supplier.No_Supplier FROM Supplier WHERE Supplier.No_Supplier > @No_Supplier ORDER BY Supplier.No_Supplier
- SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
- LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
- where Supplier.No_Supplier = @NextNo
- SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @NextNo
- SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
- SELECT * from Fax where Fax.ID_Person = @ID_Supplier
- SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
- SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
- <Params>
- <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
- </Params>
- <Tables>
- <Table name="Supplier" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- </Tables>
- </SearchSupplierNext>
- <SearchSupplierLast CmdType="Text" CmdText=" DECLARE @ID_Supplier uniqueidentifier
- DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Supplier
- SELECT TOP 1 @NextNo = Supplier.No_Supplier FROM Supplier ORDER BY Supplier.No_Supplier DESC
- SELECT Supplier.*,a.Name_User AS CreatorName_Supplier,b.Name_User AS LastModUser_SupplierName FROM Supplier
- LEFT JOIN AppUser a ON a.ID_User = Supplier.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = Supplier.LastModUser_Supplier
- where Supplier.No_Supplier = @NextNo
- SELECT @ID_Supplier = Supplier.ID_Supplier FROM Supplier where Supplier.No_Supplier = @NextNo
- SELECT * from Telephone where Telephone.ID_Person = @ID_Supplier
- SELECT * from Fax where Fax.ID_Person = @ID_Supplier
- SELECT Case When Linkman.IsMain_Linkman = 1 Then '是' Else '否' End As IsMainDis_Linkman,Linkman.* FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
- SELECT Principal.*,Case When Principal.IsMain_Principal = 1 Then '是' Else '否' End As IsMainStr_Principal, Employee.Name_Employee AS Name_Employee, Employee.No_Employee AS No_Employee FROM Principal INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee WHERE Principal.ID_Person = @ID_Supplier">
- <Params>
- <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
- </Params>
- <Tables>
- <Table name="Supplier" />
- <Table name="Telephone" />
- <Table name="Fax"/>
- <Table name="Linkman" />
- <Table name="Principal"/>
- </Tables>
- </SearchSupplierLast>
- <GetEmployeeNameByNo CmdType="Text" CmdText="SELECT * 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;
- txtShortName.ReadOnly=true;
- txtName.ReadOnly=true;
- txtRegistedAddress.ReadOnly=true;
- cbCountry.Enabled=false;
- txtPostalCode.ReadOnly=true;
- pcPhone.ReadOnly=true;
- pcFax.ReadOnly=true;
- dttCreateDate.ReadOnly=true;
- dtpIsSuspend.Enabled=false;
- txtComment.ReadOnly=true;
- dtLinkMan.ReadOnly=true;
- dtPrinciple.ReadOnly=true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- #Supplier.CreateDate_Supplier=DBNull();
- #Supplier.SuspendDate_Supplier=DBNull();
- #Supplier.LastModUser_Supplier=DBNull();
- #Supplier.LastModDate_Supplier=DBNull();
- if(ckDisplay.Checked)
- #Supplier.IsDisplay=1;
- else
- #Supplier.IsDisplay=0;
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- tbNo.ReadOnly=true;
- txtShortName.ReadOnly=false;
- txtName.ReadOnly=false;
- txtRegistedAddress.ReadOnly=false;
- cbCountry.Enabled=true;
- txtPostalCode.ReadOnly=false;
- dtpIsSuspend.Enabled=true;
- txtComment.ReadOnly=false;
- dtLinkMan.ReadOnly=false;
- dtPrinciple.ReadOnly=false;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- #Supplier.No_Supplier=tbNo.CValue;
- #Supplier.CreatorName_Supplier=GetCurrentUser();<!--得到当前用户。引擎应支持-->
- #Supplier.ID_Supplier=NewGuid();
- #Supplier.ID_Creator=GetLoginUserID();
- #Supplier.Country_Supplier=40;
- #Supplier.CreateDate_Supplier=DateTimeNow();
- #Supplier.SuspendDate_Supplier=DBNull();
- #Supplier.LastModUser_Supplier=DBNull();
- #Supplier.LastModDate_Supplier=DBNull();
- Search("SearchDefaultPhone");
- Search("SearchDefaultFax");
- MergeTable("#DefaultFax","#Fax");
- MergeTable("#DefaultTelephone","#Telephone");
- if(ckDisplay.Checked)
- #Supplier.IsDisplay=1;
- else
- #Supplier.IsDisplay=0;
- UpdateForm(true, "");
- pcPhone.ReadOnly=false;
- pcFax.ReadOnly=false;
- txtShortName.Focus();
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=false;
- txtShortName.ReadOnly=true;
- txtName.ReadOnly=true;
- txtRegistedAddress.ReadOnly=true;
- cbCountry.Enabled=false;
- txtPostalCode.ReadOnly=true;
- pcPhone.ReadOnly=true;
- pcFax.ReadOnly=true;
- dtpIsSuspend.Enabled=false;
- txtComment.ReadOnly=true;
- dtLinkMan.ReadOnly=true;
- dtPrinciple.ReadOnly=true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=GetRight(@Title,"打印");
- if(ckDisplay.Checked)
- #Supplier.IsDisplay=1;
- else
- #Supplier.IsDisplay=0;
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly=true;
- txtShortName.ReadOnly=false;
- txtName.ReadOnly=false;
- txtRegistedAddress.ReadOnly=false;
- cbCountry.Enabled=true;
- txtPostalCode.ReadOnly=false;
- pcPhone.ReadOnly=false;
- pcFax.ReadOnly=false;
- dtpIsSuspend.Enabled=true;
- txtComment.ReadOnly=false;
- dtLinkMan.ReadOnly=false;
- dtPrinciple.ReadOnly=false;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=false;
- #Supplier.LastModUser_SupplierName=GetCurrentUser();
- #Supplier.LastModUser_Supplier=GetLoginUserID();
- #Supplier.LastModDate_Supplier=DateTimeNow();
- if(ckDisplay.Checked)
- #Supplier.IsDisplay=1;
- else
- #Supplier.IsDisplay=0;
- UpdateForm(true, "");
- txtShortName.Focus();
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(txtShortName.CValue=="")
- {
- MessageBox("请输入供应商简称!",@Title);
- txtShortName.Focus();
- return;
- }
- if(txtName.CValue=="")
- {
- MessageBox("请输入供应商名称!",@Title);
- txtName.Focus();
- return;
- }
- if(cbCountry.CValue==0)
- {
- tbDetail.SelectedIndex=0;
- MessageBox("请输入国家名称!",@Title);
- cbCountry.Focus();
- return;
- }
- dttCreateDate.CValue=DateTimeNow();
- UpdateForm(false, "");
- if(@Status==1)
- {
- SuspendLayout();
- for(@i=RowCount("#Linkman")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Linkman", @i);
- if(Equals(#Linkman.ID_Linkman,GuidEmpty()))
- #Linkman.ID_Linkman = NewGuid();
- #Linkman.ID_Person = #Supplier.ID_Supplier;
- }
- 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()))
- {
- dtPrinciple.CurrentRowIndex=@i;
- tbDetail.SelectedIndex=2;
- MessageBox("该员工不存在!",@Title);
- ResumeLayout();
- return;
- }
- #Principal.ID_Person = #Supplier.ID_Supplier;
- }
- for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Telephone",@i);
- if(Equals(#Telephone.ID_Telephone,GuidEmpty()))
- #Telephone.ID_Telephone=NewGuid();
- #Telephone.ID_Person=#Supplier.ID_Supplier;
- }
- for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Fax",@i);
- if(Equals(#Fax.ID_Fax,GuidEmpty()))
- #Fax.ID_Fax=NewGuid();
- #Fax.ID_Person=#Supplier.ID_Supplier;
- }
- ResumeLayout();
- New();
- }
- else if(@Status == 3)
- {
- SuspendLayout();
- for(@i=RowCount("#Linkman")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Linkman", @i);
- if(Equals(#Linkman.ID_Linkman,GuidEmpty()))
- #Linkman.ID_Linkman = NewGuid();
- #Linkman.ID_Person = #Supplier.ID_Supplier;
- }
- 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()))
- {
- dtPrinciple.CurrentRowIndex=@i;
- tbDetail.SelectedIndex=2;
- MessageBox("该员工不存在!",@Title);
- ResumeLayout();
- return;
- }
- #Principal.ID_Person = #Supplier.ID_Supplier;
- }
- for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Telephone",@i);
- if(Equals(#Telephone.ID_Telephone,GuidEmpty()))
- #Telephone.ID_Telephone=NewGuid();
- #Telephone.ID_Person=#Supplier.ID_Supplier;
- }
- for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#Fax",@i);
- if(Equals(#Fax.ID_Fax,GuidEmpty()))
- #Fax.ID_Fax=NewGuid();
- #Fax.ID_Person=#Supplier.ID_Supplier;
- }
- ResumeLayout();
- #Supplier.LastModDate_Supplier=DateTimeNow();
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|