private void frmThemLichSuGia_Load(object sender, EventArgs e) { txtNgayCapNhat.Text = DateTime.Now.ToString("dd/MM/yyyy") + ""; cboMaHang.DataSource = bulHang.layTatCaHang(); cboMaHang.DisplayMember = "tenHang"; cboMaHang.ValueMember = "maHang"; }
private Hang kiemTraTonTai(string ma) { foreach (Hang item in bulHang.layTatCaHang()) { if (item.MaHang == ma) { return(item); } } return(null); }
private void txtMaHang_TextChanged(object sender, EventArgs e) { BULHang = new BULHang(); foreach (Hang x in BULHang.layTatCaHang()) { if (x.MaHang == txtMaHang.Text) { txtDonGia.Text = Convert.ToString(x.DonGia); } } }
private bool kiemTraTonTai(string ma) { foreach (Hang item in bulHang.layTatCaHang()) { if (item.MaHang == ma) { return(true); } } return(false); }
private void frmXoaLichSuGia_Load(object sender, EventArgs e) { txtNgayCapNhat.Text = DateTime.Now.ToString("dd/MM/yyyy") + ""; cboMaHang.DataSource = bulHang.layTatCaHang(); cboMaHang.DisplayMember = "tenHang"; cboMaHang.ValueMember = "maHang"; if (lichSu.MaHang != "") { cboMaHang.SelectedValue = lichSu.MaHang; txtNgayBatDau.Text = lichSu.NgayBatDau; dtNgayBatDau.Text = txtNgayBatDau.Text; } arrLSG = bulLSG.layTatCaLichSuGia(); }
private void btnTimHang_Click(object sender, EventArgs e) { Hang hang = new Hang(); hang.MaHang = txtHang.Text; BULHang bulHang = new BULHang(); if (txtHang.Text == "") { dgvHang.DataSource = bulHang.layTatCaHang(); } else { dgvHang.DataSource = bulHang.timKiem(hang); } }
private void loadDuLieu() { BULLoaiHang bulLoaiHang = new BULLoaiHang(); dgvLoaiHang.DataSource = bulLoaiHang.layTatCaLoaiHang(); dgvLoaiHang.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dgvLoaiHang.Columns[0].HeaderText = "Mã loại"; dgvLoaiHang.Columns[1].HeaderText = "Tên loại"; dgvLoaiHang.Columns[2].HeaderText = "Ghi chú"; BULHang bulHang = new BULHang(); dgvHang.DataSource = bulHang.layTatCaHang(); dgvHang.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dgvHang.Columns[0].HeaderText = "Mã hàng"; dgvHang.Columns[1].HeaderText = "Tên hàng"; dgvHang.Columns[2].HeaderText = "Đơn vị tính"; dgvHang.Columns[3].HeaderText = "Đơn giá"; dgvHang.Columns[4].HeaderText = "Mã loại"; dgvHang.Columns[5].HeaderText = "Số lượng có"; dgvHang.Columns[6].HeaderText = "Mã nhà cung cấp"; }