Beispiel #1
0
        public IActionResult CreateUpdateWorkExperience(AdminWorkExperienceViewModel model)
        {
            ViewBag.ShowNavbar = false;

            //Create
            if (model.Id != 0)
            {
                var workExperience = _workExperienceService.GetWorkExperienceFromID(model.Id);

                var convertedModel = _mapper.Map <AdminWorkExperienceViewModel>(workExperience);

                convertedModel.AspAction     = "UpdateWorkExperience";
                convertedModel.AspController = "AdminCRUD";
                convertedModel.ButttonText   = "Opdater";

                return(View("CreateUpdateWorkExperience", convertedModel));
            }

            model.AspAction     = "CreateWorkExperience";
            model.AspController = "AdminCRUD";
            model.ButttonText   = "Opret";

            return(View("CreateUpdateWorkExperience", model));
        }