Пример #1
0
        public IActionResult Create(SubTechnicalGroup subTechnicalGroup)
        {
            if (!ModelState.IsValid)
            {
                return(View(subTechnicalGroup));
            }

            _subTechnicalGroupRepository.Add(subTechnicalGroup);
            return(RedirectToAction(nameof(Details), nameof(SubTechnicalGroup), subTechnicalGroup.TechnicalGroupId));
        }
Пример #2
0
 public ActionResult Edit(SubTechnicalGroup subTechnicalGroup)
 {
     try
     {
         // TODO: Add update logic here
         _subTechnicalGroupRepository.Update(subTechnicalGroup);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View(subTechnicalGroup));
     }
 }