Exemple #1
0
 public ActionResult NoviPlan()
 {
     if (PlaniranjeSession.Trenutni.PedagogId <= 0 || !Request.IsAjaxRequest())
     {
         return(RedirectToAction("Index", "Planiranje"));
     }
     if (Request.IsAjaxRequest())
     {
         CIljeviModel model = new CIljeviModel();
         return(View("NoviPlan", model));
     }
     return(RedirectToAction("Index"));
 }
Exemple #2
0
        public ActionResult Index()
        {
            if (PlaniranjeSession.Trenutni.PedagogId <= 0 || !Request.IsAjaxRequest())
            {
                return(RedirectToAction("Index", "Planiranje"));
            }
            ViewBag.Title = "Pregled ciljeva";

            CIljeviModel model = new CIljeviModel();

            model.ciljevi = ciljevi_DB.ReadCiljevi();
            return(View("Index", model));
        }
Exemple #3
0
 public ActionResult Edit(int id)
 {
     if (PlaniranjeSession.Trenutni.PedagogId <= 0 || !Request.IsAjaxRequest())
     {
         return(RedirectToAction("Index", "Planiranje"));
     }
     if (Request.IsAjaxRequest())
     {
         CIljeviModel model = new CIljeviModel();
         model.cilj = ciljevi_DB.ReadCiljevi(id);
         return(View("Uredi", model));
     }
     return(RedirectToAction("Index"));
 }
Exemple #4
0
 public ActionResult Delete(int id)
 {
     if (PlaniranjeSession.Trenutni.PedagogId <= 0 || !Request.IsAjaxRequest())
     {
         return(RedirectToAction("Index", "Planiranje"));
     }
     if (Request.IsAjaxRequest())
     {
         ViewBag.ErrorMessage = null;
         CIljeviModel model = new CIljeviModel();
         model.cilj = ciljevi_DB.ReadCiljevi(id);
         return(View("Obrisi", model));
     }
     return(RedirectToAction("Index"));
 }
Exemple #5
0
 public ActionResult Edit(CIljeviModel model)
 {
     if (PlaniranjeSession.Trenutni.PedagogId <= 0 || !Request.IsAjaxRequest())
     {
         return(RedirectToAction("Index", "Planiranje"));
     }
     if (model.cilj.Naziv != null && ciljevi_DB.UpdateCiljevi(model.cilj))
     {
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View("Uredi", model));
     }
 }
Exemple #6
0
 public ActionResult Delete(CIljeviModel model)
 {
     if (PlaniranjeSession.Trenutni.PedagogId <= 0 || !Request.IsAjaxRequest())
     {
         return(RedirectToAction("Index", "Planiranje"));
     }
     if (!ciljevi_DB.DeleteCiljevi(model.cilj.ID_cilj))
     {
         ViewBag.ErrorMessage = "Dogodila se greška, nije moguće obrisati cilj!";
         return(View("Obrisi", model));
     }
     else
     {
         return(RedirectToAction("Index"));
     }
 }