Beispiel #1
0
        public async Task <IActionResult> Create([Bind(Prefix = "Objective")] Objective obj)
        {
            if (ModelState.IsValid)
            {
                await _objectiveService.InsertAsync(obj);

                return(RedirectToRoute(new { controller = "Curriculums", action = "Details", id = obj.CurriculumId }));
            }
            return(RedirectToRoute(new { controller = "Curriculums", action = "Details", id = obj.CurriculumId }));
        }
Beispiel #2
0
        public async Task <IActionResult> Create(Objective obj)
        {
            if (ModelState.IsValid)
            {
                TempData["confirm"] = obj.Name + " foi cadastrado com sucesso.";
                await _objectiveService.InsertAsync(obj);

                list = await _objectiveService.FindAllAsync();

                _cache.Set("objective", list, cacheOptions);
                return(RedirectToAction(nameof(Index)));
            }

            TempData["erro"] = "Erro ao cadastrar.";
            return(RedirectToAction(nameof(Index)));
        }