Example #1
0
        public ActionResult Index()
        {
            var vm = new GlobalGoalCreateUpdate();

            try
            {
                vm.GlobalGoal = new GlobalGoal();
                vm.Languages  = _languageServiceGateway.ReadAll();
                vm.Folders    = _cloudinaryServiceGateway.GetGlobalGoalFolders();
                return(View(vm));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                TempData["toast"] = "Kunne ikke læse det valgte Verdensmål. Prøv igen eller kontakt administrator";
                return(View(vm));
            }
        }
        public ActionResult Create(int gg_id)
        {
            var vm = new ArtworkCreateUpdate();

            try
            {
                vm.GlobalGoalId   = gg_id;
                vm.Artwork        = new Artwork();
                vm.Languages      = _languageGateway.ReadAll();
                TempData["toast"] = "Artwork er oprettet!";
                return(PartialView("CreateUpdate", vm));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                TempData["toast"] = "Der skete en fejl. Prøv igen eller kontakt administrator!";
                return(PartialView("CreateUpdate", new ArtworkCreateUpdate()));
            }
        }
        public ActionResult Create(int gg_id)
        {
            var vm = new LandartCreateUpdate();

            try
            {
                vm.GlobalGoalId   = gg_id;
                vm.LandArt        = new LandArt();
                vm.Languages      = _languageGateway.ReadAll();
                TempData["toast"] = "Landart er oprettet!";
                return(PartialView("CreateUpdate", vm));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                TempData["toast"] = "Kunne ikke læse den valgte Landart. Prøv igen eller kontakt administrator";
                return(PartialView("CreateUpdate", new LandartCreateUpdate()));
            }
        }
Example #4
0
        public ActionResult Create(int gg_id)
        {
            var vm = new ChildrensTextCreateUpdate();

            try
            {
                vm.GlobalGoalId   = gg_id;
                vm.ChildrensText  = new ChildrensText();
                vm.Languages      = _languageServiceGateway.ReadAll();
                TempData["toast"] = "Teksten er oprettet!";
                return(PartialView("CreateUpdate", vm));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                TempData["toast"] = "Fejl i indlæsning af ChildrensText. Prøv igen eller kontakt administrator";
                return(PartialView("CreateUpdate", new ChildrensTextCreateUpdate()));
            }
        }
        public ActionResult Create(int gg_id)
        {
            var vm = new AudioVideoCreateUpdate();

            try
            {
                vm.AudioVideo = new AudioVideo()
                {
                    Id = gg_id
                };
                vm.Languages = _languageServiceGateway.ReadAll();
                vm.IsCreate  = true;
                return(View("CreateUpdate", vm));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(View("CreateUpdate", new AudioVideoCreateUpdate()));
            }
        }
 public ActionResult Update(int id)
 {
     try
     {
         var fp = _frontPageServiceGateway.Read(id);
         var vm = new FrontPageUpdateViewModel();
         vm.Frontpage = fp;
         vm.Languages = _languageServiceGateway.ReadAll();
         return(View(vm));
     }
     catch (Exception e)
     {
         return(View(e.Message));
     }
 }