123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmNoMaintenance">
- <Client>
- <Events>
- <Load><![CDATA[
- @Title="资料编码维护";
- GetSchema();
- ChangeMode("Search");
- ]]></Load>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search"/>
- </Search>
- </Mode>
- <Controls>
- <IKComboBoxEx name="cbType"/>
- <IKDataGridEx name="dgBasicInfo" DataSource="Total" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Total.No"/>
- <DataColumn Index="1" DataSource="Total.NoNew"/>
- <DataColumn Index="2" DataSource="Total.Name"/>
- <DataColumn Index="3" DataSource="Total.CreateDate"/>
- <DataColumn Index="4" DataSource="Total.Creator"/>
- <DataColumn Index="5" DataSource="Total.SuspendDate"/>
- <DataColumn Index="6" DataSource="Total.Comment"/>
- </IKDataGridEx>
- <IKButton name="btnSearch">
- <Events>
- <Click>
- @str=txtNo.CValue;
- @str=Replace(@str,"%","_");
- @str=Replace(@str,"*","%");
- Search("SearchTotal",@str,cbType.Text);
- if(RowCount("#Total")>0)
- {
- btnClear.Enabled=true;
- btnReplace.Enabled=true;
- btnOK.Enabled=false;
- }
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnClose">
- <Events>
- <Click>
- Close();
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnClear">
- <Events>
- <Click>
- Empty();
- txtNo.CValue = "";
- txtNewNo.CValue="";
- btnClear.Enabled=false;
- btnReplace.Enabled=false;
- btnOK.Enabled=false;
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnReplace">
- <Events>
- <Click>
- if(txtNewNo.CValue=="")
- {
- MessageBox("请输入新编码号码!",@Title);
- return;
- }
- if(!IsMatch(txtNo.CValue,txtNewNo.CValue))
- {
- MessageBox("新编码格式与原编码格式不匹配!",@Title);
- return;
- }
- SuspendLayout();
- for(@i=0;@i < RowCount("#Total");@i++)
- {
- SetPosition("#Total",@i);
- #Total.NoNew=ReplaceEx(txtNo.CValue,txtNewNo.CValue,#Total.No);
- }
- ResumeLayout();
- btnOK.Enabled=true;
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnOK">
- <Events>
- <Click>
- Update();
- btnReplace.Enabled=false;
- btnOK.Enabled=false;
- </Click>
- </Events>
- </IKButton>
- </Controls>
- </Client>
- <Server>
- <Tables>
- <Table name="Total" Type="Association">
- <GetSchema CmdType="Text" CmdText="
- SELECT Top 0 newID() As ID,Convert(nvarchar(64),'') As No,Convert(nvarchar(64),'') As NoNew,Convert(nvarchar(64),'') As Name,Convert(datetime,'') As CreateDate,
- Convert(nvarchar(64),'') As Creator,Convert(datetime,'') As SuspendDate,Convert(nvarchar(64),'') As Comment,Convert(int,0) As Type
- "/>
- <Update CmdType="Text" CmdText="
- if(@Type=0)
- Update Supplier Set No_Supplier=@NoNew Where ID_Supplier=@ID
- if(@Type=1)
- Update Transporter Set No_Transporter=@NoNew Where ID_Transporter=@ID
- if(@Type=2)
- Update Customer Set No_Customer=@NoNew Where ID_Customer=@ID
- if(@Type=3)
- Update Product Set No_Product=@NoNew Where ID_Product=@ID
- ">
- <Params>
- <Param name="@ID" type="Department.ID_Department" sourceColumn="ID" />
- <Param name="@NoNew" type="Department.No_Department" sourceColumn="NoNew" />
- <Param name="@Type" type="SaleInvoice.Type_SaleInvoice" sourceColumn="Type" />
- </Params>
- </Update>
- <UNIQUEErrorReport ErrorMessage="该编码已经存在!"/>
- </Table>
- </Tables>
- <Search>
- <SearchTotal CmdType="Text" CmdText="
- if(@Type='供应商')
- Select ID_Supplier As ID,No_Supplier As No,Name_Supplier As Name,CreateDate_Supplier As CreateDate,AppUser.Name_User As Creator,SuspendDate_Supplier As SuspendDate,Comment_Supplier As Comment ,Type=0 From Supplier
- Left Join AppUser On AppUser.ID_User=Supplier.ID_Creator Where No_Supplier Like @No
- else if(@Type='运输商')
- Select ID_Transporter As ID,No_Transporter As No,Name_Transporter As Name,CreateDate_Transporter As CreateDate,AppUser.Name_User As Creator,SuspendDate_Transporter As SuspendDate,Comment_Transporter As Comment,Type=1 From Transporter
- Left Join AppUser On AppUser.ID_User=Transporter.Creator_Transporter Where No_Transporter Like @No
- else if(@Type='客户')
- Select ID_Customer As ID,No_Customer As No,Name_Customer As Name,CreateDate_Customer As CreateDate,AppUser.Name_User As Creator,SuspendDate_Customer As SuspendDate,Comment_Customer As Comment,Type=2 From Customer
- Left Join AppUser On AppUser.ID_User=Customer.ID_Creator Where No_Customer Like @No
- else if(@Type='产品')
- Select ID_Product As ID,No_Product As No,Name_Product As Name,CreateDate_Product As CreateDate,AppUser.Name_User As Creator,SuspendDate_Product As SuspendDate,Comment_Product As Comment,Type=3 From Product
- Left Join AppUser On AppUser.ID_User=Product.ID_Creator Where No_Product Like @No
- ">
- <Params>
- <Param name="@No" type="Product.No_Product" Index="0"/>
- <Param name="@Type" type="Product.Name_Product" Index="1"/>
- </Params>
- <Tables>
- <Table name="Total" />
- </Tables>
- </SearchTotal>
- </Search>
- </Server>
- <Lables>
- <Search>
- cbType.Text="供应商";
- btnClear.Enabled=false;
- btnReplace.Enabled=false;
- btnOK.Enabled=false;
- </Search>
- </Lables>
- </Form>
- </Forms>
-
-
|