private void frmKhuVuc_Load(object sender, EventArgs e) { BUSDoiTac um = new BUSDoiTac(); DataTable dt = um.getKhuVuc(); gridColumn1.FieldName = "MaKhuVuc"; gridColumn2.FieldName = "TenKhuVuc"; gridColumn3.FieldName = "GhiChu"; gridColumn4.FieldName = "ConQuanLy"; gridControl1.DataSource = dt; }
private void frmKhachHang_Add_Load(object sender, EventArgs e) { DataTable dt2 = new DataTable(); BUSDoiTac bus = new BUSDoiTac(); dt2 = bus.getKhuVuc(); if (dt2.Rows.Count > 0) { foreach (DataRow row in dt2.Rows) { comboBoxEdit1.Properties.Items.Add(row["MaKhuVuc"]); } } if (!isAddForm) { BUSDoiTac b = new BUSDoiTac(); DTOKhachHang dtoHangHoa = b.getKhachHangDetail(gotID); textEdit1.Text = dtoHangHoa.MAKH; textEdit2.Text = dtoHangHoa.HOTEN; textEdit3.Text = dtoHangHoa.DiaChi; textEdit4.Text = dtoHangHoa.MaSoThue; textEdit5.Text = dtoHangHoa.Fax; textEdit6.Text = dtoHangHoa.SODT; textEdit7.Text = dtoHangHoa.Mobile; textEdit8.Text = dtoHangHoa.Email; textEdit9.Text = dtoHangHoa.Website; textEdit10.Text = dtoHangHoa.TaiKhoan; textEdit11.Text = dtoHangHoa.NganHang; textEdit12.Text = dtoHangHoa.NickYahoo; textEdit13.Text = dtoHangHoa.NguoiLienHe; textEdit14.Text = dtoHangHoa.NickSkype; comboBoxEdit1.Text = dtoHangHoa.MaKhuVuc; comboBoxEdit2.Text = dtoHangHoa.GioiHanNo; comboBoxEdit3.Text = dtoHangHoa.NoHienTai; comboBoxEdit4.Text = dtoHangHoa.ChietKhau; radioButton1.Checked = dtoHangHoa.DaiLy; radioButton2.Checked = dtoHangHoa.KhachLe; checkEdit1.Checked = dtoHangHoa.ConQuanLy; } else { textEdit1.ReadOnly = false; } }