Example #1
0
        public JsonResult EliminarProyeto(long?id)
        {
            if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name)))
            {
                return(null);
            }
            bool succes;

            try
            {
                tblProyectosInvestigacion tblProyectosInvestigacion = db.tblProyectosInvestigacion.Find(id);
                tblProyectosInvestigacion.tblEstado_ID = 2;
                tblGruposInvestigacion grupo = db.tblGruposInvestigacion.Find(tblProyectosInvestigacion.tblGruposInvestigacion_ID);
                grupo.gruInv_proyectos = grupo.gruInv_proyectos - 1;

                db.Entry(grupo).State = EntityState.Modified;
                db.Entry(tblProyectosInvestigacion).State = EntityState.Modified;
                db.SaveChanges();
                succes = true;
            }
            catch (Exception)
            {
                succes = false;
                throw;
            }

            return(Json(succes, JsonRequestBehavior.AllowGet));
        }
Example #2
0
 //public ActionResult Edit([Bind(Include = "tblMetodoProy_ID,tblParadigmaMetodologico_ID,metProy_paradigmaMetodologicoProy,tblParadigmaEpistemologico_ID,tblTipoEstudioProy_ID,tblDisenioProy_ID,tblHistoricoHermeneutico,tblCriticoSocial,metProy_paradigmaEpistemologicoProy,metProy_poblacionMuestraProy,metProy_tecnicasInstrumentosProy,metProy_procedimientoProy,metProy_planAnalisisDatosProy")] tblMetodoProy tblMetodoProy)
 public ActionResult Edit(tblMetodoProy tblMetodoProy)
 {
     if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name)))
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     if (ModelState.IsValid)
     {
         tblProyectosInvestigacion miProyecto = (from t in db.tblProyectosInvestigacion
                                                 where t.tblMetodoProy_ID == tblMetodoProy.tblMetodoProy_ID
                                                 select t).FirstOrDefault();
         miProyecto.proyInv_fechaUltimaModificacion = DateTime.Now;
         db.Entry(miProyecto).State    = EntityState.Modified;
         db.Entry(tblMetodoProy).State = EntityState.Modified;
         db.SaveChanges();
         //return RedirectToAction("Edit", new { id = tblMetodoProy.tblMetodoProy_ID });
     }
     ViewBag.tblCriticoSocial              = new SelectList(db.tblCriticoSocial, "tblCriticoSocial_ID", "critSoc_nombre", tblMetodoProy.tblCriticoSocial);
     ViewBag.tblDisenioProy_ID             = new SelectList(db.tblDiseniosProy, "tblDiseniosProy_ID", "disProy_nombre", tblMetodoProy.tblDisenioProy_ID);
     ViewBag.tblHistoricoHermeneutico      = new SelectList(db.tblHistoricoHermeneutico, "tblHistoricoHermeneutico_ID", "hisHerm_nombre", tblMetodoProy.tblHistoricoHermeneutico);
     ViewBag.tblParadigmaEpistemologico_ID = new SelectList(db.tblParadigmaEpistemologico, "tblParadigmaEpistemologico_ID", "parEpi_nombre", tblMetodoProy.tblParadigmaEpistemologico_ID);
     ViewBag.tblParadigmaMetodologico_ID   = new SelectList(db.tblParadigmaMetodologico, "tblParadigmaMetodologico_ID", "parMet_nombre", tblMetodoProy.tblParadigmaMetodologico_ID);
     ViewBag.tblTipoEstudioProy_ID         = new SelectList(db.tblTipoEstudioProy, "tblTipoEstudioProy_ID", "tipEst_nombre", tblMetodoProy.tblTipoEstudioProy_ID);
     return(View(tblMetodoProy));
 }
