Beispiel #1
0
        public IActionResult Edit(EditExpertiseViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            expertiseService.Update(vm.Id, vm.Title, vm.Description, GetStringFromFile(vm.NewIcon));

            return(RedirectToIndex());
        }
Beispiel #2
0
        public IActionResult Edit(int id)
        {
            Expertise expertise = expertiseService.GetById(id);

            if (expertise == null)
            {
                return(RedirectToIndex());
            }

            EditExpertiseViewModel vm = new EditExpertiseViewModel
            {
                Id          = id,
                Title       = expertise.Title,
                Description = expertise.Description,
                Icon        = expertise.Icon
            };

            return(View(vm));
        }