Beispiel #1
0
        public ActionResult Uredi(int Id)
        {
            var drzavaServis = new DrzavaServis();

            var model = new DrzavaUrediVM();

            model.drzava = drzavaServis.DobaviDrzavuPoId(Id);

            return(View(model));
        }
Beispiel #2
0
        public ActionResult Index()
        {
            var drzavaServis = new DrzavaServis();

            var model = new DrzaveIndexVM();

            model.listaDrzava = drzavaServis.DobaviSveDrzave();

            return(View(model));
        }
Beispiel #3
0
        public ActionResult Uredi(DrzavaUrediVM model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var drzavaServis = new DrzavaServis();

            drzavaServis.IzmjeniDrzavu(model);

            return(RedirectToAction("Index"));
        }
        public ActionResult Dodaj()
        {
            var drzavaServis = new DrzavaServis();

            var model = new GradoviDodajVM();

            model.listaDrzava = drzavaServis.DobaviSveDrzave().Select(x => new SelectListItem
            {
                Value = x.Id.ToString(),
                Text  = x.Naziv
            }).ToList();

            return(View(model));
        }
Beispiel #5
0
        public ActionResult Dodaj(DrzavaDodajVM model)
        {
            var drzavaServis = new DrzavaServis();

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            drzavaServis.DodajDrzavu(model);


            return(RedirectToAction("Index"));
        }
        public ActionResult Dodaj(GradoviDodajVM model)
        {
            var gradoviServis = new GradoviServis();
            var drzavaServis  = new DrzavaServis();

            if (!ModelState.IsValid)
            {
                model.listaDrzava = drzavaServis.DobaviSveDrzave().Select(x => new SelectListItem
                {
                    Value = x.Id.ToString(),
                    Text  = x.Naziv
                }).ToList();

                return(View(model));
            }

            gradoviServis.DodajGrad(model);

            return(RedirectToAction("Index"));
        }