Пример #1
0
 public IActionResult Create(Room Room)
 {
     if (ModelState.IsValid)
     {
         _context.Rooms.Add(Room);
         _context.SaveChanges();
         return(RedirectToAction(nameof(Edit), new { id = Room.Id }));
     }
     return(View(Room));
 }
Пример #2
0
 public IActionResult Create(Role role)
 {
     if (ModelState.IsValid)
     {
         _context.Roles.Add(role);
         _context.SaveChanges();
         //return RedirectToAction(nameof(Edit), new { id = Room.Id });
     }
     return(View(role));
 }
 public IActionResult Create(Department department)
 {
     if (ModelState.IsValid)
     {
         _context.Departments.Add(department);
         _context.SaveChanges();
         return(RedirectToAction(nameof(Edit), new { id = department.Id }));
     }
     return(View());
 }
 public IActionResult Create(Person person)
 {
     if (ModelState.IsValid)
     {
         _context.People.Add(person);
         _context.SaveChanges();
         //return RedirectToAction(nameof(Edit), new { id = Room.Id });
     }
     return(View(person));
 }