示例#1
0
        public ActionResult NoviBazen(BazenViewModel model)
        {
            ViewBag.Title = "Novi bazen";

            if (ModelState.IsValid)
            {
                var isDodan = _helperRepository.DodajBazen(model);
                if (isDodan)
                {
                    return(PartialView("_uspjeh", "/Admin/Bazeni"));
                }
                else
                {
                    return(PartialView("_greska", "/Admin/Bazeni"));
                }
            }
            else
            {
                model.Gradovi = _helperRepository.GetGradovi();
                ModelState.AddModelError("", "Provjerite podatke i pokušajte opet.");
                return(PartialView("_noviBazen", model));
            }
        }