예제 #1
0
 public ActionResult Edit([Bind(Include = "MAND,TENND,MATKHAU")] Nguoidung nguoidung)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nguoidung).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nguoidung));
 }
 public ActionResult Sua([Bind(Include = "MASV,HOSV,TENSV,ANHDAIDIEN,QUEQUAN,NGAYSINHSV,CMNDSV,DIEM_TBTL,SDTSV,SDT_PHUHUYNH,EMAIL,DIACHI_SV,DIACHI_THUONGTRU,GIOITINH,TRANGTHAISV,MACN")] Sinhvien sinhvien)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sinhvien).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("DanhsachSinhvien"));
     }
     ViewBag.MACN = new SelectList(db.Chuyennganhs, "MACN", "TENCN", sinhvien.MACN);
     return(View(sinhvien));
 }
 public ActionResult Sua(Detai detai)
 {
     if (ModelState.IsValid)
     {
         db.Entry(detai).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("DanhsachDetai"));
     }
     ViewBag.MALDT = new SelectList(db.LoaiDTs, "MALDT", "TENLDT", detai.MALDT);
     return(View(detai));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "SoPGDT,Ngaygiao,Hannop,MASV,MADT,MAGV")] Phieugiaodetai phieugiaodetai)
 {
     if (ModelState.IsValid)
     {
         db.Entry(phieugiaodetai).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MASV = new SelectList(db.Sinhviens, "MASV", "HOSV", phieugiaodetai.MASV);
     ViewBag.MADT = new SelectList(db.Detais, "MADT", "TENDT", phieugiaodetai.MADT);
     ViewBag.MAGV = new SelectList(db.Giangviens, "MAGV", "HOGV", phieugiaodetai.MAGV);
     return(View(phieugiaodetai));
 }
 public ActionResult Sua(Giangvien giangvien)
 {
     if (ModelState.IsValid)
     {
         db.Entry(giangvien).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("DanhsachGiangvien", "Giangvien"));
     }
     ViewBag.MACV = new SelectList(db.Chucvus, "MACV", "TENCV", giangvien.MACV);
     ViewBag.MACN = new SelectList(db.Chuyennganhs, "MACN", "TENCN", giangvien.MACN);
     ViewBag.MADV = new SelectList(db.Donvis, "MADV", "TENDV", giangvien.MADV);
     ViewBag.MAHV = new SelectList(db.Hocvis, "MAHV", "TENHV", giangvien.MAHV);
     return(View(giangvien));
 }