Ejemplo n.º 1
0
        // GET: Clients/Edit/5
        public async Task <IActionResult> Edit(int?clientId)
        {
            if (clientId == null)
            {
                return(NotFound());
            }

            var client = await _clientRepository.GetClientWithDetailsAsync(clientId.Value);

            if (client == null)
            {
                return(NotFound());
            }

            var user = await _userHelper.GetUserByEmailAsync(client.User.Email);

            if (user == null)
            {
                return(NotFound());
            }

            var model = _converterHelper.ClientToEditClientViewModel(user, client);

            model.ProgramTiers = _combosHelper.GetProgramTiers();

            return(View(model));
        }