Exemplo n.º 1
0
        private void FrmTuyChonNhapHang_Load(object sender, EventArgs e)
        {
            blLoaiThucPham = new BL_LoaiThucPham(this);
            blThucPham     = new BL_ThucPham(this);
            blNhapHang     = new BL_NhapHang(this);
            LoadLoaiThucPham();
            TaoMoibang();
            //Nếu số hóa đơn là 0 thì là thêm mới
            if (v == 0)
            {
                txtSoHoaDon.Text           = v.ToString();
                txtSoHoaDon.Visible        = false;
                lbSoHoaDonNhapHang.Visible = false;
                dtpNgayTaoHoaDon.Text      = DateTime.Now.ToShortDateString();
            }
            else //Sửa hóa đơn cũ
            {
                txtSoHoaDon.Text    = v.ToString();
                txtSoHoaDon.Enabled = false;
                DataTable result = blNhapHang.LayDuLieuHoaDonNhap(v);

                txtTenHoaDon.Text     = result.Rows[0][1].ToString();
                dtpNgayTaoHoaDon.Text = result.Rows[0][2].ToString();
                //Show lên datagridview
                result = blNhapHang.LayDuLieuChiTietHoaDonNhap(v);
                RefeshMatHangNhap(result);
                matHangNhap = result;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Tạo hàm dựng cho form Sử dụng dịch vụ với tham số là quyền truyền vào
 /// </summary>
 /// <param name="quyen"></param>
 public FrmSuDungDichVu(int quyen)
 {
     InitializeComponent();
     blBan          = new BL_Ban(this);
     blHoaDon       = new BL_HoaDon(this);
     blLoaiThucPham = new BL_LoaiThucPham(this);
     blThucPham     = new BL_ThucPham(this);
     blNhanVien     = new BL_NhanVien(this);
     blKhachHang    = new BL_KhachHang(this);
     blKhuyenMai    = new BL_KhuyenMai(this);
     this.quyen     = quyen;
 }
Exemplo n.º 3
0
 private void FrmTuyChonMatHang_Load(object sender, EventArgs e)
 {
     blThucPham     = new BL_ThucPham(this);
     blLoaiThucPham = new BL_LoaiThucPham(this);
     blNhaCungCap   = new BL_NhaCungCap(this);
     //Load combobox Loại Thực phẩm
     cbxLoaiThucPham.DataSource    = blLoaiThucPham.LayDanhSachLoaiThucPham();
     cbxLoaiThucPham.DisplayMember = "TenLoaiThucPham";
     cbxLoaiThucPham.ValueMember   = "ID_LOAITHUCPHAM";
     //Load combobox nhà cung cấp
     cbxNhaCungCap.DataSource    = blNhaCungCap.LayDuLieuNhaCungCap();
     cbxNhaCungCap.DisplayMember = "TenNhaCungCap";
     cbxNhaCungCap.ValueMember   = "ID_NhaCungCap";
     if (v != 1)
     {
         txtIDMatHang.Text             = dataGridViewRow.Cells["IDTHUCPHAM"].Value.ToString();
         cbxLoaiThucPham.SelectedValue = Int32.Parse(dataGridViewRow.Cells["ID_LOAITHUCPHAM"].Value.ToString());
         txtTenThucPham.Text           = dataGridViewRow.Cells["TenThucPham"].Value.ToString();
         txtDonViTinh.Text             = dataGridViewRow.Cells["DonViTinh"].Value.ToString();
         txtDonGia.Text = dataGridViewRow.Cells["GiaBan"].Value.ToString();
         cbxNhaCungCap.SelectedValue = Int32.Parse(dataGridViewRow.Cells["ID_NHACUNGCAP"].Value.ToString());
     }
 }
Exemplo n.º 4
0
 public FrmBaoCaoKho()
 {
     InitializeComponent();
     blLoaiThucPham = new BL_LoaiThucPham(this);
     blThucPham     = new BL_ThucPham(this);
 }
Exemplo n.º 5
0
 public FrmMatHang()
 {
     InitializeComponent();
     blThucPham = new BL_ThucPham(this);
 }