public ActionResult Edit([Bind(Include = "Id,Gender1")] Gender gender)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gender).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(gender));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,Name,TypeId")] Institution institution)
 {
     if (ModelState.IsValid)
     {
         db.Entry(institution).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TypeId = new SelectList(db.InstitutionTypes, "id", "Type", institution.TypeId);
     return(View(institution));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "Id,Name,Email,CampusId")] Department department)
 {
     if (ModelState.IsValid)
     {
         db.Entry(department).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CampusId = new SelectList(db.Campus1, "Id", "Name", department.CampusId);
     return(View(department));
 }
 public ActionResult Edit([Bind(Include = "Id,Name,Surname,Phone,Email,Subject,Enquiry,Address,BookId,AllowSeller")] Seller seller)
 {
     if (ModelState.IsValid)
     {
         db.Entry(seller).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BookId = new SelectList(db.Books, "Id", "Title", seller.BookId);
     return(View(seller));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "Id,UserId,BookId,GuardianName,GuardianSurname,GuardianID,GuardianCell,GuardianAddress,HasPenalty,DateOfRent,DateOfReturn,ExpectedDate")] Rental rental)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rental).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BookId = new SelectList(db.Books, "Id", "Title", rental.BookId);
     ViewBag.UserId = new SelectList(db.Users, "UserId", "FirstName", rental.UserId);
     return(View(rental));
 }
 public ActionResult Edit([Bind(Include = "UserId,FirstName,LastName,Email,ID_Number,Address,Phone,GenderId,InstitutionId,Password,IsEmailVerified,ActivationCode,ForrgotPasswordCode")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GenderId      = new SelectList(db.Genders, "Id", "Gender1", user.GenderId);
     ViewBag.InstitutionId = new SelectList(db.Institutions, "Id", "Name", user.InstitutionId);
     return(View(user));
 }
 public ActionResult Edit([Bind(Include = "Id,Name,Address,Email,InstitutionId")] Campus campus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(campus).State = EntityState.Modified;
         db.SaveChanges();
         TempData["successMessage"] = $"Campus successfully Updated";
         return(RedirectToAction("Index"));
     }
     ViewBag.InstitutionId = new SelectList(db.Institutions, "Id", "Name", campus.InstitutionId);
     return(View(campus));
 }
示例#8
0
 public ActionResult Edit([Bind(Include = "Id,Name,LastName,StudentNumber,Email,PhoneNumber,GenderId,Address,InstitutionId,IdentityNumber,Password,DOB")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GenderId      = new SelectList(db.Genders, "Id", "Gender1", student.GenderId);
     ViewBag.InstitutionId = new SelectList(db.Institutions, "Id", "Name", student.InstitutionId);
     return(View(student));
 }
 public ActionResult Edit([Bind(Include = "Id,Title,CategoryId,InstitutionId,ISBN,Author,Edition,Publisher,ModuleCode,ConditionId,Price,Description,Image")] Book book)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId    = new SelectList(db.Categories, "Id", "Category1", book.CategoryId);
     ViewBag.ConditionId   = new SelectList(db.Conditions, "Id", "Condition1", book.ConditionId);
     ViewBag.InstitutionId = new SelectList(db.Institutions, "Id", "Name", book.InstitutionId);
     return(View(book));
 }