protected void SetCompanyData(FishEntity.CompanyEntity company) { if (company == null) { return; } txtCompanyName.Text = company.fullname; txtCompanyCode.Text = company.code; txtCompanyCode.Tag = company.id; txtLevel.Text = company.generallevel; txtAddress.Text = company.address; txtLinkMan.Text = string.Empty; txtLinkManCode.Text = string.Empty; txtCustomerNature.Text = company.customerproperty; txtSaleman.Text = company.salesman; txttransportfee.Text = company.freight.ToString(); txtweight.Text = company.tare.ToString(); txtspecifacation.Text = company.requiredproduct; txtQuality.Text = company.productrequire; txtProducts.Text = company.products; txtcompetitors.Text = company.competitors; txtWeek.Text = company.currentweekestimate.ToString(); txtMonth.Text = company.currentmonthestimate.ToString(); FishBll.Bll.CustomerBll customerBll = new FishBll.Bll.CustomerBll(); List <FishEntity.CustomerEntity> customers = customerBll.GetCustomerOfCompany(company.id); if (customers != null && customers.Count > 0) { FishEntity.CustomerEntity customer = customers.Find((i) => { return(i.flag == 1); }); if (customer != null) { txtLinkMan.Text = customer.name; txtLinkManCode.Text = customer.code; txtLinkMan.Tag = customer.id; string phone = string.IsNullOrEmpty(customer.phone1) ? "" : customer.phone1; if (!string.IsNullOrEmpty(customer.phone2)) { phone += string.IsNullOrEmpty(phone) ? customer.phone2 : " , " + customer.phone2; } if (!string.IsNullOrEmpty(customer.phone3)) { phone += string.IsNullOrEmpty(phone) ? customer.phone3 : " , " + customer.phone3; } txtMobile.Text = phone; txtOfficeTel.Text = customer.telephone; } } }
public FormSelectCustomer(int companyId) { InitializeComponent(); this.Text = "请选择联系人"; _companyId = companyId; FishBll.Bll.CustomerBll bll = new FishBll.Bll.CustomerBll(); List <FishEntity.CustomerEntity> list = bll.GetCustomerOfCompany(_companyId); dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = list; dataGridView1.BackgroundColor = this.BackColor; }
public FormSelectCustomer(string companycode) { InitializeComponent(); ReadColumnConfig(dataGridView1, "Set_SelectCustomer"); this.Text = "请选择联系人"; _companycode = companycode; FishBll.Bll.CustomerBll bll = new FishBll.Bll.CustomerBll(); List <FishEntity.CustomerEntity> list = bll.GetCustomerOfCompany(_companycode); dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = list; dataGridView1.BackgroundColor = this.BackColor; }
private void txtCustomer_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } txtCustomer.Text = form.SelectCompany.fullname; txtCustomer.Tag = form.SelectCompany.code; FishBll.Bll.CustomerBll bll = new FishBll.Bll.CustomerBll(); List <FishEntity.CustomerEntity> mans = bll.GetCustomerOfCompany(form.SelectCompany.id); if (mans == null) { mans = new List <FishEntity.CustomerEntity>(); } cmbTheperson.SelectedValue = form.SelectCompany.salesman; cmbTheperson.Tag = form.SelectCompany.salesmancode; panel2.Controls.Clear(); foreach (FishEntity.CustomerEntity item in mans) { CheckBox chk = new CheckBox(); chk.Text = item.name.Trim(); chk.Tag = item; chk.AutoSize = true; chk.Checked = false; chk.Dock = DockStyle.Left; panel2.Controls.Add(chk); } }