public ActionResult CreateTransactionType([FromBody] TransactionType inputs) { try { //inputs.Id = Guid.NewGuid(); _serv.CreateTransactionType(inputs); return(Ok()); } catch (Exception ex) { return(BadRequest($"Ocorreu um erro ao Create um novo TransactionType: {ex.Message}")); } }
public virtual async Task <ActionResult> Create(TransactionTypeCreateViewModel model) { if (!ModelState.IsValid) { return(View(model)); } model.CreatorID = await GetCurrentUserIdAsync(); _transactionTypeService.CreateTransactionType(model); if (string.IsNullOrEmpty(model.PreviousUrl)) { return(RedirectToAction(MVC.Home.ActionNames.Index, MVC.Home.Name)); } return(Redirect(model.PreviousUrl)); }