예제 #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(Page());
                }

                await _sistemaApiService.AlterarAsync(Token, Sistema);

                return(RedirectToPage("Listar"));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(string.Empty, ex.Message);
                return(Page());
            }
        }
예제 #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    SelectSistemas = new SelectList(await _sistemaApiService.ListarAsync(Token), "Id", "Nome");

                    return(Page());
                }

                await _projetoApiService.AlterarAsync(Token, Projeto);

                return(RedirectToPage("Listar"));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(string.Empty, ex.Message);
                return(Page());
            }
        }