Пример #1
0
        public async Task <PartialViewResult> EditPersonModal(int personId)
        {
            var person = await _personAppService.GetPersonForEdit(new EntityDto { Id = personId });

            var viewModel = new EditPersonModalViewModel(person);

            return(PartialView("_PersonEditModal", viewModel));
        }
        public async Task <ActionResult> EditPersonModal(int personId)
        {
            var person = _personAppService.GetPersonForEdit(new EntityDto <int>(personId));

            // dropdown
            var listaTipiContatto = Enum.GetValues(typeof(TipiContatto)).Cast <TipiContatto>().Select(v => new SelectListItem
            {
                Text  = v.ToString(),
                Value = ((int)v).ToString()
            }).ToList();

            var model = new EditPersonModalViewModel
            {
                Person       = person,
                TipiContatto = listaTipiContatto
            };

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