public void Luu_PhieuDatHang(TextBox MaPDH, ComboBox MaNCC, ComboBox MaNV, DateTimePicker NgayLap) { PhieuDatHangData PDHDATA = new PhieuDatHangData(); DataTable dt = PDHDATA.LayPDH(); DataRow row = dt.NewRow(); row[0] = MaPDH.Text; row[1] = MaNCC.SelectedValue.ToString(); row[2] = MaNV.SelectedValue.ToString(); row[3] = NgayLap.Value.Date; dt.Rows.Add(row); PDHDATA.Update(); }
public void Luu_CTPhieuDatHang(ListView listview) { PhieuDatHangData PDHDATA = new PhieuDatHangData(); DataTable dt = PDHDATA.LayCT_PDH(); foreach (ListViewItem item in listview.Items) { DataRow row = dt.NewRow(); row[0] = item.SubItems[1].Text.ToString(); row[1] = item.SubItems[4].Text.ToString(); row[2] = item.SubItems[3].Text.ToString(); dt.Rows.Add(row); } PDHDATA.Update(); }