/// <summary> /// 绑定数据 /// </summary> public void getCustomerLoad(int provinceId, int cityId, int county, string pageIndexAndCount) { try { //ResultModelOfArrayOfModel_Customerd4FqxSXX count = cs.GetCustomerListByRole(Enum_Role.Sender, true, provinceId, true, cityId, true, null); //ResultModelOfint result = cs.GetCustomerListByRoleCount(Enum_Role.Sender, true, provinceId, true, cityId, true); //winFormPager1.DrawControl(count.Data.Count<Model_Customer>()); //ResultModelOfArrayOfModel_Customerd4FqxSXX customer = cs.GetCustomerListByRole(Enum_Role.Sender, true, provinceId, true, cityId, true, pageIndexAndCount); ResultModelOfint result = cs.GetCustomerListByCountyCount(Enum_Role.Sender, true, provinceId, true, cityId, true, county, true); winFormPager1.DrawControl(result.Data); ResultModelOfArrayOfModel_Customerd4FqxSXX customer = cs.GetCustomerListByCounty(Enum_Role.Sender, true, provinceId, true, cityId, true, county, true, pageIndexAndCount); //if (count.Data.Count<Model_Customer>()<=0) if (result.Data <= 0) { contextMenuStrip1.Enabled = false; } else { contextMenuStrip1.Enabled = true; } if (customer.Code != 0) { MessageBox.Show(customer.Message); } else { dataGridView1.AutoGenerateColumns = false; dataGridView1.Rows.Clear(); foreach (Model_Customer item in customer.Data) { int rowIndex = dataGridView1.Rows.Add(); dataGridView1.Rows[rowIndex].Cells[0].Value = item.Idk__BackingField; dataGridView1.Rows[rowIndex].Cells[1].Value = item.FullNamek__BackingField; dataGridView1.Rows[rowIndex].Cells[2].Value = item.ContactPersonk__BackingField; dataGridView1.Rows[rowIndex].Cells[3].Value = item.Accountk__BackingField; dataGridView1.Rows[rowIndex].Cells[4].Value = item.ContactTelk__BackingField; dataGridView1.Rows[rowIndex].Cells[5].Value = item.ProvinceNamek__BackingField + "-" + item.CityNamek__BackingField + "-" + item.CountyNamek__BackingField; dataGridView1.Rows[rowIndex].Cells[6].Value = item.ContactAddressk__BackingField; dataGridView1.Rows[rowIndex].Cells[7].Value = item.CreateAtk__BackingField.ToString("yyyy-MM-dd HH:mm:ss"); if (item.Activedk__BackingField == Enum_Active.Enabled) { dataGridView1.Rows[rowIndex].Cells[8].Value = "启用"; } else { dataGridView1.Rows[rowIndex].Cells[8].Value = "停用"; } dataGridView1.Rows[rowIndex].Cells[9].Value = item.Remarkk__BackingField.Split('|')[1]; dataGridView1.Rows[rowIndex].Tag = item; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void getCustomerLoad() { try { //ResultModelOfArrayOfModel_Customerd4FqxSXX byroel = cs.GetCustomerListByRole(Enum_Role.Administrator, true, 0, true, 0, true, null); ResultModelOfArrayOfModel_Customerd4FqxSXX byroel = cs.GetCustomerListByCounty(Enum_Role.Administrator, true, 0, true, 0, true, 0, true, null); if (byroel.Code != 0) { MessageBox.Show(byroel.Message); } else { foreach (Model_Customer item in byroel.Data) { txtCustomerFullName.Text = item.FullNamek__BackingField; txtCustomerAccount.Text = item.Accountk__BackingField; txtContacts.Text = item.ContactPersonk__BackingField; txtContactNumber.Text = item.ContactTelk__BackingField; cmbProvince.Text = item.ProvinceNamek__BackingField; cmbCity.Text = item.CityNamek__BackingField; cmbCounty.Text = item.CountyNamek__BackingField; txtContactAddress.Text = item.ContactAddressk__BackingField; txtRemarks.Text = item.Remarkk__BackingField; //cumerid = item.Idk__BackingField; //cumername = item.FullNamek__BackingField; // cus.Idk__BackingField = item.Idk__BackingField; cus.FullNamek__BackingField = item.FullNamek__BackingField; cus.CreateAtk__BackingField = item.CreateAtk__BackingField; // winFormPager1_PageChanged(item); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }