示例#1
0
 public IActionResult UpdateOne(Fric_frac.Models.FricFrac.Role Role)
 {
     if (ModelState.IsValid)
     {
         try
         {
             dbContext.Update(Role);
             dbContext.SaveChanges();
             ViewBag.Roles = dbContext.Role.ToList();
             return(View("ReadingOne", Role));
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!dbContext.Role.Any(e => e.Id == Role.Id))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
     }
     return(View("Index", Role));
 }
示例#2
0
        public IActionResult InsertOne(Fric_frac.Models.FricFrac.Role Role)
        {
            ViewBag.Message = "Fric-frac Role Inserting One";

            dbContext.Role.Add(Role);
            dbContext.SaveChanges();
            return(View("Index", dbContext.Role.ToList()));
        }