예제 #1
0
 public ActionResult Edit([Bind(Include = "DepartmentId,DepartmentName")] Department department)
 {
     if (ModelState.IsValid)
     {
         db.Entry(department).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(department));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,DepID,customerName,password,tel,email")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepID = new SelectList(db.Departments, "DepartmentId", "DepartmentName", user.DepID);
     return(View(user));
 }
예제 #3
0
 public ActionResult Edit(User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepID = new SelectList(db.Departments, "DepartmentId", "DepartmentName", user.DepID);
     return(View(user));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "Id,Name,Pid,PValue,Url")] Permissions permissions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(permissions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Pid = new SelectList(db.Permissionss, "Id", "Name", permissions.Pid);
     return(View(permissions));
 }