Beispiel #1
0
 public IActionResult Edit([FromBody] Group group)
 {
     (bool result, string message) = _groupsService.Edit(group);
     if (!result)
     {
         return(BadRequest(message));
     }
     return(Ok());
 }
        public ActionResult Edit([Bind(Include = "id_group,group_name,numeric_group_name")] Groups groups)
        {
            if (!ModelState.IsValid)
            {
                ViewBag.Type = "edit";
                return(View(groups));
            }

            try
            {
                groupsService.Edit(groups);
                TempData["Status"] = "success";
                TempData["Msg"]    = "Aktualizacja grupy przebiegła pomyślnie!";
            }
            catch (Exception e)
            {
                TempData["Status"] = "invalid";
                TempData["Msg"]    = "Nie udało się zaktualizować grupy!";
            }
            return(RedirectToAction("List"));
        }