public ActionResult index(int?id) { var ViewModel = new PlanoCarreiraForm(); ViewModel.PlanoCarreira = this.OPlanoCarreiraConsultaBL.carregar(UtilNumber.toInt32(id)) ?? new PlanoCarreira(); return(View(ViewModel)); }
public ActionResult salvar(PlanoCarreiraForm ViewModel) { if (!ModelState.IsValid) { return(View("index", ViewModel)); } bool flagSucesso = this.OPlanoCarreiraCadastroBL.salvar(ViewModel.PlanoCarreira); if (flagSucesso) { this.Flash(UtilMessage.TYPE_MESSAGE_SUCCESS, UtilMessage.success("Sucesso!", "Os dados foram salvos com sucesso.")); return(RedirectToAction("index", new{ ViewModel.PlanoCarreira.id })); } this.Flash(UtilMessage.TYPE_MESSAGE_ERROR, UtilMessage.error("Erro!", "Houve um problema ao salvar o registro. Tente novamente.")); return(View("index", ViewModel)); }