public ActionResult DeleteConfirmed(long id) { tblProyectosInvestigacion_Rev tblProyectosInvestigacion_Rev = db.tblProyectosInvestigacion_Rev.Find(id); db.tblProyectosInvestigacion_Rev.Remove(tblProyectosInvestigacion_Rev); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: ProyectosInvestigacion_Rev/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblProyectosInvestigacion_Rev tblProyectosInvestigacion_Rev = db.tblProyectosInvestigacion_Rev.Find(id); if (tblProyectosInvestigacion_Rev == null) { return(HttpNotFound()); } return(View(tblProyectosInvestigacion_Rev)); }
private tblProyectosInvestigacion_Rev evaluacionProyecto(tblProyectosInvestigacion tblProyectosInvestigacion) { //Tablas de Revision tblPresentacionProyecto_Rev revPresentacionProyecto = new tblPresentacionProyecto_Rev(); db.tblPresentacionProyecto_Rev.Add(revPresentacionProyecto); tblProblemaInvestigacionProy_Rev revProblemaProy = new tblProblemaInvestigacionProy_Rev(); db.tblProblemaInvestigacionProy_Rev.Add(revProblemaProy); tblMarcoReferenciaProy_Rev revMarcoProy = new tblMarcoReferenciaProy_Rev(); db.tblMarcoReferenciaProy_Rev.Add(revMarcoProy); tblMetodoProy_Rev revMetodoProy = new tblMetodoProy_Rev(); db.tblMetodoProy_Rev.Add(revMetodoProy); tblCaracteristicasProy_Rev revCaracteristicasProy = new tblCaracteristicasProy_Rev(); db.tblCaracteristicasProy_Rev.Add(revCaracteristicasProy); tblCronogramaProy_Rev revCronogramaProy = new tblCronogramaProy_Rev(); db.tblCronogramaProy_Rev.Add(revCronogramaProy); tblPresupuestoProy_Rev revPresupuestoProy = new tblPresupuestoProy_Rev(); db.tblPresupuestoProy_Rev.Add(revPresupuestoProy); tblReferenciasProy_Rev revReferenciasProy = new tblReferenciasProy_Rev(); db.tblReferenciasProy_Rev.Add(revReferenciasProy); //Guardar tablas de revision db.SaveChanges(); //Asignar tablas a revision del proyecto tblProyectosInvestigacion_Rev revision = new tblProyectosInvestigacion_Rev(); revision.tblPresentacionProyecto_Rev = revPresentacionProyecto; revision.tblProblemaInvestigacionProy_Rev = revProblemaProy; revision.tblMarcoReferenciaProy_Rev = revMarcoProy; revision.tblMetodoProy_Rev = revMetodoProy; revision.tblCaracteristicasProy_Rev = revCaracteristicasProy; revision.tblCronogramaProy_Rev = revCronogramaProy; revision.tblPresupuestoProy_Rev = revPresupuestoProy; revision.tblReferenciasProy_Rev = revReferenciasProy; revision.tblEstado_ID = 6; //Sin asignacion db.tblProyectosInvestigacion_Rev.Add(revision); db.SaveChanges(); //return revision.tblProyectosInvestigacion_Rev_ID; return(revision); }
public ActionResult Edit([Bind(Include = "tblProyectosInvestigacion_Rev_ID,tblProyectosInvestigacion_ID,tblEstado_ID,tblPresentacionProyecto_Rev_ID,tblProblemaInvestigacionProy_Rev_ID,tblMarcoReferenciaProy_Rev_ID,tblMetodoProy_Rev_ID,tblCaracteristicasProy_Rev_ID,tblCronogramaProy_Rev_ID,tblPresupuestoProy_Rev_ID,tblReferenciasProy_Rev_ID,tblUsuarioPlataforma_Evaluador_ID,proyInvRev_fechaAsignacion,proyInvRev_fechaLimiteEvaluacion,proyInvRev_fechaUltimaEvaluacion")] tblProyectosInvestigacion_Rev tblProyectosInvestigacion_Rev) { if (ModelState.IsValid) { db.Entry(tblProyectosInvestigacion_Rev).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.tblCaracteristicasProy_Rev_ID = new SelectList(db.tblCaracteristicasProy_Rev, "tblCaracteristicasProy_Rev_ID", "carProy_resultadosEsperadosProy", tblProyectosInvestigacion_Rev.tblCaracteristicasProy_Rev_ID); ViewBag.tblCronogramaProy_Rev_ID = new SelectList(db.tblCronogramaProy_Rev, "tblCronogramaProy_Rev_ID", "croProy_revision", tblProyectosInvestigacion_Rev.tblCronogramaProy_Rev_ID); ViewBag.tblEstado_ID = new SelectList(db.tblEstado, "tblEstado_ID", "est_nombre", tblProyectosInvestigacion_Rev.tblEstado_ID); ViewBag.tblMarcoReferenciaProy_Rev_ID = new SelectList(db.tblMarcoReferenciaProy_Rev, "tblMarcoReferenciaProy_Rev_ID", "marRefProy_marcoTeoricoProy", tblProyectosInvestigacion_Rev.tblMarcoReferenciaProy_Rev_ID); ViewBag.tblMetodoProy_Rev_ID = new SelectList(db.tblMetodoProy_Rev, "tblMetodoProy_Rev_ID", "metProy_paradigmaMetodologicoProy", tblProyectosInvestigacion_Rev.tblMetodoProy_Rev_ID); ViewBag.tblPresentacionProyecto_Rev_ID = new SelectList(db.tblPresentacionProyecto_Rev, "tblPresentacionProyecto_Rev_ID", "preProy_tituloProy", tblProyectosInvestigacion_Rev.tblPresentacionProyecto_Rev_ID); ViewBag.tblPresupuestoProy_Rev_ID = new SelectList(db.tblPresupuestoProy_Rev, "tblPresupuestoProy_Rev_ID", "preProy_revision", tblProyectosInvestigacion_Rev.tblPresupuestoProy_Rev_ID); ViewBag.tblProblemaInvestigacionProy_Rev_ID = new SelectList(db.tblProblemaInvestigacionProy_Rev, "tblProblemaInvestigacionProy_Rev_ID", "proInvProy_planteamientoProblemaProy", tblProyectosInvestigacion_Rev.tblProblemaInvestigacionProy_Rev_ID); ViewBag.tblReferenciasProy_Rev_ID = new SelectList(db.tblReferenciasProy_Rev, "tblReferenciasProy_Rev_ID", "refProy_referencias", tblProyectosInvestigacion_Rev.tblReferenciasProy_Rev_ID); return(View(tblProyectosInvestigacion_Rev)); }
// GET: ProyectosInvestigacion_Rev/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblProyectosInvestigacion_Rev tblProyectosInvestigacion_Rev = db.tblProyectosInvestigacion_Rev.Find(id); if (tblProyectosInvestigacion_Rev == null) { return(HttpNotFound()); } ViewBag.tblCaracteristicasProy_Rev_ID = new SelectList(db.tblCaracteristicasProy_Rev, "tblCaracteristicasProy_Rev_ID", "carProy_resultadosEsperadosProy", tblProyectosInvestigacion_Rev.tblCaracteristicasProy_Rev_ID); ViewBag.tblCronogramaProy_Rev_ID = new SelectList(db.tblCronogramaProy_Rev, "tblCronogramaProy_Rev_ID", "croProy_revision", tblProyectosInvestigacion_Rev.tblCronogramaProy_Rev_ID); ViewBag.tblEstado_ID = new SelectList(db.tblEstado, "tblEstado_ID", "est_nombre", tblProyectosInvestigacion_Rev.tblEstado_ID); ViewBag.tblMarcoReferenciaProy_Rev_ID = new SelectList(db.tblMarcoReferenciaProy_Rev, "tblMarcoReferenciaProy_Rev_ID", "marRefProy_marcoTeoricoProy", tblProyectosInvestigacion_Rev.tblMarcoReferenciaProy_Rev_ID); ViewBag.tblMetodoProy_Rev_ID = new SelectList(db.tblMetodoProy_Rev, "tblMetodoProy_Rev_ID", "metProy_paradigmaMetodologicoProy", tblProyectosInvestigacion_Rev.tblMetodoProy_Rev_ID); ViewBag.tblPresentacionProyecto_Rev_ID = new SelectList(db.tblPresentacionProyecto_Rev, "tblPresentacionProyecto_Rev_ID", "preProy_tituloProy", tblProyectosInvestigacion_Rev.tblPresentacionProyecto_Rev_ID); ViewBag.tblPresupuestoProy_Rev_ID = new SelectList(db.tblPresupuestoProy_Rev, "tblPresupuestoProy_Rev_ID", "preProy_revision", tblProyectosInvestigacion_Rev.tblPresupuestoProy_Rev_ID); ViewBag.tblProblemaInvestigacionProy_Rev_ID = new SelectList(db.tblProblemaInvestigacionProy_Rev, "tblProblemaInvestigacionProy_Rev_ID", "proInvProy_planteamientoProblemaProy", tblProyectosInvestigacion_Rev.tblProblemaInvestigacionProy_Rev_ID); ViewBag.tblReferenciasProy_Rev_ID = new SelectList(db.tblReferenciasProy_Rev, "tblReferenciasProy_Rev_ID", "refProy_referencias", tblProyectosInvestigacion_Rev.tblReferenciasProy_Rev_ID); return(View(tblProyectosInvestigacion_Rev)); }
public ActionResult CrearProyecto([Bind(Include = "tblProyectosInvestigacion_ID,tblGruposInvestigacion_ID,proyInv_nombreProyecto,proInv_fechaCreacion,proInv_fechaUltimaModificacion")] tblProyectosInvestigacion tblProyectosInvestigacion) { if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name))) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (ModelState.IsValid) { try { if (!tblProyectosInvestigacion.proyInv_nombreProyecto.Equals(null)) { tblProyectosInvestigacion.tblEstado_ID = 1; //Estado Activo tblProyectosInvestigacion.proyInv_fechaCreacion = DateTime.Now; tblProyectosInvestigacion.proyInv_fechaUltimaModificacion = DateTime.Now; //Agregar Tablas al Proyecto addTablasProyecto(tblProyectosInvestigacion); //Agregar Tablas de Revision //addTablasRevProyecto(tblProyectosInvestigacion); //-------------Revision tblProyectosInvestigacion_Rev rev = evaluacionProyecto(tblProyectosInvestigacion); tblProyectosInvestigacion_Rev rev1 = evaluacionProyecto(tblProyectosInvestigacion); tblProyectosInvestigacion_Rev rev2 = evaluacionProyecto(tblProyectosInvestigacion); tblProyectosInvestigacion_Rev rev3 = evaluacionProyecto(tblProyectosInvestigacion); tblProyectosInvestigacion.tblProyectosInvestigacion_Rev = rev; tblProyectosInvestigacion.tblProyectosInvestigacion_Rev1 = rev1; tblProyectosInvestigacion.tblProyectosInvestigacion_Rev2 = rev2; tblProyectosInvestigacion.tblProyectosInvestigacion_Rev3 = rev3; //--------------------- db.tblProyectosInvestigacion.Add(tblProyectosInvestigacion); tblGruposInvestigacion miGrupoInv = db.tblGruposInvestigacion.Find(tblProyectosInvestigacion.tblGruposInvestigacion_ID); miGrupoInv.gruInv_proyectos = miGrupoInv.gruInv_proyectos + 1; db.Entry(miGrupoInv).State = EntityState.Modified; db.SaveChanges(); //Guardar revisions rev.tblProyectosInvestigacion_ID = tblProyectosInvestigacion.tblProyectosInvestigacion_ID; rev1.tblProyectosInvestigacion_ID = tblProyectosInvestigacion.tblProyectosInvestigacion_ID; rev2.tblProyectosInvestigacion_ID = tblProyectosInvestigacion.tblProyectosInvestigacion_ID; rev3.tblProyectosInvestigacion_ID = tblProyectosInvestigacion.tblProyectosInvestigacion_ID; db.Entry(rev).State = EntityState.Modified; db.Entry(rev1).State = EntityState.Modified; db.Entry(rev2).State = EntityState.Modified; db.Entry(rev3).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Proyectos", new { id = tblProyectosInvestigacion.tblGruposInvestigacion_ID })); } } catch (Exception) { //throw; return(RedirectToAction("Proyectos", new { id = tblProyectosInvestigacion.tblGruposInvestigacion_ID })); } } tblGruposInvestigacion miGrupo = db.tblGruposInvestigacion.Find(tblProyectosInvestigacion.tblGruposInvestigacion_ID); return(View(miGrupo)); }