public string SinhMaTuDong(string tenbang, string tenma, string MaBatDau) { KhachHangCtrl nvCtrl = new KhachHangCtrl(); int id = 0; bool dung = false; string ma = ""; DataTable dt = new DataTable(); while (dung == false) { dt = CheckID(tenbang, tenma, MaBatDau + id.ToString()); if (dt.Rows.Count == 0) { dung = true; } else { id++; dung = false; } } ma = MaBatDau + id.ToString(); return(ma); }
private void gridControl_Load() { db = new Entities(); KhachHangCtrl.LoadLookUpEdit(rleKhachHang, db); NhanVienCtrl.LoadLookUpEdit(rleNhanVienKinhDoanh, db); SanPhamCtrl.LoadBindingSource(cATSanPhamBindingSource, db); }
private void frmKhachHang_Load(object sender, EventArgs e) { Entities db = new Entities(); KhachHangCtrl.LoadBindingSource(cATKhachHangBindingSource, db); VaiTroQuyenCtrl.ReconfigFormControls(this, db); GridHelper.ReconfigGridView(gridView); }
private void frmSanPham_Load(object sender, EventArgs e) { db = new Entities(); KhachHangCtrl.LoadLookUpEdit(rleKhachHang, db); NhanVienCtrl.LoadLookUpEdit(rleNhanVienKinhDoanh, db); SanPhamCtrl.LoadBindingSource(cATSanPhamBindingSource, db); VaiTroQuyenCtrl.ReconfigFormControls(this, db); GridHelper.ReconfigGridView(gridView); }
private void LoadcbKhachHang() { KhachHangCtrl khctr = new KhachHangCtrl(); cbKH.DataSource = khctr.getData(); cbKH.DisplayMember = "TenKH"; cbKH.ValueMember = "MaKH"; cbKH.SelectedIndex = 0; }
private void UpdateCommand() { var kh = (CAT_KhachHang)gridView.GetFocusedRow(); int rs = KhachHangCtrl.Update(kh); if (rs == 0) { NotifyHelper.ShowUpdateError(); gridControl_Load(); } }
// xu ly LoadcmbKhachHang private void LoadcmbKhachHang() { KhachHangCtrl khctr = new KhachHangCtrl(); cmbKhachHang.DataSource = khctr.GetData(); cmbKhachHang.DisplayMember = "TenKH"; cmbKhachHang.ValueMember = "MaKH"; cmbKhachHang.SelectedIndex = 0; //KhachHangObj khObj = new KhachHangObj(); //addData1(khObj); //Diem2 = khCtr.abbDiem(khObj); }
private void DeleteCommand() { if (gridView.FocusedRowHandle < 0) { return; } var result = NotifyHelper.ShowDeleteConfirm(); if (result == DialogResult.Yes) { var khachHang = (CAT_KhachHang)gridView.GetFocusedRow(); int rs = KhachHangCtrl.Delete(khachHang.ID_khach_hang); if (rs > 0) { gridControl_Load(); } else { NotifyHelper.ShowDeleteError(); } } }
private void gridControl_Load() { KhachHangCtrl.LoadBindingSource(cATKhachHangBindingSource); }