RecordHistoryWrite("FrmCustomer","dtStartBill","dtEndBill","ckNearlyBill","tbNearlyBill","ckQueryPriceBill","ckSaleBill","ckSaleRtnBill","ckInventoryBill","dtStartProduct" ,"dtEndProduct","ckNearlyProduct","tbNearlyProduct","ckQueryPriceProduct","ckSaleProduct","ckSaleRtnProduct","ckInventoryProduct","ckSaleOutDepotBill","ckIndentBill","ckSaleOutDepotProduct","ckIndentProduct"); ; if(tbNo2.CValue != StringEmpty()) { if (tbNo2.CValue.ToUpper()!=tbNo.CValue.ToUpper()) { #Customer.No_Customer = tbNo2.CValue; if(Search("SearchCustomerWithNo2", tbNo2.CValue)) { #Customer.IsCustomersCustomer_Customer = 1; #Customer.CustomerID_Customer = #Customer2.ID_Customer; tbNo2.CValue = #Customer2.No_Customer; txtShortName2.CValue = #Customer2.ShortName_Customer; } else { #Customer.IsCustomersCustomer_Customer = 0; #Customer.CustomerID_Customer = GuidEmpty(); tbNo2.CValue = ""; txtShortName2.CValue = ""; MessageBox("找不到此客户!!"); } #Customer.No_Customer = tbNo.CValue; } else { #Customer.IsCustomersCustomer_Customer = 0; #Customer.CustomerID_Customer = GuidEmpty(); tbNo2.CValue = ""; txtShortName2.CValue = ""; MessageBox("所属客户不可与客户名相同!"); tbNo2.Focus(); } } tbNo2.CValue=""; txtShortName2.CValue=""; @Temp2 = ShowSearchBox("CustomerSearch","INFOMATION",tbNo2.CValue); if( @Temp2 != StringEmpty() ) { tbNo2.CValue = @Temp2; if (tbNo2.CValue!=tbNo.CValue) { if(Search("SearchCustomerWithNo2",tbNo2.CValue)) { #Customer.IsCustomersCustomer_Customer = 1; #Customer.CustomerID_Customer = #Customer2.ID_Customer; tbNo2.CValue = #Customer2.No_Customer; txtShortName2.CValue = #Customer2.ShortName_Customer; } else { #Customer.IsCustomersCustomer_Customer = 0; #Customer.CustomerID_Customer = GuidEmpty(); tbNo2.CValue = ""; txtShortName2.CValue = ""; } } else { #Customer.IsCustomersCustomer_Customer = 0; #Customer.CustomerID_Customer = GuidEmpty(); tbNo2.CValue = ""; txtShortName2.CValue = ""; MessageBox("所属客户不可与客户名相同!"); tbNo2.Focus(); } } if(txtRegistedAddress.CValue!=StringEmpty()) { txtSendAddr.CValue=txtRegistedAddress.CValue; Search("InsertRecord",txtName.CValue,txtRegistedAddress.CValue); MergeTable("#TempInvoice","#Invoice"); } else { MessageBox("请输入客户注册地址!",@Title); } UpdateForm(false,"cbPayLimitType"); Search("SearchPayLimitType"); UpdateForm(true,"cbPayLimitType"); UpdateForm(false, "cbGetMethod"); Search("SearchGetMethodType"); UpdateForm(true, "cbGetMethod"); UpdateForm(false, "comboArea"); Search("SearchAreaType"); UpdateForm(true, "comboArea"); UpdateForm(false, "cbIndustry"); Search("SearchIndustryType"); UpdateForm(true, "cbIndustry"); UpdateForm(false, "cbZone"); Search("SearchZoneType"); UpdateForm(true, "cbZone"); UpdateForm(false, "cbType"); Search("SearchType"); UpdateForm(true, "cbType"); UpdateForm(false, "cbSource"); Search("SearchSourceType"); UpdateForm(true, "cbSource"); UpdateForm(false, "cbLevel"); Search("SearchLevelType"); UpdateForm(true, "cbLevel"); UpdateForm(false, "cbBank"); Search("SearchBankType"); UpdateForm(true, "cbBank"); UpdateForm(false, "cbCompany"); Search("SearchCompanyType"); UpdateForm(true, "cbCompany"); Search("SearchIsMain"); SetDataGridColumnDataSource(0,"dgInvoice"); @SetFlag=1; @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee); if(@temp != "") { ResumeColumnEvent("#Principal.No_Employee"); #Principal.No_Employee = @temp; ClearColumnEvent(); } @SetFlag=0; Search("SearchIsMain"); SetDataGridColumnDataSource(2,"dgPrincipal"); Search("SearchIsMain"); SetDataGridColumnDataSource(0,"dgLinkMan"); if(Search("SearchCustomerWithNo",#CustomerList.No_Customer)) { ChangeMode("View"); } DgDoubleClick(#ExchangeBill.Name_Bill,#ExchangeBill.No_Bill); DgDoubleClick(#ExchangeProduct.Name_Bill,#ExchangeProduct.No_Bill); if(ckDisplay.Checked) Search("SearchAllCustomerList",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()); else Search("SearchCustomerList",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()); if (ikCheckBox2.Enabled == true) { tbNo2.IKButton.Enabled = true; if (ikCheckBox2.Checked == true) { tbNo2.ReadOnly = false; if(Search("SearchCustomerWithNo2", tbNo.CValue)) { #Customer.IsCustomersCustomer_Customer=1; tbNo2.CValue = #Customer2.No2_Customer; txtShortName2.CValue = #Customer2.ShortName2_Customer; } else { #Customer.IsCustomersCustomer_Customer=0; tbNo2.CValue = ""; txtShortName2.CValue = ""; } } else { tbNo2.ReadOnly = true; tbNo2.IKButton.Enabled = false; #Customer.IsCustomersCustomer_Customer=0; #Customer.CustomerID_Customer = GuidEmpty(); tbNo2.CValue = ""; txtShortName2.CValue = ""; } } else { tbNo2.ReadOnly = true; tbNo2.IKButton.Enabled = false; if(ikCheckBox2.Checked == true) if(Search("SearchCustomerWithNo2",tbNo.CValue)) { tbNo2.CValue = #Customer2.No2_Customer; txtShortName2.CValue = #Customer2.ShortName2_Customer; } else { tbNo2.CValue = ""; txtShortName2.CValue = ""; } } cbPayLimitType.SelectedName=""; if(Search("SearchCustomerFirst", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetCurrentUser())) { Empty("#ExchangeProduct"); Empty("#ExchangeBill"); ChangeMode("View"); } cbPayLimitType.SelectedName=""; if(Search("SearchCustomerPrevious", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetCurrentUser())) { Empty("#ExchangeProduct"); Empty("#ExchangeBill"); ChangeMode("View"); } cbPayLimitType.SelectedName=""; if(Search("SearchCustomerNext", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetCurrentUser())) { Empty("#ExchangeProduct"); Empty("#ExchangeBill"); ChangeMode("View"); } cbPayLimitType.SelectedName=""; if(Search("SearchCustomerLast", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetCurrentUser())) { Empty("#ExchangeProduct"); Empty("#ExchangeBill"); ChangeMode("View"); } ; ChangeMode("Search"); ChangeMode("Modify"); Delete(); ChangeMode("Search"); #Customer.CountryName = cbCountry.Text; PrintReport(); ; ; ; ; ; if(toolBar.ExpandForm==true) { pnRight.Visible=true; if(!@HaveSearchCustomerList) { Search("SearchCustomerList",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()); @HaveSearchCustomerList=true; } } else { pnRight.Visible=false; } 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(); } }
if(GetRight("客户基本资料","全权查看")) { FormatString(""); } else { FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID()); }
Empty(); Empty("#ExchangeProduct"); Empty("#ExchangeBill"); NewInstance(); tbNo.ReadOnly=false; txtShortName.ReadOnly=true; txtShortName2.ReadOnly = true; txtName.ReadOnly=true; txtRegistedAddress.ReadOnly=true; cbCountry.Enabled=false; txtPostalCode.ReadOnly=true; cbPayLimitCurrency.Enabled=false; cbPayLimitCurrency.Text=@SysCurrency; tbDunDate.ReadOnly=true; txtSendAddr.ReadOnly=true; dtpIsSuspend.Enabled=false; txtComment.ReadOnly=true; cbIndustry.Enabled=false; cbZone.Enabled=false; cbType.Enabled=false; comboArea.Enabled=false; cbIsGeneric.Enabled=false; cbSource.Enabled=false; cbLevel.Enabled=false; cbBank.Enabled=false; cbCompany.Enabled=false; txtAccount.ReadOnly=true; txtRevenueRegisterNo.ReadOnly=true; cbGetMethod.Enabled=false; txtPayLimit.Enabled=false; cbPayLimitType.Enabled=false; txtPayLimit2.Enabled=false; tbLowDiscount.Enabled=false; ikTextBox1.Enabled=false; txtRemark.Enabled=false; dgInvoice.ReadOnly=true; dgLinkMan.ReadOnly=true; dgPrincipal.ReadOnly=true; dgRemark.ReadOnly = true; dgInfo.ReadOnly = true; toolBar.EnableSubmit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnablePrint=false; tbNo.ReadOnly=false; txtShortName.ReadOnly=true; txtShortName2.ReadOnly=true; txtName.ReadOnly=true; txtRegistedAddress.ReadOnly=true; cbCountry.Enabled=false; txtPostalCode.ReadOnly=true; cbPayLimitCurrency.Enabled=false; tbDunDate.ReadOnly=true; txtSendAddr.ReadOnly=true; dtpIsSuspend.Enabled=false; txtComment.ReadOnly=true; cbIndustry.Enabled=false; cbZone.Enabled=false; cbType.Enabled=false; comboArea.Enabled=false; cbIsGeneric.Enabled=false; cbSource.Enabled=false; cbLevel.Enabled=false; cbBank.Enabled=false; cbCompany.Enabled=false; txtAccount.ReadOnly=true; txtRevenueRegisterNo.ReadOnly=true; cbGetMethod.Enabled=false; txtPayLimit.Enabled=false; txtPayLimit2.Enabled=false; cbPayLimitType.Enabled=false; tbLowDiscount.Enabled=false; ikTextBox1.Enabled=false; txtRemark.Enabled=false; dgInvoice.ReadOnly=true; dgLinkMan.ReadOnly=true; dgPrincipal.ReadOnly=true; dgRemark.ReadOnly = true; dgInfo.ReadOnly = true; tbNo2.ReadOnly = true; tbNo2.IKButton.Enabled = false; txtShortName2.Enabled = false; ikCheckBox2.Enabled = false; dtpBeginDate.Enabled=false; toolBar.EnableSubmit=false; toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); toolBar.EnablePrint=GetRight(@Title,"打印"); if(ckDisplay.Checked) #Customer.IsDisplay=1; else #Customer.IsDisplay=0; UpdateForm(true, ""); txtLinkMan.CValue=""; txtLinkTel.CValue=""; if(RowCount("#Linkman")>0) { SuspendLayout(); for(@i=0;@i < RowCount("#Linkman");@i++) { SetPosition("#Linkman",@i); if(#Linkman.IsMain_Linkman==true) { txtLinkMan.CValue=#Linkman.Name_Linkman; txtLinkTel.CValue=#Linkman.Tel_Linkman; break; } } ResumeLayout(); } pcPhone.ReadOnly=true; pcFax.ReadOnly=true; @Status=2; dtpBeginDate.Enabled=false; #Customer.CreateDate_Customer=DBNull(); #Customer.SuspendDate_Customer=DBNull(); #Customer.LastModUser=DBNull(); #Customer.LastModUser_Customer=DBNull(); #Customer.LastModDate_Customer=DBNull(); if(ckDisplay.Checked) #Customer.IsDisplay=1; else #Customer.IsDisplay=0; UpdateForm(true, ""); txtLinkMan.CValue=""; txtLinkTel.CValue=""; pcPhone.ReadOnly=true; pcFax.ReadOnly=true; tbNo.Focus(); @Status=0; Empty(); NewInstance(); tbNo.ReadOnly=true; txtShortName.ReadOnly=false; txtShortName2.ReadOnly=true; txtName.ReadOnly=false; txtRegistedAddress.ReadOnly=false; cbCountry.Enabled=true; txtPostalCode.ReadOnly=false; cbPayLimitCurrency.Enabled=false; tbDunDate.ReadOnly=false; txtSendAddr.ReadOnly=false; dtpIsSuspend.Enabled=true; txtComment.ReadOnly=false; cbIndustry.Enabled=true; cbGetMethod.Enabled=GetFieldRight(@Title,"结算方式","修改"); txtPayLimit.Enabled=GetFieldRight(@Title,"信用额度","修改"); tbLowDiscount.Enabled=GetFieldRight(@Title,"最低折扣","修改"); ikTextBox1.Enabled=GetFieldRight(@Title,"帐款备注","修改"); tbDunDate.Enabled=GetFieldRight(@Title,"催款日期","修改"); txtPayLimit2.Enabled=GetFieldRight(@Title,"期初余额调整","修改"); txtRemark.Enabled=GetFieldRight(@Title,"备注","修改"); cbPayLimitType.Enabled=GetFieldRight(@Title,"期初余额调整","修改"); cbPayLimitType.SelectedName = "+"; cbZone.Enabled=true; cbType.Enabled=true; comboArea.Enabled=true; cbIsGeneric.Enabled=true; cbSource.Enabled=true; cbLevel.Enabled=true; cbBank.Enabled=true; cbCompany.Enabled=true; txtAccount.ReadOnly=false; txtRevenueRegisterNo.ReadOnly=false; dgInvoice.ReadOnly=false; dgLinkMan.ReadOnly=false; dgPrincipal.ReadOnly=false; dgRemark.ReadOnly = false; dgInfo.ReadOnly = true; toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnablePrint=false; ikCheckBox2.Enabled = true; tbNo2.ReadOnly = true; tbNo2.IKButton.Enabled = false; dtpBeginDate.Enabled=true; #Customer.No_Customer=tbNo.CValue; #Customer.CreatorName_Customer=GetCurrentUser(); #Customer.ID_Customer=NewGuid(); #Customer.ID_Creator=GetLoginUserID(); #Customer.Country_Customer=40; #Customer.CreateDate_Customer=DateTimeNow(); #Customer.SuspendDate_Customer=DBNull(); #Customer.GetMethod_Customer = "先款后贷"; Search("SearchDefaultPhone"); Search("SearchDefaultFax"); MergeTable("#DefaultFax","#Fax"); MergeTable("#DefaultTelephone","#Telephone"); if(ckDisplay.Checked) #Customer.IsDisplay=1; else #Customer.IsDisplay=0; UpdateForm(true, ""); txtLinkMan.CValue=""; txtLinkTel.CValue=""; tbLowDiscount.CValue=100.00; pcPhone.ReadOnly=false; pcFax.ReadOnly=false; txtShortName.Focus(); @Status=1; tbNo.ReadOnly=false; txtShortName.ReadOnly=true; txtShortName2.ReadOnly=true; txtName.ReadOnly=true; txtRegistedAddress.ReadOnly=true; cbCountry.Enabled=false; txtPostalCode.ReadOnly=true; cbPayLimitCurrency.Enabled=false; tbDunDate.ReadOnly=true; txtSendAddr.ReadOnly=true; dtpIsSuspend.Enabled=false; txtComment.ReadOnly=true; cbIndustry.Enabled=false; cbGetMethod.Enabled=false; txtPayLimit.Enabled=false; cbPayLimitType.Enabled=false; txtPayLimit2.Enabled=false; tbLowDiscount.Enabled=false; ikTextBox1.Enabled=false; txtRemark.Enabled=false; cbZone.Enabled=false; cbType.Enabled=false; comboArea.Enabled=false; cbIsGeneric.Enabled=false; cbSource.Enabled=false; cbLevel.Enabled=false; cbBank.Enabled=false; cbCompany.Enabled=false; txtAccount.ReadOnly=true; txtRevenueRegisterNo.ReadOnly=true; dgInvoice.ReadOnly=true; dgLinkMan.ReadOnly=true; dgPrincipal.ReadOnly=true; dgRemark.ReadOnly = true; dgInfo.ReadOnly = true; tbNo2.ReadOnly = true; tbNo2.IKButton.Enabled = false; txtShortName2.Enabled = false; ikCheckBox2.Enabled = false; if(#Customer.OpeningBalanceAdjust_Customer>=0) { cbPayLimitType.SelectedName ="+"; } else { cbPayLimitType.SelectedName ="-"; } if(Search("SearchCustomerWithNo2",tbNo.CValue)) { if( #Customer2.IsCustomersCustomer_Customer) { tbNo2.ReadOnly = true; tbNo2.CValue = #Customer2.No_Customer; txtShortName2.CValue = #Customer2.ShortName_Customer; } else { ikCheckBox2.Checked = false; tbNo2.IKButton.Enabled = false; tbNo2.CValue = ""; txtShortName2.CValue = ""; } } dtpBeginDate.Enabled=false; toolBar.EnableSubmit=false; toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); toolBar.EnablePrint=GetRight(@Title,"打印"); if(ckDisplay.Checked) #Customer.IsDisplay=1; else #Customer.IsDisplay=0; UpdateForm(true, ""); txtLinkMan.CValue=""; txtLinkTel.CValue=""; if(RowCount("#Linkman")>0) { SuspendLayout(); for(@i=0;@i < RowCount("#Linkman");@i++) { SetPosition("#Linkman",@i); if(#Linkman.IsMain_Linkman==true) { txtLinkMan.CValue=#Linkman.Name_Linkman; txtLinkTel.CValue=#Linkman.Tel_Linkman; break; } } ResumeLayout(); } pcPhone.ReadOnly=true; pcFax.ReadOnly=true; @Status=2; tbNo.ReadOnly=true; txtShortName.ReadOnly=false; txtShortName2.ReadOnly=false; txtName.ReadOnly=false; txtRegistedAddress.ReadOnly=false; cbCountry.Enabled=true; txtPostalCode.ReadOnly=false; cbPayLimitCurrency.Enabled=false; tbDunDate.ReadOnly=false; txtSendAddr.ReadOnly=false; dtpIsSuspend.Enabled=true; txtComment.ReadOnly=false; cbIndustry.Enabled=true; cbGetMethod.Enabled=GetFieldRight(@Title,"结算方式","修改"); txtPayLimit.Enabled=GetFieldRight(@Title,"信用额度","修改"); tbLowDiscount.Enabled=GetFieldRight(@Title,"最低折扣","修改"); ikTextBox1.Enabled=GetFieldRight(@Title,"帐款备注","修改"); tbDunDate.Enabled=GetFieldRight(@Title,"催款日期","修改"); txtPayLimit2.Enabled=GetFieldRight(@Title,"期初余额调整","修改"); txtRemark.Enabled=GetFieldRight(@Title,"备注","修改"); cbPayLimitType.Enabled=GetFieldRight(@Title,"期初余额调整","修改"); cbZone.Enabled=true; cbType.Enabled=true; comboArea.Enabled=true; cbIsGeneric.Enabled=true; cbSource.Enabled=true; cbLevel.Enabled=true; cbBank.Enabled=true; cbCompany.Enabled=true; txtAccount.ReadOnly=false; txtRevenueRegisterNo.ReadOnly=false; dgInvoice.ReadOnly=false; dgLinkMan.ReadOnly=false; dgPrincipal.ReadOnly=false; dgRemark.ReadOnly = false; dgInfo.ReadOnly = true; ikCheckBox2.Enabled = true; tbNo2.ReadOnly = false; if(Search("SearchCustomerWithNo2",tbNo.CValue)) { if( #Customer.IsCustomersCustomer_Customer) { ikCheckBox2.Checked = true; tbNo2.IKButton.Enabled = true; tbNo2.ReadOnly = false; } else { ikCheckBox2.Checked = false; tbNo2.IKButton.Enabled = false; tbNo2.ReadOnly = true; } } dtpBeginDate.Enabled=true; toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=GetRight(@Title,"删除"); toolBar.EnablePrint=false; #Customer.LastModUser=GetCurrentUser(); #Customer.LastModUser_Customer=GetLoginUserID(); #Customer.LastModDate_Customer=GetCurrentTime(); if(ckDisplay.Checked) #Customer.IsDisplay = 1; else #Customer.IsDisplay = 0; UpdateForm(true, ""); pcPhone.ReadOnly=false; pcFax.ReadOnly=false; txtShortName.Focus(); @Status=3; 31) { tcOperMan.SelectedIndex=0; MessageBox("请输入有效的催款日期!",@Title); tbDunDate.Focus(); return; } if(tbDunDate.CValue<0||tbDunDate.CValue>31) { tcOperMan.SelectedIndex=0; MessageBox("请输入正确的日期范围!",@Title); cbGetMethod.Focus(); return; } if(cbGetMethod.SelectedName=="") { tcOperMan.SelectedIndex=0; MessageBox("请输入结算方式!",@Title); cbGetMethod.Focus(); return; } if(!cbPayLimitType.CheckSelectedItem()) { MessageBox("请输入有效的期初余额调整方式!",@Title); cbPayLimitType.Focus(); return; } if(cbType.SelectedName=="") { tcOperMan.SelectedIndex=1; MessageBox("请输入客户类别!",@Title); cbType.Focus(); return; } if((cbIndustry.SelectedName=="")) { tcOperMan.SelectedIndex=1; MessageBox("请输入行业!",@Title); cbIndustry.Focus(); return; } if(cbZone.SelectedName=="") { tcOperMan.SelectedIndex=1; MessageBox("请输入地区!",@Title); cbZone.Focus(); return; } if(cbSource.SelectedName=="") { tcOperMan.SelectedIndex=1; MessageBox("请输入客户来源!",@Title); cbSource.Focus(); return; } if(cbCompany.SelectedName=="") { tcOperMan.SelectedIndex=1; MessageBox("请选择所属公司!",@Title); cbCompany.Focus(); return; } if(comboArea.SelectedName=="") { MessageBox("请选择所属区域!",@Title); comboArea.Focus(); return; } #Customer.PayLimitCurrency=cbPayLimitCurrency.Text; 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 = #Customer.ID_Customer; } 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())) { dgPrincipal.CurrentRowIndex=@i; tcOperMan.SelectedIndex=2; MessageBox("该员工不存在!",@Title); ResumeLayout(); return; } #Principal.ID_Person = #Customer.ID_Customer; } 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=#Customer.ID_Customer; } 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=#Customer.ID_Customer; } for(@i=0;@i 1) { MessageBox("只能有一个主要负责人,请检查!",@Title); return; } if(cbPayLimitType.SelectedName=="+") { #Customer.OpeningBalanceAdjust_Customer = txtPayLimit2.CValue; } if(cbPayLimitType.SelectedName=="-") { #Customer.OpeningBalanceAdjust_Customer = -txtPayLimit2.CValue; } 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 = #Customer.ID_Customer; } 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())) { dgPrincipal.CurrentRowIndex=@i; tcOperMan.SelectedIndex=2; MessageBox("该员工不存在!",@Title); ResumeLayout(); return; } #Principal.ID_Person = #Customer.ID_Customer; } 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=#Customer.ID_Customer; } 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=#Customer.ID_Customer; } for(@i=0;@i 1) { MessageBox("只能有一个主要负责人,请检查!",@Title); return; } if(cbPayLimitType.SelectedName=="+") { #Customer.OpeningBalanceAdjust_Customer = +txtPayLimit2.CValue; } if(cbPayLimitType.SelectedName=="-") { #Customer.OpeningBalanceAdjust_Customer = -txtPayLimit2.CValue; } Update(); } ChangeMode("View"); ]]>