public void Luu_PhieuBanHang(TextBox MaPBH, ComboBox MaKH, ComboBox MaNV, DateTimePicker NgayLap, TextBox TT) { PhieuBanHangData pbhdata = new PhieuBanHangData(); DataTable dt = pbhdata.LayDSPBH(); DataRow row = dt.NewRow(); row[0] = MaPBH.Text; row[1] = MaKH.SelectedValue; row[2] = MaNV.SelectedValue; row[3] = NgayLap.Value.Date; row[4] = TT.Text; dt.Rows.Add(row); pbhdata.Update(); }
public void Luu_CTPhieuBanHang(ListView lv) { PhieuBanHangData pbhdata = new PhieuBanHangData(); DataTable dt = pbhdata.LayDSCTPBH(); foreach (ListViewItem item in lv.Items) { DataRow row = dt.NewRow(); row[0] = item.SubItems[1].Text.ToString(); row[1] = item.SubItems[6].Text.ToString(); row[2] = item.SubItems[3].Text.ToString(); row[3] = item.SubItems[4].Text.ToString(); row[4] = item.SubItems[5].Text.ToString(); dt.Rows.Add(row); } pbhdata.Update(); }