private void LoadMaBangThongKe() { BangThongKeGopYBUS bangThongKeGopYBUS = new BangThongKeGopYBUS(); List <int> BTK = bangThongKeGopYBUS.getMaBangTK(); /*format column size*/ cbMaThongKe.DataSource = BTK; cbMaThongKe.DisplayMember = "MABANGTHONGKE"; cbMaThongKe.ValueMember = "MABANGTHONGKE"; }
private void btnXacNhanThongKe_Click(object sender, EventArgs e) { BangThongKeGopYBUS bangThongKeGopYBUS = new BangThongKeGopYBUS(); int mabangtk = bangThongKeGopYBUS.insert(0, int.Parse(txtNhanVienNhapHang.Text.Split(',')[0]), DateTime.Now); List <GopYDTO> data = (List <GopYDTO>)grvAllComments.DataSource; ChiTietBangThongKeGopYBUS chiTietBangThongKeGopYBUS = new ChiTietBangThongKeGopYBUS(); if (data != null) { foreach (var item in data) { #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' if (item.MaGopY != null) #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' { chiTietBangThongKeGopYBUS.Insert(mabangtk, item.MaGopY); } } LoadMaBangThongKe(); } MessageBox.Show("Đã thêm vào bảng thống kê"); }