Esempio n. 1
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());
     }
 }
Esempio n. 2
0
        private void FrmDanhMucLoaiMatHang_Load(object sender, EventArgs e)
        {
            DataTable dt = blLoaiThucPham.LayDanhSachLoaiThucPham();

            Refesh(dt);
        }