コード例 #1
0
        public ActionResult NovaGrupa(GrupaViewModel model)
        {
            ViewBag.Title = "Nova grupa";

            if (ModelState.IsValid)
            {
                var isDodan = _helperRepository.DodajGrupu(model);
                if (isDodan)
                {
                    return(PartialView("_uspjeh", "/Admin/Grupe"));
                }
                else
                {
                    return(PartialView("_greska", "/Admin/Grupe"));
                }
            }
            else
            {
                ModelState.AddModelError("", "Provjerite podatke i pokušajte opet.");
                return(PartialView("_novaGrupa", model));
            }
        }