Example #3
0
        private void addTablasRevProyecto(tblProyectosInvestigacion tblProyectosInvestigacion)
        {
            tblProyectosInvestigacion.tblProyectosInvestigacion_Rev  = evaluacionProyecto(tblProyectosInvestigacion);
            tblProyectosInvestigacion.tblProyectosInvestigacion_Rev1 = evaluacionProyecto(tblProyectosInvestigacion);
            tblProyectosInvestigacion.tblProyectosInvestigacion_Rev2 = evaluacionProyecto(tblProyectosInvestigacion);
            tblProyectosInvestigacion.tblProyectosInvestigacion_Rev3 = evaluacionProyecto(tblProyectosInvestigacion);

            //tblProyectosInvestigacion.tblEvaluacionProyColciencias_ID = evaluacionProyecto(tblProyectosInvestigacion);
            //tblProyectosInvestigacion.tblEvaluacionProyInvestic_ID = evaluacionProyecto(tblProyectosInvestigacion);
            //tblProyectosInvestigacion.tblEvaluacionProyEvaluador1_ID = evaluacionProyecto(tblProyectosInvestigacion);
            //tblProyectosInvestigacion.tblEvaluacionProyEvaluador2_ID = evaluacionProyecto(tblProyectosInvestigacion);
        }
Example #4
0
        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);
        }
Example #5
0
 public ActionResult InformeProyecto([Bind(Include = "tblProyectoInvestigacion_ID")] tblProyectosInvestigacion tblProyectosInvestigacion)
 {
     if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name)))
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     if (ModelState.IsValid)
     {
         tblProyectosInvestigacion.tblEstado_ID    = 7; //Finalizado, Listo para revision
         db.Entry(tblProyectosInvestigacion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Proyectos", "ProyectosInvestigacion", new { id = tblProyectosInvestigacion.tblGruposInvestigacion_ID }));
     }
     return(RedirectToAction("Proyectos", "ProyectosInvestigacion", new { id = tblProyectosInvestigacion.tblGruposInvestigacion_ID }));
 }
Example #6
0
        private void addTablasProyecto(tblProyectosInvestigacion tblProyectosInvestigacion)
        {
            //tabla presentacion proyecto
            tblPresentacionProyecto presentacionProy = new tblPresentacionProyecto();

            presentacionProy.preProy_tituloProy = tblProyectosInvestigacion.proyInv_nombreProyecto;
            db.tblPresentacionProyecto.Add(presentacionProy);
            //tabla problema de investigacion
            tblProblemaInvestigacionProy problemaProy = new tblProblemaInvestigacionProy();

            db.tblProblemaInvestigacionProy.Add(problemaProy);
            //tabla marco de referencia
            tblMarcoReferenciaProy marcoProy = new tblMarcoReferenciaProy();

            db.tblMarcoReferenciaProy.Add(marcoProy);
            //tabla metodo
            tblMetodoProy metodoProy = new tblMetodoProy();

            db.tblMetodoProy.Add(metodoProy);
            //tabla caracteristicas
            tblCaracteristicasProy caractProy = new tblCaracteristicasProy();

            db.tblCaracteristicasProy.Add(caractProy);
            //tabla cronograma
            tblCronogramaProy cronogramaProy = new tblCronogramaProy();

            db.tblCronogramaProy.Add(cronogramaProy);
            //tabla presupuesto
            tblPresupuestoProy presupuestoProy = new tblPresupuestoProy();

            db.tblPresupuestoProy.Add(presupuestoProy);
            //tabla referencias
            tblReferenciasProy referenciasProy = new tblReferenciasProy();

            db.tblReferenciasProy.Add(referenciasProy);

            db.SaveChanges();

            tblProyectosInvestigacion.tblPresentacionProyecto      = presentacionProy;
            tblProyectosInvestigacion.tblProblemaInvestigacionProy = problemaProy;
            tblProyectosInvestigacion.tblMarcoReferenciaProy       = marcoProy;
            tblProyectosInvestigacion.tblMetodoProy          = metodoProy;
            tblProyectosInvestigacion.tblCaracteristicasProy = caractProy;
            tblProyectosInvestigacion.tblCronogramaProy      = cronogramaProy;
            tblProyectosInvestigacion.tblPresupuestoProy     = presupuestoProy;
            tblProyectosInvestigacion.tblReferenciasProy     = referenciasProy;
        }
Example #7
0
        public ActionResult PromoverProyecto(long?id)
        {
            if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name)))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblProyectosInvestigacion miProyecto = db.tblProyectosInvestigacion.Find(id);

            if (miProyecto == null)
            {
                return(HttpNotFound());
            }
            miProyecto.tblEstado_ID    = 7; //Finaliado, listo para revision
            db.Entry(miProyecto).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Proyectos", "ProyectosInvestigacion"));
        }
