private void btn_Lapphieutra_Click(object sender, EventArgs e) { DonTraHangCC a = new DonTraHangCC() { NgayLap = DateTime.Now, Nguoilap = this.NhanVien.ID, NhaCC = ((NhaCungCap)comb_NCC.SelectedItem).ID, LyDo = txt_lyDo.Text }; DonTraHangCC rs = DonTraHangCC_BUL.Them(a); if (rs != null) { if (ChiTietDonTraHang_BUL.ThemList(rs.ID, this.ListCTTH)) { MessageSucess(); } else { MesageFaild(); } } else { MesageFaild(); } }
private void display_ct2(int ID) { DataTable table = new DataTable(); table.Columns.Add("ID Hàng"); table.Columns.Add("Số Lượng"); if (cob2.SelectedIndex == 0) { List <ChiTietDonNhapHang> list = ChiTietDonNhapHang_BUL.getAllList_IDDN(ID); foreach (ChiTietDonNhapHang tr in list) { table.Rows.Add(tr.IDHangHoa, tr.SoLuong); } } else if (cob2.SelectedIndex == 1) { List <ChiTietDonTraHangNCC> list = ChiTietDonTraHang_BUL.getAllList_IDDT(ID); foreach (ChiTietDonTraHangNCC tr in list) { table.Rows.Add(tr.IDHangHoa, tr.SoLuong); } } dtgvct2.DataSource = table; }