예제 #1
0
        private async Task Salvar(DetalhesViewModel model)
        {
            var userBus    = new UsuarioBUS(new UsuarioREP());
            var dto        = ObterDTO(model);
            var ehCadastro = string.IsNullOrWhiteSpace(model.Id);

            if (ehCadastro)
            {
                await userBus.RegistrarInteresse(dto);

                TempData["sucesso"] = "Interesse cadastrado com sucesso";
            }
            else
            {
                await userBus.AtualizarInteresse(dto);

                TempData["sucesso"] = "Interesse atualizado com sucesso";
            }
        }