Example #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,CodeName,Description,PossibleStartDate,PossibleEndDate,Duration,Status")] Project project)
 {
     if (ModelState.IsValid)
     {
         db.Entry(project).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(project));
 }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Role role)
 {
     if (ModelState.IsValid)
     {
         db.Entry(role).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(role));
 }
Example #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,Email,DefaultPassword,UserStatus,RoleId")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RoleId = new SelectList(db.Roles, "Id", "Name", user.RoleId);
     return(View(user));
 }
Example #4
0
 public ActionResult Edit([Bind(Include = "Id,Description,DueDate,Priority,ProjectId,UserId")] ProjectTask projecttask)
 {
     if (ModelState.IsValid)
     {
         db.Entry(projecttask).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProjectId = new SelectList(db.Projects, "Id", "Name", projecttask.ProjectId);
     ViewBag.UserId    = new SelectList(db.Users, "Id", "Name", projecttask.UserId);
     return(View(projecttask));
 }
 public ActionResult Edit([Bind(Include = "Id,UserId,ProjectId")] UserProject userproject)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userproject).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProjectId = new SelectList(db.Projects, "Id", "Name", userproject.ProjectId);
     ViewBag.UserId    = new SelectList(db.Users, "Id", "Name", userproject.UserId);
     return(View(userproject));
 }
Example #6
0
 public ActionResult Edit([Bind(Include = "Id,ProjectId,TaskId,CommentedBy")] Comment comment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comment).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProjectId   = new SelectList(db.Projects, "Id", "Name", comment.ProjectId);
     ViewBag.TaskId      = new SelectList(db.ProjectTasks, "Id", "Description", comment.TaskId);
     ViewBag.CommentedBy = new SelectList(db.Users, "Id", "Name", comment.CommentedBy);
     return(View(comment));
 }