public void FillTheCustomerInfo(custVendor.CustVendorManager.custvendorinfo custInfo) { AutoCompleteStringCollection contactSource = new AutoCompleteStringCollection(); if (custInfo.contact1.Length != 0) { tbContact.Text = custInfo.contact1; contactSource.Add(custInfo.contact1); } if (custInfo.contact2.Length != 0) { contactSource.Add(custInfo.contact2); } tbContact.AutoCompleteMode = AutoCompleteMode.SuggestAppend; tbContact.AutoCompleteSource = AutoCompleteSource.CustomSource; tbContact.AutoCompleteCustomSource = contactSource; tbCustomerAccount.Text = custInfo.cvnumber; tbFreightTerm.Text = custInfo.shippingTerm; tbPaymentTerm.Text = custInfo.paymentTerm; tbBillto.Text = custInfo.billTo; List <custVendor.CustVendorManager.custvendorinfoshipto> shipToList = custVendor.CustVendorManager.CustVenInfoManager.GetShipTo(custInfo.cvId); List <string> shipToListString = new List <string>(); foreach (custVendor.CustVendorManager.custvendorinfoshipto shipto in shipToList) { shipToListString.Add(shipto.shipTo); } SetShipToList(shipToListString); }
private void tbCustomer_Leave(object sender, EventArgs e) { if (tbCustomer.Text.Trim().Length == 0) { return; } custVendor.CustVendorManager.custvendorinfo cInfo = custVendor.CustVendorManager.CustVenInfoManager.GetUniqueCustVenInfo(0, tbCustomer.Text.Trim(), UserInfo.UserId); if (cInfo == null || cInfo.cvnumber == null || cInfo.cvnumber.Trim().Length == 0) { MessageBox.Show("The SO can not be Created/Update.The necessary Customer Info did not exist in DB. Please add the customer in the Customer Managerment menu Or ask finance for Customer Number.\n\r Note:the Customer Name copied, you can CTR+V."); if (tbCustomer.Text.Trim().Length > 0) { Clipboard.SetText(tbCustomer.Text.Trim()); } this.tbCustomer.Text = string.Empty; this.tbCustomer.Focus(); return; } FillTheCustomerInfo(cInfo); }
public void FillTheVendorInfo(custVendor.CustVendorManager.custvendorinfo custInfo) { this.tbVendorNumber.Text = custInfo.cvnumber; this.tbPaymentTerms.Text = custInfo.paymentTerm; this.tbBillTo.Text = custInfo.billTo; if (custInfo.contact1 != null && custInfo.contact1.Trim().Length > 0) { this.tbContact.Text = custInfo.contact1; if (custInfo.contact2 != null && custInfo.contact2.Trim().Length > 0)//两者都有值 { this.tbContact.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this.tbContact.AutoCompleteSource = AutoCompleteSource.CustomSource; AutoCompleteStringCollection autoSource = new AutoCompleteStringCollection(); autoSource.Add(custInfo.contact1); autoSource.Add(custInfo.contact2); tbContact.AutoCompleteCustomSource = autoSource; } } else if (custInfo.contact2 != null && custInfo.contact2.Trim().Length > 0) { this.tbContact.Text = custInfo.contact2; } else { } List <custVendor.CustVendorManager.custvendorinfoshipto> shipToList = custVendor.CustVendorManager.CustVenInfoManager.GetShipTo(custInfo.cvId); List <string> shipToListString = new List <string>(); foreach (custVendor.CustVendorManager.custvendorinfoshipto shipto in shipToList) { shipToListString.Add(shipto.shipTo); } SetShipToList(shipToListString); }