Example #1
0
        public ActionResult CrearMaestro()
        {
            tblMaestroCoInvestigador maestro = new tblMaestroCoInvestigador();

            ViewBag.idAreaConocimiento = new SelectList(db.tblAreaConocimiento, "id", "Nombre");
            maestro.idUsuario          = AspNetUsers.GetUserId(User.Identity.Name);
            return(View(maestro));
        }
        public ActionResult HojaDeVida(int code = 0)
        {
            ViewBag.Message = dl.ErrorCodes.ErrorCodeToString(code);
            tblMaestroCoInvestigador maestro = new tblMaestroCoInvestigador();

            ViewBag.idAreaConocimiento = new SelectList(db.tblAreaConocimiento, "id", "Nombre");
            maestro.idUsuario          = AspNetUsers.GetUserId(User.Identity.Name);
            return(View(maestro));
        }
Example #3
0
        public ActionResult ModificarMaestro()
        {
            var idUsuario = AspNetUsers.GetUserId(User.Identity.Name);
            tblMaestroCoInvestigador maestro = db.tblMaestroCoInvestigador.Where(m => m.idUsuario.Equals(idUsuario))
                                               .Include(m => m.tblAreaConocimiento)
                                               .FirstOrDefault();

            ViewBag.idAreaConocimiento = new SelectList(db.tblAreaConocimiento, "id", "Nombre", maestro.idAreaConocimiento);
            maestro.idUsuario          = AspNetUsers.GetUserId(User.Identity.Name);
            return(View(maestro));
        }
 public ActionResult HojaDeVida([Bind(Include = "id,idInstitucion,idUsuario,TiempoOndas,Pregrado,Postgrado,Otro,idAreaConocimiento,ExperienciaAreaConocimiento")] tblMaestroCoInvestigador tblmaestrocoinvvestigador)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.tblMaestroCoInvestigador.Add(tblmaestrocoinvvestigador);
             db.SaveChanges();
             return(RedirectToAction("Index", new { code = 10 }));
         }
         ViewBag.idAreaConocimiento = new SelectList(db.tblAreaConocimiento, "id", "Nombre");
         return(View("HojaDeVida", tblmaestrocoinvvestigador));
     }
     catch (Exception)
     {
         return(RedirectToAction("HojaDeVida", new { code = 20 }));
     }
 }
Example #5
0
 public ActionResult ModificarMaestro([Bind(Include = "id,idUsuario,TiempoOndas,Pregrado,Postgrado,Otro,idAreaConocimiento,ExperienciaAreaConocimiento")] tblMaestroCoInvestigador tblmaestrocoinvvestigador)
 {
     if (ModelState.IsValid)
     {
         try
         {
             db.Entry(tblmaestrocoinvvestigador).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index", new { code = 200 }));
         }
         catch (Exception)
         {
             ;
         }
     }
     ViewBag.idAreaConocimiento = new SelectList(db.tblAreaConocimiento, "id", "Nombre");
     return(View("ModificarMaestro", tblmaestrocoinvvestigador));
 }
Example #6
0
        // GET: Investigador
        public ActionResult Index(int code = 0)
        {
            var idUsuario = AspNetUsers.GetUserId(User.Identity.Name);

            ViewBag.Message = dl.ErrorCodes.ErrorCodeToString(code);
            tblMaestroCoInvestigador maestro = db.tblMaestroCoInvestigador.Where(m => m.idUsuario.Equals(idUsuario))
                                               .Include(m => m.tblAreaConocimiento)
                                               .FirstOrDefault();

            if (maestro != null)
            {
                return(View(maestro));
            }
            else
            {
                return(RedirectToAction("CrearMaestro"));
            }
        }
Example #7
0
        public ActionResult CrearGrupo()
        {
            var idUsuario = AspNetUsers.GetUserId(User.Identity.Name);
            tblMaestroCoInvestigador maestro = db.tblMaestroCoInvestigador.Where(m => m.idUsuario.Equals(idUsuario))
                                               .FirstOrDefault();

            if (maestro != null)
            {
                var tblgrupoinvestigacion = db.tblGrupoInvestigacion.Where(m => m.idUsuario.Equals(idUsuario)).FirstOrDefault();
                if (tblgrupoinvestigacion != null)
                {
                    return(View("VerGrupo", tblgrupoinvestigacion));
                }
                else
                {
                    return(RedirectToAction("Index", "AsistenteGruposInvestigacion"));
                }
            }
            else
            {
                return(RedirectToAction("CrearMaestro", "Investigador"));
            }
        }