private void btnUpdateTonKho_Click(object sender, EventArgs e) { for (int i = 0; i < listIDSanPham.Count; i++) { BKIT.Entities.TonKho objTonKho = new BKIT.Entities.TonKho(); objTonKho.IDSanPham = listIDSanPham[i]; objTonKho.SoLuong = listSoLuong[i]; objTonKho.Ngay = DateTime.Now.Date; if (new DataAccess().insertTonKho(objTonKho) <0) { MessageBox.Show(this, "Cập nhật tồn kho không thành công!", "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } ((frmMain)(this.MdiParent)).setStatus("Cập nhật tồn kho thành công"); }
private void btnUpdateTonKho_Click(object sender, EventArgs e) { for (int i = 0; i < listIDSanPham.Count; i++) { BKIT.Entities.TonKho objTonKho = new BKIT.Entities.TonKho(); objTonKho.IDSanPham = listIDSanPham[i]; objTonKho.SoLuong = listSoLuong[i]; objTonKho.Ngay = DateTime.Now.Date; if (new DataAccess().insertTonKho(objTonKho) < 0) { MessageBox.Show(this, "Cập nhật tồn kho không thành công!", "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } ((frmMain)(this.MdiParent)).setStatus("Cập nhật tồn kho thành công"); }