Ejemplo n.º 1
0
        private void GiaBanForm_Load(object sender, System.EventArgs e)
        {
            dgvGiaBan.AutoGenerateColumns = false;
            FillGiaBanToDataGridView();
            tabControl1.TabPages.Remove(tabThemSuaGiaBan);

            var sanPhams = _sanPhamService.GetAllSanPham();

            cbSanPham.DataSource    = sanPhams;
            cbSanPham.DisplayMember = "TenSanPham";
            cbSanPham.ValueMember   = "Id";

            var khachHangs = _khachHangService.GetAllKhachHang();

            cbKhachHang.DataSource    = khachHangs;
            cbKhachHang.DisplayMember = "HoTen";
            cbKhachHang.ValueMember   = "Id";
        }
Ejemplo n.º 2
0
        private void btThemHoaDon_Click(object sender, EventArgs e)
        {
            if (!tabControl1.TabPages.Contains(tabThemSuaHoaDon))
            {
                tabControl1.TabPages.Add(tabThemSuaHoaDon);
                tabThemSuaHoaDon.Text   = QT_Messages.ThemGiaBanText;
                tabControl1.SelectedTab = tabThemSuaHoaDon;

                var khachHangs = _khachHangService.GetAllKhachHang();
                cbKhachHang.DataSource    = khachHangs;
                cbKhachHang.DisplayMember = "HoTen";
                cbKhachHang.ValueMember   = "Id";

                sanPham.DataSource    = _sanPhamService.GetAllSanPham();
                sanPham.DisplayMember = "TenSanPham";
                sanPham.ValueMember   = "Id";

                delete.Text = "Delete";
                delete.UseColumnTextForButtonValue = true;
            }
        }
Ejemplo n.º 3
0
        private void FillKhachHangToDataGridView()
        {
            var khachHangs = _khachHangService.GetAllKhachHang();

            dgvKhachHang.DataSource = khachHangs;
        }