public ActionResult editar(int?id) { EmpresaPorteForm ViewModel = new EmpresaPorteForm(); ViewModel.EmpresaPorte = this.OEmpresaPorteBL.carregar(UtilNumber.toInt32(id)) ?? new EmpresaPorte(); return(View(ViewModel)); }
public ActionResult editar(EmpresaPorteForm ViewModel) { if (!ModelState.IsValid) { return(View(ViewModel)); } bool flagSucesso = this.OEmpresaPorteBL.salvar(ViewModel.EmpresaPorte); if (flagSucesso) { this.Flash(UtilMessage.TYPE_MESSAGE_SUCCESS, UtilMessage.success("Sucesso", "Os dados foram salvos com sucesso.")); } else { this.Flash(UtilMessage.TYPE_MESSAGE_ERROR, UtilMessage.error("Falha", "Não foi possível salvar as informações, tente novamente.")); } return(View(ViewModel)); }