Пример #1
0
 public ActionResult Edit([Bind(Include = "MaQuyen,TenQuyen,GhiChu")] PhanQuyen phanQuyen)
 {
     if (ModelState.IsValid)
     {
         db.Entry(phanQuyen).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(phanQuyen));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "MaPB,TenPB,SoDT,NguoiSua,NgaySua")] PhongBan phongBan)
 {
     if (ModelState.IsValid)
     {
         db.Entry(phongBan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(phongBan));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "MaNhanVien,NgayNghi,Phep,NguoiDuyet,NgaySua,GhiChu")] Nghi nghi)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nghi).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaNhanVien = new SelectList(db.NhanViens, "MaNhanVien", "HoTen", nghi.MaNhanVien);
     return(View(nghi));
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "MaCTThuong,MaNhanVien,HoTen,TenPB,MaLoaiThuong,TrangThai,NguoiSua,NgaySua,NguoiThuong,NgayThuong")] Ct_Thuong ct_Thuong)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ct_Thuong).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaNhanVien   = new SelectList(db.NhanViens, "MaNhanVien", "HoTen", ct_Thuong.MaNhanVien);
     ViewBag.MaLoaiThuong = new SelectList(db.LoaiThuongs.Where(x => x.TrangThai == true), "MaLoaiThuong", "TenLoaiThuong", ct_Thuong.MaLoaiThuong);
     return(View(ct_Thuong));
 }
Пример #5
0
 public ActionResult Edit([Bind(Include = "MaCTPhat,MaNhanVien,MaLoaiPhat,TrangThai,NguoiSua,NgaySua,NguoiPhat,NgayPhat")] Ct_Phat ct_Phat)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ct_Phat).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaLoaiPhat = new SelectList(db.LoaiPhats.Where(x => x.TrangThai == true), "MaLoaiPhat", "TenLoaiPhat", ct_Phat.MaLoaiPhat);
     ViewBag.MaNhanVien = new SelectList(db.NhanViens, "MaNhanVien", "HoTen", ct_Phat.MaNhanVien);
     return(View(ct_Phat));
 }
Пример #6
0
 public ActionResult Edit([Bind(Include = "MaNhanVien,HoTen,NgaySinh,GioiTinh,QueQuan,DiaChi,CMND,Email,SDT,HinhAnh,MaChucVu,MaPB,TrangThai,NguoiSua,NgaySua,NguoiTao,NgayTao")] NhanVien nhanVien)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nhanVien).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaChucVu   = new SelectList(db.ChucVus.Where(x => x.TrangThai == true), "MaChucVu", "TenChucVu", nhanVien.MaChucVu);
     ViewBag.MaPB       = new SelectList(db.PhongBans.Where(x => x.MaPB != 12), "MaPB", "TenPB", nhanVien.MaPB);
     ViewBag.MaNhanVien = new SelectList(db.TaiKhoans, "MaNhanVien", "TenTK", nhanVien.MaNhanVien);
     return(View(nhanVien));
 }
 public ActionResult Edit([Bind(Include = "MaNhanVien,TenTK,MatKhau,MaQuyen,ResetPasswordCode")] TaiKhoan taiKhoan)
 {
     //try
     //{
     if (ModelState.IsValid)
     {
         db.Entry(taiKhoan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MaNhanVien = new SelectList(db.NhanViens, "MaNhanVien", "HoTen", taiKhoan.MaNhanVien);
     ViewBag.MaQuyen    = new SelectList(db.PhanQuyens.Where(a => a.MaQuyen != 3), "MaQuyen", "TenQuyen", taiKhoan.MaQuyen);
     return(View(taiKhoan));
     //}catch
     //{
     //    this.AddNotification("Vui lòng nhập đủ thông tin...", NotificationType.ERROR);
     //    ViewBag.MaNhanVien = new SelectList(db.NhanViens, "MaNhanVien", "HoTen", taiKhoan.MaNhanVien);
     //    ViewBag.MaQuyen = new SelectList(db.PhanQuyens.Where(a => a.MaQuyen != 3), "MaQuyen", "TenQuyen", taiKhoan.MaQuyen);
     //    return View(taiKhoan);
     //}
 }