public bool Kiemtrasutontai(string map) { Tbl_PhieuQLKho qlk = DB.Tbl_PhieuQLKhos.Where(x => x.maPhieuQL == map).FirstOrDefault(); if (qlk == null) { return(false); } return(true); }
public bool DeletePhieuQLK(ePhieuQLiKho delid) { try { Tbl_PhieuQLKho deletema = DB.Tbl_PhieuQLKhos.Single(x => x.maPhieuQL == delid._maPhieuQli); DB.Tbl_PhieuQLKhos.DeleteOnSubmit(deletema); DB.SubmitChanges(); return(true); } catch { return(false); } }
public int AddAllPhieuQLK(ePhieuQLiKho newpqlk) { if (Kiemtrasutontai(newpqlk._maPhieuQli)) { return(0); } Tbl_PhieuQLKho pqlk = new Tbl_PhieuQLKho(); pqlk.maPhieuQL = newpqlk._maPhieuQli; pqlk.ngayLapQL = newpqlk._ngayLapQLi; pqlk.maNV = newpqlk._maNV; pqlk.tinhTrang = newpqlk._tinhTrang; pqlk.msKho = newpqlk._maKho; DB.Tbl_PhieuQLKhos.InsertOnSubmit(pqlk); DB.SubmitChanges(); return(1); }
public bool UpDatePhieuQLK(ePhieuQLiKho updatepqlk) { try { Tbl_PhieuQLKho pqlk = DB.Tbl_PhieuQLKhos.Single(x => x.maPhieuQL == updatepqlk._maPhieuQli); pqlk.maPhieuQL = updatepqlk._maPhieuQli; pqlk.maNV = updatepqlk._maNV; pqlk.ngayLapQL = Convert.ToDateTime(updatepqlk._ngayLapQLi); pqlk.tinhTrang = updatepqlk._tinhTrang; pqlk.msKho = updatepqlk._maKho; DB.SubmitChanges(); return(true); } catch { return(false); } }
public bool AddAllPhieuQLK(ePhieuQLiKho newpqlk) { try { Tbl_PhieuQLKho pqlk = DB.Tbl_PhieuQLKhos.Single(x => x.maPhieuQL == newpqlk._maPhieuQli); pqlk.maPhieuQL = newpqlk._maPhieuQli; pqlk.ngayLapQL = Convert.ToDateTime(newpqlk._ngayLapQLi); pqlk.maNV = newpqlk._maNV; pqlk.tinhTrang = newpqlk._tinhTrang; DB.Tbl_PhieuQLKhos.InsertOnSubmit(pqlk); DB.SubmitChanges(); return(true); } catch { return(false); } }