public async Task <IActionResult> Index() { var ipUsuario = _contextoApp.HttpContext?.Connection?.RemoteIpAddress?.ToString(); await RegistrarAcesso(ipUsuario); var usuarioId = await ObterIdAsync(); PainelViewModel modelo = new PainelViewModel() { ProjetosRecente = _projetoRepo.ObterProjetosRecente(usuarioId, 2), QuantidadeProjetoAnd = _projetoRepo.ObterQuantidadeProjetoAndamento(usuarioId, true), QuantidadeProjetoEnc = _projetoRepo.ObterQuantidadeProjetoAndamento(usuarioId, false), QuantidadeColaboracoes = _projetoRepo.ObterQuantidadeColaboracoes(usuarioId) }; return(View(modelo)); }
private async Task OnClick() { string mensagemErro = string.Empty; if (filtro.DataInical.Year != filtro.Datafinal.Year) { mensagemErro = validation[validationLocalizer.PesquisasMesmoAno]; } else if (DateTime.Compare(filtro.DataInical, filtro.Datafinal) > 0) { mensagemErro = validation[validationLocalizer.DataInicialMaiorDataFinal]; } if (string.IsNullOrEmpty(mensagemErro)) { Painel = await http.POST <PainelViewModel>(Api.Painel, filtro); } else { NotificationService.Notify(PopUps.Error(validation[validationLocalizer.Erro], mensagemErro)); await Task.CompletedTask; } }
protected async override Task OnInitializedAsync() { interceptor.RegisterEvent(); Painel = await http.POST <PainelViewModel>(Api.Painel, filtro); }