示例#1
0
 public ActionResult Edit([Bind(Include = "id,MaNV,HoatDong,Bang")] log log)
 {
     if (ModelState.IsValid)
     {
         db.Entry(log).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaNV = new SelectList(db.NhanViens, "MaNV", "HoTen", log.MaNV);
     return(View(log));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "MaNV,HoTen,NgaySinh,Email,Password,TrangThai,ChucVu,Quyen")] NhanVien nhanVien)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nhanVien).State = EntityState.Modified;
         db.SaveChanges();
         db.SaveLog(SessionHelper.GetSession().id, "Sửa thông tin nhân viên mã số:" + nhanVien.MaNV, "Nhân viên");
         return(RedirectToAction("Index"));
     }
     ViewBag.Quyen = new SelectList(db.PhanQuyens, "MaQuyen", "Ten", nhanVien.Quyen);
     return(View(nhanVien));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "MaBL,MaCV,MaNV,BinhLuan1")] BinhLuan binhLuan)
 {
     if (ModelState.IsValid)
     {
         db.Entry(binhLuan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaCV = new SelectList(db.CongViecs, "MaCV", "TieuDe", binhLuan.MaCV);
     ViewBag.MaNV = new SelectList(db.NhanViens, "MaNV", "HoTen", binhLuan.MaNV);
     return(View(binhLuan));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "MaCV,TieuDe,NgayBatDau,NgayKetKhuc,TrangThai,PhamVi")] CongViec congViec)
 {
     if (ModelState.IsValid)
     {
         db.Entry(congViec).State = EntityState.Modified;
         db.SaveChanges();
         db.SaveLog(SessionHelper.GetSession().id, "Đã sửa thông tin công việc: " + congViec.MaCV + "_" + congViec.TieuDe, "Công việc");
         return(RedirectToAction("Index"));
     }
     ViewBag.TrangThai = new SelectList(db.TrangThais, "Ma", "TinhTrang", congViec.TrangThai);
     return(View(congViec));
 }
        public ActionResult Edit([Bind(Include = "MaNV,MaCV,TrangThai")] ChiTietCV_NV chiTietCV_NV)
        {
            if (ModelState.IsValid)
            {
                db.Entry(chiTietCV_NV).State = EntityState.Modified;
                db.SaveChanges();

                db.SaveLog(SessionHelper.GetSession().id, "Đã cập nhật trạng thái công việc: " + chiTietCV_NV.MaCV + " cho công việc" + chiTietCV_NV.CongViec.TieuDe, "Công việc");
                return(RedirectToAction("Index", new { id = chiTietCV_NV.MaCV }));
            }
            ViewBag.MaCV      = new SelectList(db.CongViecs, "MaCV", "TieuDe", chiTietCV_NV.MaCV);
            ViewBag.MaNV      = new SelectList(db.NhanViens, "MaNV", "HoTen", chiTietCV_NV.MaNV);
            ViewBag.TrangThai = new SelectList(db.TrangThais, "Ma", "TinhTrang", chiTietCV_NV.TrangThai);
            return(View(chiTietCV_NV));
        }