Example #8
0
        public ActionResult InformeProyecto(long?id) //Recibe el id del proyecto para presentar el informe final
        {
            if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name)))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblProyectosInvestigacion miProyecto = db.tblProyectosInvestigacion.Find(id);

            if (miProyecto == null)
            {
                return(HttpNotFound());
            }
            return(View(miProyecto));
        }
Example #9
0
 public ActionResult Edit([Bind(Include = "tblMarcoReferenciaProy_ID,marRefProy_marcoTeoricoProy,marRefProy_marcoAntecedentesProy,marRefProy_marcoConceptualProy")] tblMarcoReferenciaProy tblMarcoReferenciaProy)
 {
     if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name)))
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     if (ModelState.IsValid)
     {
         tblProyectosInvestigacion miProyecto = (from t in db.tblProyectosInvestigacion
                                                 where t.tblMarcoReferenciaProy_ID == tblMarcoReferenciaProy.tblMarcoReferenciaProy_ID
                                                 select t).FirstOrDefault();
         miProyecto.proyInv_fechaUltimaModificacion = DateTime.Now;
         db.Entry(miProyecto).State             = EntityState.Modified;
         db.Entry(tblMarcoReferenciaProy).State = EntityState.Modified;
         db.SaveChanges();
         //return RedirectToAction("Edit", new { id = tblMarcoReferenciaProy.tblMarcoReferenciaProy_ID });
     }
     return(View(tblMarcoReferenciaProy));
 }
 public ActionResult Edit([Bind(Include = "tblProblemaInvestigacionProy_ID,proInvProy_planteamientoProblemaProy,proInvProy_preguntaInvestigacionProy,proInvProy_subpreguntaInvestigacionProy,proInvProy_justificacionProy,proInvProy_objetivoGeneralProy,proInvProy_objetivosEspecificosProy")] tblProblemaInvestigacionProy tblProblemaInvestigacionProy)
 {
     if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name)))
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     if (ModelState.IsValid)
     {
         tblProyectosInvestigacion miProyecto = (from t in db.tblProyectosInvestigacion
                                                 where t.tblProyectosInvestigacion_ID == tblProblemaInvestigacionProy.tblProblemaInvestigacionProy_ID
                                                 select t).FirstOrDefault();
         miProyecto.proyInv_fechaUltimaModificacion = DateTime.Now;
         db.Entry(miProyecto).State = EntityState.Modified;
         db.Entry(tblProblemaInvestigacionProy).State = EntityState.Modified;
         db.SaveChanges();
         //return RedirectToAction("Edit", new { id = tblProblemaInvestigacionProy.tblProblemaInvestigacionProy_ID });
     }
     return(View(tblProblemaInvestigacionProy));
 }
 public ActionResult Edit([Bind(Include = "tblPresentacionProyecto_ID,preProy_tituloProy,preProy_resumenProy,preProy_palabrasClavesProy,tblEjeInvestigacion_ID,preProy_ejeInvestigacionProy")] tblPresentacionProyecto tblPresentacionProyecto)
 {
     if (!(AspNetUsersRoles.IsUserInRole("Administrator", User.Identity.Name) || AspNetUsersRoles.IsUserInRole("Maestro", User.Identity.Name)))
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     if (ModelState.IsValid)
     {
         tblProyectosInvestigacion miProyecto = (from t in db.tblProyectosInvestigacion
                                                 where t.tblPresentacionProyecto_ID == tblPresentacionProyecto.tblPresentacionProyecto_ID
                                                 select t).FirstOrDefault();
         miProyecto.proyInv_nombreProyecto          = tblPresentacionProyecto.preProy_tituloProy;
         miProyecto.proyInv_fechaUltimaModificacion = DateTime.Now;
         db.Entry(miProyecto).State = EntityState.Modified;
         db.Entry(tblPresentacionProyecto).State = EntityState.Modified;
         db.SaveChanges();
         //return RedirectToAction("Edit", new { id = tblPresentacionProyecto.tblPresentacionProyecto_ID });
     }
     ViewBag.tblEjeInvestigacion_ID = new SelectList(db.tblEjeInvestigacion, "tblEjeInvestigacion_ID", "ejeInv_nombre", tblPresentacionProyecto.tblEjeInvestigacion_ID);
     return(View(tblPresentacionProyecto));
 }
Example #12
0
        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));
        }