示例#1
0
        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);
        }
示例#2
0
 private void gridControl_Load()
 {
     db = new Entities();
     KhachHangCtrl.LoadLookUpEdit(rleKhachHang, db);
     NhanVienCtrl.LoadLookUpEdit(rleNhanVienKinhDoanh, db);
     SanPhamCtrl.LoadBindingSource(cATSanPhamBindingSource, db);
 }
示例#3
0
        private void frmKhachHang_Load(object sender, EventArgs e)
        {
            Entities db = new Entities();

            KhachHangCtrl.LoadBindingSource(cATKhachHangBindingSource, db);
            VaiTroQuyenCtrl.ReconfigFormControls(this, db);
            GridHelper.ReconfigGridView(gridView);
        }
示例#4
0
 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);
 }
示例#5
0
        private void LoadcbKhachHang()
        {
            KhachHangCtrl khctr = new KhachHangCtrl();

            cbKH.DataSource    = khctr.getData();
            cbKH.DisplayMember = "TenKH";
            cbKH.ValueMember   = "MaKH";
            cbKH.SelectedIndex = 0;
        }
示例#6
0
        private void UpdateCommand()
        {
            var kh = (CAT_KhachHang)gridView.GetFocusedRow();
            int rs = KhachHangCtrl.Update(kh);

            if (rs == 0)
            {
                NotifyHelper.ShowUpdateError();
                gridControl_Load();
            }
        }
示例#7
0
        // 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);
        }
示例#8
0
        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();
                }
            }
        }
示例#9
0
 private void gridControl_Load()
 {
     KhachHangCtrl.LoadBindingSource(cATKhachHangBindingSource);
 }