public ActionResult AgregarEstadoArte(int idGrupoInvestigacion)
        {
            tblEstadoArteProyectoInvestigacion tblestado = new tblEstadoArteProyectoInvestigacion();

            tblestado.idGrupoInvestigacion = idGrupoInvestigacion;
            return(View(tblestado));
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            tblEstadoArteProyectoInvestigacion tblEstadoArteProyectoInvestigacion = db.tblEstadoArteProyectoInvestigacion.Find(id);

            db.tblEstadoArteProyectoInvestigacion.Remove(tblEstadoArteProyectoInvestigacion);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #3
0
 public ActionResult Edit([Bind(Include = "id,idGrupoInvestigacion,TemaInvestigacion,MapaConceptual")] tblEstadoArteProyectoInvestigacion tblEstadoArteProyectoInvestigacion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblEstadoArteProyectoInvestigacion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idGrupoInvestigacion = new SelectList(db.tblGrupoInvestigacion, "id", "Codigo", tblEstadoArteProyectoInvestigacion.idGrupoInvestigacion);
     return(View(tblEstadoArteProyectoInvestigacion));
 }
Example #4
0
        // GET: tblEstadoArteProyectoInvestigacions/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblEstadoArteProyectoInvestigacion tblEstadoArteProyectoInvestigacion = db.tblEstadoArteProyectoInvestigacion.Find(id);

            if (tblEstadoArteProyectoInvestigacion == null)
            {
                return(HttpNotFound());
            }
            return(View(tblEstadoArteProyectoInvestigacion));
        }
Example #5
0
        // GET: tblEstadoArteProyectoInvestigacions/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblEstadoArteProyectoInvestigacion tblEstadoArteProyectoInvestigacion = db.tblEstadoArteProyectoInvestigacion.Find(id);

            if (tblEstadoArteProyectoInvestigacion == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idGrupoInvestigacion = new SelectList(db.tblGrupoInvestigacion, "id", "Codigo", tblEstadoArteProyectoInvestigacion.idGrupoInvestigacion);
            return(View(tblEstadoArteProyectoInvestigacion));
        }
        public ActionResult AgregarEstadoArte([Bind(Include = "id,idGrupoInvestigacion,TemaInvestigacion,MapaConceptual")] tblEstadoArteProyectoInvestigacion tblestado)
        {
            string userId = AspNetUsers.GetUserId(User.Identity.Name);
            int    idRol  = tblMiembroGrupo.GetRoleMiembro(userId, tblestado.idGrupoInvestigacion);

            if (idRol != 1)
            {
                return(RedirectToAction("Index", new { code = 999, id = tblestado.idGrupoInvestigacion }));
            }
            try
            {
                foreach (string file in Request.Files)
                {
                    HttpPostedFileBase hpf = Request.Files[file] as HttpPostedFileBase;
                    if (hpf.ContentLength == 0)
                    {
                        continue;
                    }
                    string folderPath = Server.MapPath("~/Upload/");
                    Directory.CreateDirectory(folderPath);
                    string ext      = Path.GetExtension(hpf.FileName);
                    string fileName = dl.Codigos.CMap(db.tblGrupoInvestigacion.Find(tblestado.idGrupoInvestigacion).Nombre, ext);
                    tblestado.MapaConceptual = fileName;
                    string savedFileName = Server.MapPath("~/Upload/" + fileName);
                    hpf.SaveAs(savedFileName);
                    db.tblEstadoArteProyectoInvestigacion.Add(tblestado);
                    db.SaveChanges();
                    return(RedirectToAction("Index", new { code = 600, id = tblestado.idGrupoInvestigacion }));
                }
            }
            catch (Exception)
            {
                return(RedirectToAction("Index", new { code = 130, id = tblestado.idGrupoInvestigacion }));
            }
            return(View());
        }