public void hienthi() { DataTable dt = thucthi.getAll(); if (dt != null) { dgvSanPham.DataSource = dt; dgvSanPham.Columns[0].HeaderText = "Mã sản phẩm"; dgvSanPham.Columns[1].HeaderText = "Tên sản phẩm"; dgvSanPham.Columns[2].HeaderText = "Số lượng"; dgvSanPham.Columns[3].HeaderText = "Giá bán"; dgvSanPham.Columns[4].HeaderText = "Đơn vị tính"; dgvSanPham.Columns[5].HeaderText = "Mã Nhà sản xuất"; dgvSanPham.Columns[6].HeaderText = "Hệ điều hành"; dgvSanPham.Columns[7].HeaderText = "CPU"; dgvSanPham.Columns[8].HeaderText = "Ram"; dgvSanPham.Columns[9].HeaderText = "Pin"; dgvSanPham.Columns[10].HeaderText = "Kết nối"; dgvSanPham.Columns[11].HeaderText = "Bộ nhớ"; dgvSanPham.Columns[12].HeaderText = "Camera"; } else { MessageBox.Show(thucthi.Error, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmCTHDB_Load(object sender, EventArgs e) { loaddata(); BU_SanPham sp = new BU_SanPham(); cbxMaHang.DataSource = sp.getAll(); cbxMaHang.DisplayMember = "TENSP"; cbxMaHang.ValueMember = "MASP"; DataTable tb = sp.tkMa(cbxMaHang.SelectedValue.ToString()); foreach (DataRow row in tb.Rows) { txtDonGia.Text = row["DONGIABAN"].ToString(); } }
private void frmCTHDN_Load(object sender, EventArgs e) { BU_SanPham sp = new BU_SanPham(); cbsanpham.DataSource = sp.getAll(); cbsanpham.DisplayMember = "TENSP"; cbsanpham.ValueMember = "MASP"; loadData(); DataTable tb = sp.tkMa(cbsanpham.SelectedValue.ToString()); foreach (DataRow row in tb.Rows) { txtdg.Text = row["DONGIABAN"].ToString(); } }