public bool updateInfoDOANVIEN(DOANVIEN dv) { try { using (QLHTDOANVIENDataContext db = new QLHTDOANVIENDataContext()) { DOANVIEN data = db.DOANVIENs.Single(p => p.MASODV == dv.MASODV); if (data != null) { data.CMND = dv.CMND; data.HOLOT = dv.HOLOT; data.TEN = dv.TEN; data.NAM = dv.NAM; data.NGUYENQUAN = dv.NGUYENQUAN; data.DANTOC = dv.DANTOC; data.TONGIAO = dv.TONGIAO; data.CMNV = dv.CMNV; data.LLCT = dv.LLCT; data.NGAYVAODOAN = dv.NGAYVAODOAN; data.NGAYVAODANG = dv.NGAYVAODANG; data.NGAYCAPNHAT = dv.NGAYCAPNHAT; data.GHICHU = dv.GHICHU; data.HASHING = dv.HASHING; db.SubmitChanges(); return(true); } } } catch (Exception) { } return(false); }
public bool addInfo(DOANVIEN doanVien) { try { using (QLHTDOANVIENDataContext db = new QLHTDOANVIENDataContext()) { db.DOANVIENs.InsertOnSubmit(doanVien); db.SubmitChanges(); } } catch (Exception e) { Console.Write(e.Message.ToString()); return(false); } return(true); }
public bool deleteInfoDOANVIEN(DOANVIEN dv) { try { using (QLHTDOANVIENDataContext db = new QLHTDOANVIENDataContext()) { DOANVIEN data = db.DOANVIENs.FirstOrDefault(p => p.MASODV == dv.MASODV); db.DOANVIENs.DeleteOnSubmit(data); db.SubmitChanges(); return(true); } } catch (Exception) { } return(false); }
public bool insertChiTiet(THAMDUDAIHOI data) { try { using (QLHTDOANVIENDataContext db = new QLHTDOANVIENDataContext()) { db.THAMDUDAIHOIs.InsertOnSubmit(data); db.SubmitChanges(); return(true); } } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } return(false); }
public bool addDaiHoi(DAIHOI dh) { try { using (QLHTDOANVIENDataContext db = new QLHTDOANVIENDataContext()) { db.DAIHOIs.InsertOnSubmit(dh); db.SubmitChanges(); } } catch (Exception e) { Console.Write(e.Message.ToString()); return(false); } return(true); }
public bool setStatus(Guid idDV, Guid idDH) { THAMDUDAIHOI data = new THAMDUDAIHOI(); try { using (QLHTDOANVIENDataContext db = new QLHTDOANVIENDataContext()) { data = db.THAMDUDAIHOIs.Where(p => p.MASODH == idDH && p.MASODV == idDV).SingleOrDefault(); if (data != null) { data.TRANGTHAI = true; db.SubmitChanges(); return(true); } } } catch (Exception) { } return(false); }