コード例 #1
0
 public IActionResult OnPost()
 {
     //  using (var db = new SpartaDB())
     //  {
     if (!ModelState.IsValid)
     {
         return(Page());
     }
     db.Entry(CohortSelected).Property(x => x.CohortName).IsModified       = true;
     db.Entry(CohortSelected).Property(x => x.SpecialisationID).IsModified = true;
     db.SaveChanges();
     // }
     return(RedirectToPage("ViewCohort"));
 }
コード例 #2
0
 public IActionResult OnPost()
 {
     //  using (var db = new SpartaDB())
     //  {
     if (!ModelState.IsValid)
     {
         return(Page());
     }
     db.Entry(RoleSelected).Property(x => x.RoleName).IsModified = true;
     db.SaveChanges();
     // }
     return(RedirectToPage("ViewUsers"));
 }
コード例 #3
0
 public IActionResult OnPost()
 {
     //  using (var db = new SpartaDB())
     //  {
     if (!ModelState.IsValid)
     {
         return(Page());
     }
     db.Entry(UserSelected).Property(x => x.FirstName).IsModified = true;
     db.Entry(UserSelected).Property(x => x.LastName).IsModified  = true;
     db.Entry(UserSelected).Property(x => x.Email).IsModified     = true;
     db.Entry(UserSelected).Property(x => x.Password).IsModified  = true;
     db.Entry(UserSelected).Property(x => x.CohortID).IsModified  = true;
     db.Entry(UserSelected).Property(x => x.RoleID).IsModified    = true;
     db.SaveChanges();
     // }
     return(RedirectToPage("ViewUsers"));
 }