/// <summary> /// name: Quynh /// content: Chinh sua thong tin nhan vien /// </summary> public void Update(eNhanVien entity) { NhanVien nv = db.NhanViens.Where(t => t.maNhanVien.Equals(entity.manhanVien)).SingleOrDefault(); nv.hoTen = entity.hoTen; nv.gioiTinh = entity.gioiTinh; nv.dienThoai = entity.dienThoai; nv.email = entity.email; nv.ngayVaolam = entity.ngayVaolam; nv.soCMND = entity.soCMND; nv.soBaoHiemXH = entity.soBaoHiemXH; nv.viTriCongViec = entity.viTriCongViec; nv.hinhAnh = entity.hinhAnh; db.SubmitChanges(); DiaChi dc = db.DiaChis.Where(t => t.maDiaChi.Equals(entity.diaChi.maDiaChi)).SingleOrDefault(); dc.soNha = entity.diaChi.soNha; dc.phuongXa = entity.diaChi.phuongXa; dc.quanHuyen = entity.diaChi.quanHuyen; dc.thanhPho = entity.diaChi.thanhPho; db.SubmitChanges(); }
/// <summary> /// name: Quynh /// content: them mot dia moi /// </summary> public bool themDiaChi(eDiaChi diaChi) { try { DiaChi dc = new DiaChi(); dc.maDiaChi = diaChi.maDiaChi; dc.soNha = diaChi.soNha; dc.quanHuyen = diaChi.quanHuyen; dc.thanhPho = diaChi.thanhPho; dc.phuongXa = diaChi.phuongXa; db.DiaChis.InsertOnSubmit(dc); db.SubmitChanges(); return(true); } catch (Exception) { return(false); } }
/// <summary> /// name: Quynh /// content: Chinh sua thong tin cua du an trong co so du lieu /// </summary> public void Update(eDuAn entity) { DuAn da = db.DuAns.Where(t => t.maDuAn.Equals(entity.MaDuAn)).SingleOrDefault(); da.tenDuAn = entity.TenDuAn; da.ngayBatDau = entity.NgayBatDau; da.ngayKetThuc = entity.NgayKetThuc; da.tienDoHoanThanh = entity.TienDo; da.trangThai = entity.TrangThai; db.SubmitChanges(); DiaChi dc = db.DiaChis.Where(t => t.maDiaChi.Equals(entity.DiaChi.maDiaChi)).SingleOrDefault(); dc.soNha = entity.DiaChi.soNha; dc.phuongXa = entity.DiaChi.phuongXa; dc.quanHuyen = entity.DiaChi.quanHuyen; dc.thanhPho = entity.DiaChi.thanhPho; db.SubmitChanges(); }