Example #1
0
        public async Task <IActionResult> Create()
        {
            var typeservices = await _typeserviceService.FindAllAsync();

            var viewModel = new LegalpersonFormViewModel {
                Typeservices = typeservices
            };

            return(View(viewModel));
        }
Example #2
0
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var legalpersons = await _legalpersonService.FindByIdAsync(id.Value);

            if (legalpersons == null)
            {
                return(NotFound());
            }
            List <Typeservice>       typeservices = _typeserviceService.FindAll();
            LegalpersonFormViewModel viewModel    = new LegalpersonFormViewModel
            {
                Legalperson  = legalpersons,
                Typeservices = typeservices,
            };

            return(View(viewModel));
        }