// Function Load database to grid wiew private void loadDataTable() { table_customer.DataSource = new BindingSource(customers.GetAll(), ""); table_customer.MainView.PopulateColumns(); ((GridView)table_customer.MainView).Columns[0].Caption = "Mã khách hàng"; ((GridView)table_customer.MainView).Columns[1].Caption = "Tên khách hàng"; ((GridView)table_customer.MainView).Columns[2].Caption = "Số CMND"; ((GridView)table_customer.MainView).Columns[3].Caption = "Nghề nghiệp"; ((GridView)table_customer.MainView).Columns[4].Caption = "Chức vụ"; ((GridView)table_customer.MainView).Columns[5].Caption = "Địa chỉ"; ((GridView)table_customer.MainView).Columns[6].Visible = false; ((GridView)table_customer.MainView).Columns[7].Visible = false; }
// Load bảng khách hàng để chọn private void table_customer_Load(object sender, EventArgs e) { table_customer.DataSource = new BindingSource(customer.GetAll(), ""); table_customer.MainView.PopulateColumns(); ((GridView)table_customer.MainView).Columns[0].Caption = "Mã khách hàng"; ((GridView)table_customer.MainView).Columns[1].Caption = "Tên khách hàng"; ((GridView)table_customer.MainView).Columns[2].Caption = "Số CMND"; ((GridView)table_customer.MainView).Columns[3].Caption = "Nghề nghiệp"; ((GridView)table_customer.MainView).Columns[4].Visible = false; ((GridView)table_customer.MainView).Columns[5].Visible = false; ((GridView)table_customer.MainView).Columns[6].Visible = false; ((GridView)table_customer.MainView).Columns[7].Visible = false; }
private void LoadAll() { LoadCustomer(customerBUS.GetAll()); LoadRegister(invoiceRegisterBUS.GetAll()); LoadPhoneNumber(phoneNumberBUS.GetAll()); LoadSim(simBUS.GetAll()); LoadPostage(postageBUS.GetAll()); LoadPeriod(periodBUS.GetAll()); LoadPhoneCallDetail(phoneCallDetailBUS.GetAll()); GetComboboxPhoneNumber(cbxRegisterPhoneNumber, true); GetComboboxPhoneNumber(cbxRegisterPhoneNumberSearch, false); GetComboboxPhoneNumber(cbxViewPhoneNumberPhoneNoSearch, false); GetComboboxPhoneNumber(cbxSimPhoneNumberSearch, false); GetComboboxPhoneNumber(cbxSimPhoneNumber, false); GetComboboxPhoneNumber(cbxPhoneCallDetailPhoneNumber, false); GetComboboxActiveSim(cbxSimActive, simBUS.GetActiveSim()); }
private void LoadCustomer() { ctBUS = new CustomerBUS(); int GroupID = 0; GroupID = int.Parse(drlNhomMail.SelectedValue.ToString()); if (getUserLogin().DepartmentId == 1) { // customerBySelect = ctBUS.GetAll(); customerBySelect = ctBUS.GetAll(txtName.Text.Trim(), txtPhone.Text.Trim(), txtEmail.Text.Trim(), GroupID); } else { customerBySelect = ctBUS.GetAllByUserAssignTo(getUserLogin().UserId, GroupID, txtName.Text.Trim(), txtEmail.Text.Trim(), txtPhone.Text.Trim()); } try { dlPager.MaxPages = 1000; dlPager.PageSize = 50; dlPager.DataSource = customerBySelect.DefaultView; dlPager.BindToControl = dtlCustomer; this.dtlCustomer.DataSource = dlPager.DataSourcePaged; this.dtlCustomer.DataBind(); } catch (Exception ex) { logs.Error(userLogin.Username + "-Client - LoadCustomer", ex); } }
void loadFromData() { _listCustomer = CustomerBUS.GetAll(); listCustomer.ItemsSource = _listCustomer; }