123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmCustomerReqInfo">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="客户需求商品";
- GetSchema();
- ChangeMode("Search");
- dgProduct.NoMember="No_CustomerReq";
- Search("SearchUnit");
- Search("SearchType");
- Search("SearchProperty");
- Search("SearchManuMethod");
- Search("SearchMaterial");
- Search("SearchProcess");
- Search("SearchContinuity");
- Search("SearchOil");
- ]]>
- </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="CustomerReqInfo.CreateDate_CustomerReqInfo" />
- <IKTextButton name="cbCreateNo" DataSource="CustomerReqInfo.No_CustomerReqInfo">
- <Events>
- <Enter>
- <![CDATA[
- if(cbCreateNo.ReadOnly == false)
- {
- if(cbCreateNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchCustomerReqInfoWithNo", cbCreateNo.CValue))
- {
- if(!GetRight("客户基本资料","全权查看"))
- {
- if(!Equals(#CustomerReqInfo.CustomerID_Creator,GetLoginUserID()))
- {
- @EnterNo=cbCreateNo.CValue;
- ChangeMode("Search");
- cbCreateNo.CValue=@EnterNo;
- MessageBox("您没有查看此客户需求商品的权限!",@Title);
- return;
- }
- }
- ChangeMode("View");
- }
- else
- {
- MessageBox("该档案不存在!",@Title);
- }
- }
- else
- {
- MessageBox("请输入建档编号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- ShowSearchBox("BillSearch","NODEPOT", "cbCreateNo",cbCreateNo.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbNo" DataSource="CustomerReqInfo.No_Customer">
- <Events>
- <Enter>
- <![CDATA[
- UpdateForm(false,"");
- if(tbNo.CValue != StringEmpty())
- {
- if(!Search("SearchCustomer",tbNo.CValue))
- {
- MessageBox("该客户不存在!",@Title);
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbNo.CValue);
- if(@temp!= "")
- {
- tbNo.CValue = @temp;
- ActiveControlEvent("tbNo", "Enter");
- }
- }
- else
- {
- if (!Equals(#Customer.SuspendDate_Customer,DBNull()))
- {
- MessageBox("该客户已停用!",@Title);
- }
- #CustomerReqInfo.ID_Customer = #Customer.ID_Customer;
- #CustomerReqInfo.No_Customer = #Customer.No_Customer;
- #CustomerReqInfo.ShortName_Customer = #Customer.ShortName_Customer;
- #CustomerReqInfo.Type_Customer = #Customer.Type_Customer;
- #CustomerReqInfo.Name_Customer = #Customer.Name_Customer;
- #CustomerReqInfo.PostalCode_Customer = #Customer.PostalCode_Customer;
- #CustomerReqInfo.Linkman_CustomerReqInfo = "";
- #CustomerReqInfo.Telephone_CustomerReqInfo = "";
- #CustomerReqInfo.Fax_CustomerReqInfo = "";
- #CustomerReqInfo.SendAddr_CustomerReqInfo = #Customer.SendAddr_Customer;
- }
- }
- else
- {
- MessageBox("请输入客户编号!",@Title);
- #CustomerReqInfo.ID_Customer = GuidEmpty();
- #CustomerReqInfo.No_Customer = "";
- #CustomerReqInfo.ShortName_Customer = "";
- #CustomerReqInfo.Type_Customer = "";
- #CustomerReqInfo.Name_Customer = "";
- #CustomerReqInfo.PostalCode_Customer = "";
- #CustomerReqInfo.Linkman_CustomerReqInfo = "";
- #CustomerReqInfo.Telephone_CustomerReqInfo = "";
- #CustomerReqInfo.Fax_CustomerReqInfo = "";
- #CustomerReqInfo.SendAddr_CustomerReqInfo ="";
- }
- UpdateForm(true,"");
- ]]>
- </Enter>
- <Click>
- <![CDATA[
- if (tbNo.ReadOnly == false)
- {
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbNo.CValue);
- if( @temp == "" )
- return;
- tbNo.CValue = @temp;
- ActiveControlEvent("tbNo", "Enter");
- }
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtShortName" DataSource="CustomerReqInfo.ShortName_Customer" />
- <IKTextBox name="txtType" DataSource="CustomerReqInfo.Type_Customer" />
- <IKTextBox name="txtName" DataSource="CustomerReqInfo.Name_Customer" />
- <IKTextBox name="txtPostalCode" DataSource="CustomerReqInfo.PostalCode_Customer" />
- <IKTextBox name="txtCreator" DataSource="CustomerReqInfo.Name_User" />
- <IKComboBoxEx name="cbName" DisplaySource="CustomerReqInfo.Linkman_CustomerReqInfo" ValueSource="CustomerReqInfo.ID_Linkman"
- DataSource="Linkman" DisplayMember="Name_Linkman" ValueMember="ID_Linkman">
- <Events>
- <Reload>
- UpdateForm(false, "cbName");
- Search("SearchLinkman",tbNo.CValue);
- UpdateForm(true, "cbName");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbTelephone" DisplaySource="CustomerReqInfo.Telephone_CustomerReqInfo" ValueSource="CustomerReqInfo.ID_Telephone"
- DataSource="Telephone" DisplayMember="No_Telephone" ValueMember="ID_Telephone">
- <Events>
- <Reload>
- UpdateForm(false, "cbTelephone");
- Search("SearchTelephone",tbNo.CValue);
- UpdateForm(true, "cbTelephone");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbFax" DisplaySource="CustomerReqInfo.Fax_CustomerReqInfo" ValueSource="CustomerReqInfo.ID_Fax"
- DataSource="Fax" DisplayMember="No_Fax" ValueMember="ID_Fax">
- <Events>
- <Reload>
- UpdateForm(false, "cbFax");
- Search("SearchFax",tbNo.CValue);
- UpdateForm(true, "cbFax");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="txtSendAddr" DataSource="CustomerReqInfo.SendAddr_CustomerReqInfo" />
- <IKTextBox name="txtComment" DataSource="CustomerReqInfo.Comment_CustomerReqInfo" />
- <IKDataGridEx name="dgProduct" DataSource="CustomerReqProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="CustomerReqProduct.No_CustomerReq"/>
- <DataColumn Index="1" DataSource="CustomerReqProduct.No_CustomerReqProduct">
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- ShowSearchBox("ProductSearch","INFOMATION",#CustomerReqProduct.No_CustomerReqProduct);
- </Click>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="2" DataSource="CustomerReqProduct.Name_CustomerReqProduct" />
- <DataColumn Index="3" DataSource="CustomerReqProduct.Factory_CustomerReqProduct" />
- <DataColumn Index="4" DataSource="CustomerReqProduct.Quantity_CustomerReqProduct" />
- <DataColumn Index="5" DataSource="CustomerReqProduct.Unit_CustomerReqProduct">
- <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Unit_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Unit_CustomerReqProduct"
- DataSourceEx="Unit" DisplayMemberEx="Unit_Product" ValueMemberEx="Unit_Product">
- <Events>
- <Reload>
- Search("SearchUnit");
- SetDataGridColumnDataSource(5,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="6" DataSource="CustomerReqProduct.Price_CustomerReqProduct" />
- <DataColumn Index="7" DataSource="CustomerReqProduct.Type_CustomerReqProduct">
- <!--<IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Type_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Type_CustomerReqProduct"
- DataSourceEx="Type" DisplayMemberEx="Type_Product" ValueMemberEx="Type_Product">
- <Events>
- <Reload>
- Search("SearchType");
- SetDataGridColumnDataSource(7,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>-->
- </DataColumn>
- <DataColumn Index="8" DataSource="CustomerReqProduct.Property_CustomerReqProduct">
- <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Property_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Property_CustomerReqProduct"
- DataSourceEx="Property" DisplayMemberEx="Property_Product" ValueMemberEx="Property_Product">
- <Events>
- <Reload>
- Search("SearchProperty");
- SetDataGridColumnDataSource(8,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="9" DataSource="CustomerReqProduct.ManuMethod_CustomerReqProduct">
- <!--<IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.ManuMethod_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.ManuMethod_CustomerReqProduct"
- DataSourceEx="ManuMethod" DisplayMemberEx="ManuMethod_Product" ValueMemberEx="ManuMethod_Product">
- <Events>
- <Reload>
- Search("SearchManuMethod");
- SetDataGridColumnDataSource(9,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>-->
- </DataColumn>
- <DataColumn Index="10" DataSource="CustomerReqProduct.Material_CustomerReqProduct">
- <!--<IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Material_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Material_CustomerReqProduct"
- DataSourceEx="Material" DisplayMemberEx="Material_CustomerReqProduct" ValueMemberEx="Material_CustomerReqProduct">
- <Events>
- <Reload>
- Search("SearchMaterial");
- SetDataGridColumnDataSource(10,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>-->
- </DataColumn>
- <DataColumn Index="11" DataSource="CustomerReqProduct.Process_CustomerReqProduct">
- <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Process_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Process_CustomerReqProduct"
- DataSourceEx="Process" DisplayMemberEx="Process_CustomerReqProduct" ValueMemberEx="Process_CustomerReqProduct">
- <Events>
- <Reload>
- Search("SearchProcess");
- SetDataGridColumnDataSource(11,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="12" DataSource="CustomerReqProduct.Continuity_CustomerReqProduct">
- <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Continuity_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Continuity_CustomerReqProduct"
- DataSourceEx="Continuity" DisplayMemberEx="Continuity_CustomerReqProduct" ValueMemberEx="Continuity_CustomerReqProduct">
- <Events>
- <Reload>
- Search("SearchContinuity");
- SetDataGridColumnDataSource(12,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="13" DataSource="CustomerReqProduct.Oil_CustomerReqProduct">
- <IKDataGridComboBoxColumn DisplaySourceEx="CustomerReqProduct.Oil_CustomerReqProduct" ValueSourceEx="CustomerReqProduct.Oil_CustomerReqProduct"
- DataSourceEx="Oil" DisplayMemberEx="Oil_CustomerReqProduct" ValueMemberEx="Oil_CustomerReqProduct">
- <Events>
- <Reload>
- Search("SearchOil");
- SetDataGridColumnDataSource(13,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="14" DataSource="CustomerReqProduct.TrackInside_CustomerReqProduct" />
- <DataColumn Index="15" DataSource="CustomerReqProduct.Rate_CustomerReqProduct" />
- <DataColumn Index="16" DataSource="CustomerReqProduct.Depth_CustomerReqProduct" />
- <DataColumn Index="17" DataSource="CustomerReqProduct.PutInQuantity_CustomerReqProduct" />
- <DataColumn Index="18" DataSource="CustomerReqProduct.Comment_CustomerReqProduct" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchFirst", cbCreateNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchPrevious", cbCreateNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchNext", cbCreateNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchLast", cbCreateNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
- {
- ChangeMode("View");
- }
- </ClickLast>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickNew>
- <![CDATA[
- @NextNo = GetNextAutoNumber(true);
- if (!Equals(@NextNo, ""))
- {
- ChangeMode("New");
- #CustomerReqInfo.No_CustomerReqInfo = @NextNo;
- UpdateForm(true, "cbCreateNo");
- }
- ]]>
- </ClickNew>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- <Lable name="CountSum" />
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
- <ClickExpand>
- if(toolBar.ExpandForm==true)
- {
- pnRight.Visible=true;<!--PanelRight is not existed-->
- }
- else
- {
- pnRight.Visible=false;
- }
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="CustomerReqProduct">
- <Events>
- <ColumnsChanged>
- <No_CustomerReqProduct>
- <![CDATA[
- if (!Equals(#CustomerReqProduct.No_CustomerReqProduct,"") && !Equals(#CustomerReqProduct.No_CustomerReqProduct,DBNull()))
- {
- if (Search("SearchProductWithNo",#CustomerReqProduct.No_CustomerReqProduct))
- {
- #CustomerReqProduct.Name_CustomerReqProduct = #Product.Name_Product;
- #CustomerReqProduct.Unit_CustomerReqProduct = #Product.Unit_Product;
- #CustomerReqProduct.Type_CustomerReqProduct = #Product.Type_Product;
- #CustomerReqProduct.Property_CustomerReqProduct = #Product.Property_Product;
- }
- }
- ]]>
- </No_CustomerReqProduct>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_CustomerReqInfo" LockNO="No_CustomerReqInfo" LockSearchFunction="SearchCustomerReqInfoWithNo" />
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="CustomerReqInfo" SearchFunction="SearchAllBill" SearchFunctionCondition="SearchCustomerCondition"
- SearchFunctionByNo="SearchCustomerReqInfoWithNo">
- <DataColumn Index="0" MappingName="#CustomerReqInfo.No_CustomerReqInfo" HeaderText="建档编号" Width="90"
- ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="1" MappingName="#CustomerReqInfo.CreateDate_CustomerReqInfo" HeaderText="建档日期"
- Width="90" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="2" MappingName="#CustomerReqInfo.No_Customer" HeaderText="客户编号" Width="75"
- ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="3" MappingName="#CustomerReqInfo.Type_Customer" HeaderText="客户类型" Width="75"
- ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="4" MappingName="#CustomerReqInfo.ShortName_Customer" HeaderText="客户名称" Width="75"
- ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="5" MappingName="#CustomerReqInfo.Comment_CustomerReqInfo" HeaderText="备注"
- Width="75" ColumnType="IKDataGridTextBoxColumn" />
- </ChildForm>
- <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition"
- SearchFunctionByNo="" MappingName="客户">
- <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90"
- ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75"
- ColumnType="IKDataGridBoolColumn" />
- <DataColumn Index="5" MappingName="#Customer.Zone_Customer" HeaderText="地区" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="6" MappingName="#Customer.SendAddr_Customer" HeaderText="送货地址" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo=""
- MappingName="产品" ReturnDataSource="CustomerReqProduct" ShowCheckBox="true">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"
- ReturnMappingName="#CustomerReqProduct.No_CustomerReqProduct" />
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn" />
- </ChildForm>
- <ChildForm name="InputSearchProduct" DataSource="Product" SearchFunction="SearchAllProduct"
- SearchFunctionByNo="" MappingName="产品">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn" />
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn" />
- </ChildForm>
- </ChildForms>
- <FormatString>
- <Format name="SearchCustomerCondition">
- if(GetRight("客户基本资料","全权查看"))
- {
- FormatString("");
- }
- else
- {
- FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- </FormatString>
- </Client>
- <Server>
- <Tables>
- <Table name="CustomerReqInfo" Type="Parent">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 CustomerReqInfo.*,Linkman.ID_Linkman,ID_Telephone,ID_Fax, Name_User, No_Customer,Name_Customer, ShortName_Customer,Type_Customer, PostalCode_Customer FROM CustomerReqInfo
- LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
- LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
- LEFT JOIN Linkman ON Linkman.ID_Person = CustomerReqInfo.ID_Customer
- LEFT JOIN Telephone ON Telephone.ID_Person = CustomerReqInfo.ID_Customer
- LEFT JOIN Fax ON Fax.ID_Person = CustomerReqInfo.ID_Customer" />
- <New CmdType="Text" CmdText="INSERT INTO CustomerReqInfo(ID_CustomerReqInfo, No_CustomerReqInfo, CreateDate_CustomerReqInfo, ID_Customer, Linkman_CustomerReqInfo, Telephone_CustomerReqInfo, Fax_CustomerReqInfo, SendAddr_CustomerReqInfo, Comment_CustomerReqInfo, ID_Creator)
- VALUES(@ID_CustomerReqInfo, @No_CustomerReqInfo, @CreateDate_CustomerReqInfo, @ID_Customer, @Linkman_CustomerReqInfo, @Telephone_CustomerReqInfo, @Fax_CustomerReqInfo, @SendAddr_CustomerReqInfo, @Comment_CustomerReqInfo, @ID_Creator)">
- <Params>
- <Param name="@ID_CustomerReqInfo" type="CustomerReqInfo.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
- <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" sourceColumn="No_CustomerReqInfo" />
- <Param name="@CreateDate_CustomerReqInfo" type="CustomerReqInfo.CreateDate_CustomerReqInfo"
- sourceColumn="CreateDate_CustomerReqInfo" />
- <Param name="@ID_Customer" type="CustomerReqInfo.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@Linkman_CustomerReqInfo" type="CustomerReqInfo.Linkman_CustomerReqInfo" sourceColumn="Linkman_CustomerReqInfo" />
- <Param name="@Telephone_CustomerReqInfo" type="CustomerReqInfo.Telephone_CustomerReqInfo"
- sourceColumn="Telephone_CustomerReqInfo" />
- <Param name="@Fax_CustomerReqInfo" type="CustomerReqInfo.Fax_CustomerReqInfo" sourceColumn="Fax_CustomerReqInfo" />
- <Param name="@SendAddr_CustomerReqInfo" type="CustomerReqInfo.SendAddr_CustomerReqInfo"
- sourceColumn="SendAddr_CustomerReqInfo" />
- <Param name="@Comment_CustomerReqInfo" type="CustomerReqInfo.Comment_CustomerReqInfo" sourceColumn="Comment_CustomerReqInfo" />
- <Param name="@ID_Creator" type="CustomerReqInfo.ID_Creator" sourceColumn="ID_Creator" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE CustomerReqInfo SET
- No_CustomerReqInfo = @No_CustomerReqInfo,
- CreateDate_CustomerReqInfo = @CreateDate_CustomerReqInfo,
- ID_Customer = @ID_Customer,
- Linkman_CustomerReqInfo = @Linkman_CustomerReqInfo,
- Telephone_CustomerReqInfo = @Telephone_CustomerReqInfo,
- Fax_CustomerReqInfo = @Fax_CustomerReqInfo,
- SendAddr_CustomerReqInfo = @SendAddr_CustomerReqInfo,
- Comment_CustomerReqInfo = @Comment_CustomerReqInfo,
- ID_Creator = @ID_Creator
- WHERE ID_CustomerReqInfo = @ID_CustomerReqInfo">
- <Params>
- <Param name="@ID_CustomerReqInfo" type="CustomerReqInfo.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
- <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" sourceColumn="No_CustomerReqInfo" />
- <Param name="@CreateDate_CustomerReqInfo" type="CustomerReqInfo.CreateDate_CustomerReqInfo"
- sourceColumn="CreateDate_CustomerReqInfo" />
- <Param name="@ID_Customer" type="CustomerReqInfo.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@Linkman_CustomerReqInfo" type="CustomerReqInfo.Linkman_CustomerReqInfo" sourceColumn="Linkman_CustomerReqInfo" />
- <Param name="@Telephone_CustomerReqInfo" type="CustomerReqInfo.Telephone_CustomerReqInfo"
- sourceColumn="Telephone_CustomerReqInfo" />
- <Param name="@Fax_CustomerReqInfo" type="CustomerReqInfo.Fax_CustomerReqInfo" sourceColumn="Fax_CustomerReqInfo" />
- <Param name="@SendAddr_CustomerReqInfo" type="CustomerReqInfo.SendAddr_CustomerReqInfo"
- sourceColumn="SendAddr_CustomerReqInfo" />
- <Param name="@Comment_CustomerReqInfo" type="CustomerReqInfo.Comment_CustomerReqInfo" sourceColumn="Comment_CustomerReqInfo" />
- <Param name="@ID_Creator" type="CustomerReqInfo.ID_Creator" sourceColumn="ID_Creator" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo
- DELETE CustomerReqInfo WHERE CustomerReqInfo.ID_CustomerReqInfo = @ID_CustomerReqInfo">
- <Params>
- <Param name="@ID_CustomerReqInfo" type="CustomerReqInfo.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
- </Params>
- </Delete>
- </Table>
- <Table name="CustomerReqProduct" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 CustomerReqProduct.* FROM CustomerReqProduct" />
- <New CmdType="Text" CmdText="Insert Into dbo.CustomerReqProduct (ID_CustomerReqProduct, ID_CustomerReqInfo, No_CustomerReq, No_CustomerReqProduct, Name_CustomerReqProduct, Type_CustomerReqProduct, Property_CustomerReqProduct, Quantity_CustomerReqProduct, Unit_CustomerReqProduct, Comment_CustomerReqProduct, Price_CustomerReqProduct, TrackInside_CustomerReqProduct, ManuMethod_CustomerReqProduct, Material_CustomerReqProduct, Continuity_CustomerReqProduct, Process_CustomerReqProduct, Factory_CustomerReqProduct, Rate_CustomerReqProduct, Depth_CustomerReqProduct, PutInQuantity_CustomerReqProduct, Oil_CustomerReqProduct)
- Values(@ID_CustomerReqProduct, @ID_CustomerReqInfo, @No_CustomerReq, @No_CustomerReqProduct, @Name_CustomerReqProduct, @Type_CustomerReqProduct, @Property_CustomerReqProduct, @Quantity_CustomerReqProduct, @Unit_CustomerReqProduct, @Comment_CustomerReqProduct, @Price_CustomerReqProduct, @TrackInside_CustomerReqProduct, @ManuMethod_CustomerReqProduct, @Material_CustomerReqProduct, @Continuity_CustomerReqProduct, @Process_CustomerReqProduct, @Factory_CustomerReqProduct, @Rate_CustomerReqProduct, @Depth_CustomerReqProduct, @PutInQuantity_CustomerReqProduct, @Oil_CustomerReqProduct)">
- <Params>
- <Param name="@No_CustomerReq" type="CustomerReqProduct.No_CustomerReq" sourceColumn="No_CustomerReq" />
- <Param name="@ID_CustomerReqProduct" type="CustomerReqProduct.ID_CustomerReqProduct" sourceColumn="ID_CustomerReqProduct" />
- <Param name="@ID_CustomerReqInfo" type="CustomerReqProduct.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
- <Param name="@No_CustomerReqProduct" type="CustomerReqProduct.No_CustomerReqProduct" sourceColumn="No_CustomerReqProduct" />
- <Param name="@Name_CustomerReqProduct" type="CustomerReqProduct.Name_CustomerReqProduct"
- sourceColumn="Name_CustomerReqProduct" />
- <Param name="@Type_CustomerReqProduct" type="CustomerReqProduct.Type_CustomerReqProduct"
- sourceColumn="Type_CustomerReqProduct" />
- <Param name="@Property_CustomerReqProduct" type="CustomerReqProduct.Property_CustomerReqProduct"
- sourceColumn="Property_CustomerReqProduct" />
- <Param name="@Quantity_CustomerReqProduct" type="CustomerReqProduct.Quantity_CustomerReqProduct"
- sourceColumn="Quantity_CustomerReqProduct" />
- <Param name="@Unit_CustomerReqProduct" type="CustomerReqProduct.Unit_CustomerReqProduct"
- sourceColumn="Unit_CustomerReqProduct" />
- <Param name="@Comment_CustomerReqProduct" type="CustomerReqProduct.Comment_CustomerReqProduct"
- sourceColumn="Comment_CustomerReqProduct" />
- <Param name="@Price_CustomerReqProduct" type="CustomerReqProduct.Price_CustomerReqProduct"
- sourceColumn="Price_CustomerReqProduct" />
- <Param name="@TrackInside_CustomerReqProduct" type="CustomerReqProduct.TrackInside_CustomerReqProduct"
- sourceColumn="TrackInside_CustomerReqProduct" />
- <Param name="@ManuMethod_CustomerReqProduct" type="CustomerReqProduct.ManuMethod_CustomerReqProduct"
- sourceColumn="ManuMethod_CustomerReqProduct" />
- <Param name="@Material_CustomerReqProduct" type="CustomerReqProduct.Material_CustomerReqProduct"
- sourceColumn="Material_CustomerReqProduct" />
- <Param name="@Continuity_CustomerReqProduct" type="CustomerReqProduct.Continuity_CustomerReqProduct"
- sourceColumn="Continuity_CustomerReqProduct" />
- <Param name="@Process_CustomerReqProduct" type="CustomerReqProduct.Process_CustomerReqProduct"
- sourceColumn="Process_CustomerReqProduct" />
- <Param name="@Factory_CustomerReqProduct" type="CustomerReqProduct.Factory_CustomerReqProduct"
- sourceColumn="Factory_CustomerReqProduct" />
- <Param name="@Rate_CustomerReqProduct" type="CustomerReqProduct.Rate_CustomerReqProduct"
- sourceColumn="Rate_CustomerReqProduct" />
- <Param name="@Depth_CustomerReqProduct" type="CustomerReqProduct.Depth_CustomerReqProduct"
- sourceColumn="Depth_CustomerReqProduct" />
- <Param name="@PutInQuantity_CustomerReqProduct" type="CustomerReqProduct.PutInQuantity_CustomerReqProduct"
- sourceColumn="PutInQuantity_CustomerReqProduct" />
- <Param name="@Oil_CustomerReqProduct" type="CustomerReqProduct.Oil_CustomerReqProduct"
- sourceColumn="Oil_CustomerReqProduct" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="Update dbo.CustomerReqProduct
- Set ID_CustomerReqInfo = @ID_CustomerReqInfo,
- No_CustomerReq = @No_CustomerReq,
- No_CustomerReqProduct = @No_CustomerReqProduct,
- Name_CustomerReqProduct = @Name_CustomerReqProduct,
- Type_CustomerReqProduct = @Type_CustomerReqProduct,
- Property_CustomerReqProduct = @Property_CustomerReqProduct,
- Quantity_CustomerReqProduct = @Quantity_CustomerReqProduct,
- Unit_CustomerReqProduct = @Unit_CustomerReqProduct,
- Comment_CustomerReqProduct = @Comment_CustomerReqProduct,
- Price_CustomerReqProduct = @Price_CustomerReqProduct,
- TrackInside_CustomerReqProduct = @TrackInside_CustomerReqProduct,
- ManuMethod_CustomerReqProduct = @ManuMethod_CustomerReqProduct,
- Material_CustomerReqProduct = @Material_CustomerReqProduct,
- Continuity_CustomerReqProduct = @Continuity_CustomerReqProduct,
- Process_CustomerReqProduct = @Process_CustomerReqProduct,
- Factory_CustomerReqProduct = @Factory_CustomerReqProduct,
- Rate_CustomerReqProduct = @Rate_CustomerReqProduct,
- Depth_CustomerReqProduct = @Depth_CustomerReqProduct,
- PutInQuantity_CustomerReqProduct = @PutInQuantity_CustomerReqProduct,
- Oil_CustomerReqProduct = @Oil_CustomerReqProduct
- Where ID_CustomerReqProduct = @ID_CustomerReqProduct">
- <Params>
- <Param name="@No_CustomerReq" type="CustomerReqProduct.No_CustomerReq" sourceColumn="No_CustomerReq" />
- <Param name="@ID_CustomerReqProduct" type="CustomerReqProduct.ID_CustomerReqProduct" sourceColumn="ID_CustomerReqProduct" />
- <Param name="@ID_CustomerReqInfo" type="CustomerReqProduct.ID_CustomerReqInfo" sourceColumn="ID_CustomerReqInfo" />
- <Param name="@No_CustomerReqProduct" type="CustomerReqProduct.No_CustomerReqProduct" sourceColumn="No_CustomerReqProduct" />
- <Param name="@Name_CustomerReqProduct" type="CustomerReqProduct.Name_CustomerReqProduct"
- sourceColumn="Name_CustomerReqProduct" />
- <Param name="@Type_CustomerReqProduct" type="CustomerReqProduct.Type_CustomerReqProduct"
- sourceColumn="Type_CustomerReqProduct" />
- <Param name="@Property_CustomerReqProduct" type="CustomerReqProduct.Property_CustomerReqProduct"
- sourceColumn="Property_CustomerReqProduct" />
- <Param name="@Quantity_CustomerReqProduct" type="CustomerReqProduct.Quantity_CustomerReqProduct"
- sourceColumn="Quantity_CustomerReqProduct" />
- <Param name="@Unit_CustomerReqProduct" type="CustomerReqProduct.Unit_CustomerReqProduct"
- sourceColumn="Unit_CustomerReqProduct" />
- <Param name="@Comment_CustomerReqProduct" type="CustomerReqProduct.Comment_CustomerReqProduct"
- sourceColumn="Comment_CustomerReqProduct" />
- <Param name="@Price_CustomerReqProduct" type="CustomerReqProduct.Price_CustomerReqProduct"
- sourceColumn="Price_CustomerReqProduct" />
- <Param name="@TrackInside_CustomerReqProduct" type="CustomerReqProduct.TrackInside_CustomerReqProduct"
- sourceColumn="TrackInside_CustomerReqProduct" />
- <Param name="@ManuMethod_CustomerReqProduct" type="CustomerReqProduct.ManuMethod_CustomerReqProduct"
- sourceColumn="ManuMethod_CustomerReqProduct" />
- <Param name="@Material_CustomerReqProduct" type="CustomerReqProduct.Material_CustomerReqProduct"
- sourceColumn="Material_CustomerReqProduct" />
- <Param name="@Continuity_CustomerReqProduct" type="CustomerReqProduct.Continuity_CustomerReqProduct"
- sourceColumn="Continuity_CustomerReqProduct" />
- <Param name="@Process_CustomerReqProduct" type="CustomerReqProduct.Process_CustomerReqProduct"
- sourceColumn="Process_CustomerReqProduct" />
- <Param name="@Factory_CustomerReqProduct" type="CustomerReqProduct.Factory_CustomerReqProduct"
- sourceColumn="Factory_CustomerReqProduct" />
- <Param name="@Rate_CustomerReqProduct" type="CustomerReqProduct.Rate_CustomerReqProduct"
- sourceColumn="Rate_CustomerReqProduct" />
- <Param name="@Depth_CustomerReqProduct" type="CustomerReqProduct.Depth_CustomerReqProduct"
- sourceColumn="Depth_CustomerReqProduct" />
- <Param name="@PutInQuantity_CustomerReqProduct" type="CustomerReqProduct.PutInQuantity_CustomerReqProduct"
- sourceColumn="PutInQuantity_CustomerReqProduct" />
- <Param name="@Oil_CustomerReqProduct" type="CustomerReqProduct.Oil_CustomerReqProduct"
- sourceColumn="Oil_CustomerReqProduct" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqProduct = @ID_CustomerReqProduct">
- <Params>
- <Param name="@ID_CustomerReqProduct" type="CustomerReqProduct.ID_CustomerReqProduct" sourceColumn="ID_CustomerReqProduct" />
- </Params>
- </Delete>
- </Table>
- </Tables>
- <Search>
- <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer,Customer.ID_Creator,Customer.Zone_Customer,Customer.SendAddr_Customer FROM Customer ">
- <Tables>
- <Table name="AllCustomer" />
- </Tables>
- </SearchAllCustomer>
- <SearchAllBill CmdType="Text" CmdText=" SELECT CustomerReqInfo.*,Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer,Customer.ID_Creator FROM CustomerReqInfo
- LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchAllProduct CmdType="Text" CmdText=" SELECT Product.No_Product,Product.Name_Product FROM Product
- ">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllProduct>
- <SearchCustomerReqInfoWithNo CmdType="Text" CmdText=" DECLARE @ID_CustomerReqInfo UNIQUEIDENTIFIER
- SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @No_CustomerReqInfo
- SELECT CustomerReqInfo.*, Name_User, Customer.ID_Creator as CustomerID_Creator,Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer FROM CustomerReqInfo
- LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
- LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
- WHERE CustomerReqInfo.No_CustomerReqInfo = @No_CustomerReqInfo
- SELECT CustomerReqProduct.* FROM CustomerReqProduct
- WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo
- order by No_CustomerReq">
- <Params>
- <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
- </Params>
- <Tables>
- <Table name="CustomerReqInfo" />
- <Table name="CustomerReqProduct" />
- </Tables>
- </SearchCustomerReqInfoWithNo>
- <SearchCustomer CmdType="Text" CmdText="SELECT * FROM Customer
- LEFT JOIN Linkman ON Linkman.ID_Person = Customer.ID_Customer
- WHERE No_Customer = @No_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Customer" />
- </Tables>
- </SearchCustomer>
- <SearchLinkman CmdType="Text" CmdText="DECLARE @ID_Customer UNIQUEIDENTIFIER
- SELECT @ID_Customer = ID_Customer FROM Customer WHERE No_Customer = @No_Customer
- SELECT Name_Linkman,ID_Linkman FROM Linkman WHERE ID_Person = @ID_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Linkman" />
- </Tables>
- </SearchLinkman>
- <SearchTelephone CmdType="Text" CmdText="DECLARE @ID_Customer UNIQUEIDENTIFIER
- SELECT @ID_Customer = ID_Customer FROM Customer WHERE No_Customer = @No_Customer
- SELECT No_Telephone,ID_Telephone FROM Telephone WHERE ID_Person = @ID_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Telephone" />
- </Tables>
- </SearchTelephone>
- <SearchFax CmdType="Text" CmdText="DECLARE @ID_Customer UNIQUEIDENTIFIER
- SELECT @ID_Customer = ID_Customer FROM Customer WHERE No_Customer = @No_Customer
- SELECT No_Fax,ID_Fax FROM Fax WHERE ID_Person = @ID_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Fax" />
- </Tables>
- </SearchFax>
- <SearchUnit CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Unit_Product FROM TypeDef WHERE Type_TypeDef = '7'">
- <Tables>
- <Table name="Unit" />
- </Tables>
- </SearchUnit>
- <SearchType CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Type_Product FROM TypeDef WHERE Type_TypeDef = '8'">
- <Tables>
- <Table name="Type" />
- </Tables>
- </SearchType>
- <SearchProperty CmdType="Text" CmdText="SELECT TypeDef.Name_TypeDef AS Property_Product FROM TypeDef WHERE Type_TypeDef = '10'">
- <Tables>
- <Table name="Property" />
- </Tables>
- </SearchProperty>
- <SearchFirst CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_CustomerReqInfo
- SELECT TOP 1 @NextNo = CustomerReqInfo.No_CustomerReqInfo FROM CustomerReqInfo
- inner Join Customer On Customer.ID_Customer=CustomerReqInfo.ID_Customer
- where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- ORDER BY CustomerReqInfo.No_CustomerReqInfo
- DECLARE @ID_CustomerReqInfo uniqueidentifier
- SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @NextNo
-
- SELECT CustomerReqInfo.*, Name_User, Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer,Customer.ID_Creator FROM CustomerReqInfo
- LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
- LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
- WHERE CustomerReqInfo.No_CustomerReqInfo = @NextNo
-
- SELECT CustomerReqProduct.* FROM CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo order by No_CustomerReq ">
- <Params>
- <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="CustomerReqInfo" />
- <Table name="CustomerReqProduct" />
- </Tables>
- </SearchFirst>
- <SearchPrevious CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_CustomerReqInfo
- SELECT TOP 1 @NextNo = CustomerReqInfo.No_CustomerReqInfo FROM CustomerReqInfo
- inner Join Customer On Customer.ID_Customer=CustomerReqInfo.ID_Customer
- WHERE CustomerReqInfo.No_CustomerReqInfo < @No_CustomerReqInfo and Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- ORDER BY CustomerReqInfo.No_CustomerReqInfo Desc
- DECLARE @ID_CustomerReqInfo uniqueidentifier
- SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @NextNo
- SELECT CustomerReqInfo.*, Name_User, Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer,Customer.ID_Creator FROM CustomerReqInfo
- LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
- LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
- WHERE CustomerReqInfo.No_CustomerReqInfo = @NextNo
- SELECT CustomerReqProduct.* FROM CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo order by No_CustomerReq">
- <Params>
- <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="CustomerReqInfo" />
- <Table name="CustomerReqProduct" />
- </Tables>
- </SearchPrevious>
- <SearchNext CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_CustomerReqInfo
- SELECT TOP 1 @NextNo = CustomerReqInfo.No_CustomerReqInfo FROM CustomerReqInfo
- inner Join Customer On Customer.ID_Customer=CustomerReqInfo.ID_Customer
- WHERE CustomerReqInfo.No_CustomerReqInfo > @No_CustomerReqInfo
- and Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- ORDER BY CustomerReqInfo.No_CustomerReqInfo
- DECLARE @ID_CustomerReqInfo uniqueidentifier
- SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @NextNo
- SELECT CustomerReqInfo.*, Name_User, Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer,Customer.ID_Creator FROM CustomerReqInfo
- LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
- LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
- WHERE CustomerReqInfo.No_CustomerReqInfo = @NextNo
- SELECT CustomerReqProduct.* FROM CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo order by No_CustomerReq">
- <Params>
- <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="CustomerReqInfo" />
- <Table name="CustomerReqProduct" />
- </Tables>
- </SearchNext>
- <SearchLast CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_CustomerReqInfo
- SELECT TOP 1 @NextNo = CustomerReqInfo.No_CustomerReqInfo FROM CustomerReqInfo
- inner Join Customer On Customer.ID_Customer=CustomerReqInfo.ID_Customer
- where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- ORDER BY CustomerReqInfo.No_CustomerReqInfo DESC
- DECLARE @ID_CustomerReqInfo uniqueidentifier
- SELECT @ID_CustomerReqInfo = ID_CustomerReqInfo FROM CustomerReqInfo WHERE No_CustomerReqInfo = @NextNo
- SELECT CustomerReqInfo.*, Name_User, Customer.No_Customer,Customer.Name_Customer, Customer.ShortName_Customer,Customer.Type_Customer, Customer.PostalCode_Customer,Customer.ID_Creator FROM CustomerReqInfo
- LEFT JOIN Customer ON Customer.ID_Customer = CustomerReqInfo.ID_Customer
- LEFT JOIN AppUser ON AppUser.ID_User = CustomerReqInfo.ID_Creator
- WHERE CustomerReqInfo.No_CustomerReqInfo = @NextNo
-
- SELECT CustomerReqProduct.* FROM CustomerReqProduct WHERE CustomerReqProduct.ID_CustomerReqInfo = @ID_CustomerReqInfo order by No_CustomerReq">
- <Params>
- <Param name="@No_CustomerReqInfo" type="CustomerReqInfo.No_CustomerReqInfo" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="CustomerReqInfo" />
- <Table name="CustomerReqProduct" />
- </Tables>
- </SearchLast>
- <SearchProductWithNo CmdType="Text" CmdText=" SELECT ID_Product, Name_Product, Unit_Product, Type_Product,Property_Product
- FROM Product
- WHERE No_Product = @No_Product">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="Product" />
- </Tables>
- </SearchProductWithNo>
- <SearchManuMethod CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS ManuMethod_Product FROM TypeDef WHERE Type_TypeDef = '28' ">
- <Tables>
- <Table name="ManuMethod" />
- </Tables>
- </SearchManuMethod>
- <SearchMaterial CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Material_CustomerReqProduct FROM TypeDef WHERE Type_TypeDef = '29' ">
- <Tables>
- <Table name="Material" />
- </Tables>
- </SearchMaterial>
- <SearchProcess CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Process_CustomerReqProduct FROM TypeDef WHERE Type_TypeDef = '30' ">
- <Tables>
- <Table name="Process" />
- </Tables>
- </SearchProcess>
- <SearchContinuity CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Continuity_CustomerReqProduct FROM TypeDef WHERE Type_TypeDef = '31' ">
- <Tables>
- <Table name="Continuity" />
- </Tables>
- </SearchContinuity>
- <SearchOil CmdType="Text" CmdText=" SELECT TypeDef.Name_TypeDef AS Oil_CustomerReqProduct FROM TypeDef WHERE Type_TypeDef = '32' ">
- <Tables>
- <Table name="Oil" />
- </Tables>
- </SearchOil>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- timeMake.Enabled = false;
- cbCreateNo.ReadOnly = false;
- txtCreator.ReadOnly = true;
- tbNo.ReadOnly = true;
- txtShortName.ReadOnly = true;
- txtType.ReadOnly = true;
- txtName.ReadOnly = true;
- txtPostalCode.ReadOnly = true;
- cbName.Enabled = false;
- cbTelephone.Enabled = false;
- cbFax.Enabled = false;
- txtSendAddr.ReadOnly = true;
- txtComment.ReadOnly = true;
- dgProduct.ReadOnly = true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableNew=GetRight(@Title,"新增");
- UpdateForm(true, "");
- cbCreateNo.Focus();
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- timeMake.Enabled = true;
- cbCreateNo.ReadOnly = true;
- txtCreator.ReadOnly = true;
- tbNo.ReadOnly = false;
- txtShortName.ReadOnly = true;
- txtType.ReadOnly = true;
- txtName.ReadOnly = true;
- txtPostalCode.ReadOnly = true;
- cbName.Enabled = true;
- cbTelephone.Enabled = true;
- cbFax.Enabled = true;
- txtSendAddr.ReadOnly = false;
- txtComment.ReadOnly = false;
- dgProduct.ReadOnly = false;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableNew=false;
- #CustomerReqInfo.CreateDate_CustomerReqInfo = DateTimeNow();
- #CustomerReqInfo.ID_Creator = GetLoginUserID();
- #CustomerReqInfo.ID_CustomerReqInfo = NewGuid();
- #CustomerReqInfo.Name_User = GetCurrentUser();
-
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=1;
- </New>
- <View>
- timeMake.Enabled = false;
- cbCreateNo.ReadOnly = true;
- txtCreator.ReadOnly = true;
- tbNo.ReadOnly = true;
- txtShortName.ReadOnly = true;
- txtType.ReadOnly = true;
- txtName.ReadOnly = true;
- txtPostalCode.ReadOnly = true;
- cbName.Enabled = false;
- cbTelephone.Enabled = false;
- cbFax.Enabled = false;
- txtSendAddr.ReadOnly = true;
- txtComment.ReadOnly = true;
- dgProduct.ReadOnly = true;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableNew = GetRight(@Title,"新增");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- timeMake.Enabled = true;
- cbCreateNo.ReadOnly = true;
- txtCreator.ReadOnly = true;
- tbNo.ReadOnly = false;
- txtShortName.ReadOnly = true;
- txtType.ReadOnly = true;
- txtName.ReadOnly = true;
- txtPostalCode.ReadOnly = true;
- cbName.Enabled = true;
- cbTelephone.Enabled = true;
- cbFax.Enabled = true;
- txtSendAddr.ReadOnly = false;
- txtComment.ReadOnly = false;
- dgProduct.ReadOnly = false;
- toolBar.EnableSubmit=GetRight(@Title,"修改");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableNew=false;
- #CustomerReqInfo.CreateDate_CustomerReqInfo = DateTimeNow();
- #CustomerReqInfo.ID_Creator = GetLoginUserID();
-
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(!Search("SearchCustomer",tbNo.CValue) || !Equals(#CustomerReqInfo.ID_Customer,#Customer.ID_Customer))
- {
- MessageBox("请输入有效客户编号,并按回车确认!",@Title);
- tbNo.Focus();
- return;
- }
- if (RowCount("#CustomerReqProduct") == 0)
- {
- MessageBox("请输入需求商品!",@Title);
- dgProduct.Focus();
- return;
- }
- UpdateForm(false, "");
- SuspendLayout();
- for(@i=0;@i<RowCount("#CustomerReqProduct");@i=@i+1)
- {
- SetPosition("#CustomerReqProduct",@i);
- if(#CustomerReqProduct.No_CustomerReqProduct == "")
- {
- dgProduct.CurrentRowIndex=@i;
- MessageBox("请输入产品编号!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(#CustomerReqProduct.Name_CustomerReqProduct == "")
- {
- dgProduct.CurrentRowIndex=@i;
- MessageBox("请输入产品编名称!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(#CustomerReqProduct.Quantity_CustomerReqProduct <= 0)
- {
- dgProduct.CurrentRowIndex=@i;
- MessageBox("需求数量不能小于等于0!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(#CustomerReqProduct.Unit_CustomerReqProduct == "")
- {
- dgProduct.CurrentRowIndex=@i;
- MessageBox("请输入基本单位!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(Equals(#CustomerReqProduct.ID_CustomerReqProduct,GuidEmpty()))
- {
- #CustomerReqProduct.ID_CustomerReqProduct = NewGuid();
- }
- #CustomerReqProduct.ID_CustomerReqInfo = #CustomerReqInfo.ID_CustomerReqInfo;
-
- Register_Set("1",#CustomerReqProduct.No_CustomerReqProduct);
- for(@j=@i+1;@j<=RowCount("#CustomerReqProduct")-1;@j=@j+1)
- {
- SetPosition("#CustomerReqProduct",@j);
- if(Equals(Register_Get("1"),#CustomerReqProduct.No_CustomerReqProduct))
- {
- dgProduct.CurrentRowIndex=@j;
- MessageBox("单据中已存在该需求商品,请检查!",@Title);
- Register_Remove("1");
- ResumeLayout();
- return;
- }
- }
- }
- Register_Remove("1");
- ResumeLayout();
- if(@Status==1)
- {
- #CustomerReqInfo.No_CustomerReqInfo = New("#CustomerReqInfo.No_CustomerReqInfo",timeMake.CValue);
- }
- else if(@Status==3)
- {
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|