예제 #1
0
        private void frmHangHoa_Load(object sender, EventArgs e)
        {
            if (mode == MODE_ADDNEW)
            {
                initThem();
            }
            else
            {
                initSua();
            }

            _dtLoaiHang  = LoaiHangService.LoadDataTable();
            _dtDonViTinh = DonViTinhService.LoadDataTable();

            lookUpEditLoaiHang.Properties.DataSource    = _dtLoaiHang;
            lookUpEditLoaiHang.Properties.ValueMember   = "MaLoaiHang";
            lookUpEditLoaiHang.Properties.DisplayMember = "TenLoaiHang";
            lookUpEditLoaiHang.Properties.Columns.Add(new LookUpColumnInfo("MaLoaiHang", "Mã Loại Hàng"));
            lookUpEditLoaiHang.Properties.Columns.Add(new LookUpColumnInfo("TenLoaiHang", "Tên Loại Hàng"));

            lookUpEditDonViTinh.Properties.DataSource    = _dtDonViTinh;
            lookUpEditDonViTinh.Properties.ValueMember   = "MaDVT";
            lookUpEditDonViTinh.Properties.DisplayMember = "TenDVT";
            lookUpEditDonViTinh.Properties.Columns.Add(new LookUpColumnInfo("MaDVT", "Mã Đơn Vị Tính"));
            lookUpEditDonViTinh.Properties.Columns.Add(new LookUpColumnInfo("TenDVT", "Tên Đơn Vị Tính"));
        }
예제 #2
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            frmDonViTinh f = new frmDonViTinh();

            f.ShowDialog();
            grcDonViTinhSearch.DataSource = DonViTinhService.LoadDataTable();
        }
예제 #3
0
        private void reload(object sender, FormClosingEventArgs e)
        {
            frmHangHoa f = (frmHangHoa)sender;

            if (f.isDataChanged == true)
            {
                grcHanghoaSearch.DataSource = DonViTinhService.LoadDataTable();
            }
        }
예제 #4
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            string key = txtMaDVTSearch.Text;

            if (key.Trim() != "")
            {
                grcDonViTinhSearch.DataSource = DonViTinhService.Search(key);
            }
            else
            {
                grcDonViTinhSearch.DataSource = DonViTinhService.LoadDataTable();
            }
        }
예제 #5
0
 private void txtMaDVTSearch_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         string key = txtMaDVTSearch.Text;
         if (key.Trim() != "")
         {
             grcDonViTinhSearch.DataSource = DonViTinhService.Search(key);
         }
         else
         {
             grcDonViTinhSearch.DataSource = DonViTinhService.LoadDataTable();
         }
     }
 }
예제 #6
0
        //Button Lưu Đơn Vị Tính Mới
        private void btnLuu_Click(object sender, EventArgs e)
        {
            var dt = grcDonViTinh.DataSource as DataTable;

            if (dt == null || dt.GetChanges() == null)
            {
                return;
            }
            if (DonViTinhService.SaveChanges(dt))
            {
                XtraMessageBox.Show("Lưu thành công", "Lưu", MessageBoxButtons.OK, MessageBoxIcon.Information);
                grcDonViTinh.DataSource = DonViTinhService.LoadDataTable();
            }
            else
            {
                XtraMessageBox.Show("Lưu thất bại", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #7
0
        private void frmHangHoaSearch_Load(object sender, EventArgs e)
        {
            grcHanghoaSearch.DataSource = HangHoaService.LoadDataTable();

            _dtLoaiHang  = LoaiHangService.LoadDataTable();
            _dtDonViTinh = DonViTinhService.LoadDataTable();

            LookUpEditLoaiHang.DataSource    = _dtLoaiHang;
            LookUpEditLoaiHang.ValueMember   = "MaLoaiHang";
            LookUpEditLoaiHang.DisplayMember = "TenLoaiHang";
            LookUpEditLoaiHang.Columns.Add(new LookUpColumnInfo("MaLoaiHang", "Mã Loại Hàng"));
            LookUpEditLoaiHang.Columns.Add(new LookUpColumnInfo("TenLoaiHang", "Tên Loại Hàng"));

            LookUpEditDonViTinh.DataSource    = _dtDonViTinh;
            LookUpEditDonViTinh.ValueMember   = "MaDVT";
            LookUpEditDonViTinh.DisplayMember = "TenDVT";
            LookUpEditDonViTinh.Columns.Add(new LookUpColumnInfo("MaDVT", "Mã Đơn Vị Tính"));
            LookUpEditDonViTinh.Columns.Add(new LookUpColumnInfo("TenDVT", "Tên Đơn Vị Tính"));
        }
예제 #8
0
        private void frmHangHoa_Load(object sender, EventArgs e)
        {
            if (mode == MODE_ADDNEW)
            {
                initThem();
            }
            else
            {
                initSua();
            }
            tedMaHangHoa.ReadOnly = true;
            lueLoaiHang.Properties.ValueMember   = "MaLoaiHang";
            lueLoaiHang.Properties.DisplayMember = "TenLoaiHang";
            lueLoaiHang.Properties.Columns.Add(new LookUpColumnInfo("TenLoaiHang", "Tên Loại Hàng"));
            lueLoaiHang.Properties.DataSource = LoaiHangService.LoadDataTable();

            lueDonViTinh.Properties.ValueMember   = "MaDVT";
            lueDonViTinh.Properties.DisplayMember = "TenDVT";
            lueDonViTinh.Properties.Columns.Add(new LookUpColumnInfo("TenDVT", "Tên Đơn Vị Tính"));
            lueDonViTinh.Properties.DataSource = DonViTinhService.LoadDataTable();
        }
예제 #9
0
        private void grcDonViTinh_Load(object sender, EventArgs e)
        {
            var dt = DonViTinhService.LoadDataTable();

            grcDonViTinh.DataSource = dt;
        }
예제 #10
0
 //Hàm load dữ liệu
 private void frmDonViTinh_Load(object sender, EventArgs e)
 {
     grcDonViTinh.DataSource     = DonViTinhService.LoadDataTable();
     gridView.Columns[0].Visible = false;
     gridView.Columns[1].Caption = @"Tên đơn vị tính";
 }
예제 #11
0
 private void frmDonViTinhSearch_Load(object sender, EventArgs e)
 {
     grcDonViTinhSearch.DataSource = DonViTinhService.LoadDataTable();
 }