public ActionResult editar(VagaEstagioForm ViewModel) { if (!ModelState.IsValid) { return(View(ViewModel)); } if (String.IsNullOrEmpty(ViewModel.Noticia.flagCompartilharFB)) { ViewModel.Noticia.flagCompartilharFB = "N"; } ViewModel.Noticia.idTipoNoticia = TipoNoticiaConst.VAGAESTAGIO; bool flagSucesso = this.ONoticiaBL.salvar(ViewModel.Noticia, null, null); if (flagSucesso) { this.Flash(UtilMessage.TYPE_MESSAGE_SUCCESS, UtilMessage.success("Sucesso!", "Os dados foram salvos com sucesso.")); return(RedirectToAction("editar", new { id = ViewModel.Noticia.id })); } this.Flash(UtilMessage.TYPE_MESSAGE_ERROR, UtilMessage.error("Erro!", "Houve um problema ao salvar o registro. Tente novamente.")); return(View(ViewModel)); }
public ActionResult editar(int?id) { var ViewModel = new VagaEstagioForm(); ViewModel.Noticia = this.ONoticiaBL.carregar(UtilNumber.toInt32(id)) ?? new Noticia(); return(View(ViewModel)); }