Exemple #1
0
        public ActionResult Edit([Bind(Include = "InformacionPersonalID,NombresEgresado,PrimerApellidoEgresado,SegundoApellidoEgresado,FechaNacimientoEgresado,NumeroDocumentoEgresado,FechaExpedicionDocumento,SexoEgresado,correoEgresado,DireccionResidenciaEgresado,TelefonoMovilEgresado,TelefonoFijoEgresado,ExtencionTelefonoEgresado,NumeroActaGrado,FotoEgresado,UserName,Imagen,MunicipioID,TipoDocumentoID,DepartamentoID")] InformacionPersonal informacionPersonal)
        {
            InformacionPersonal _imagenAcutal = new InformacionPersonal();
            HttpPostedFileBase  fileBase      = Request.Files[0];

            if (fileBase.ContentLength == 0)
            {
                _imagenAcutal = db.InformacionPersonals.Find(informacionPersonal.InformacionPersonalID);
            }
            else
            {
                if (fileBase.FileName.EndsWith(".jpg"))
                {
                    WebImage Imagen = new WebImage(fileBase.InputStream);

                    informacionPersonal.Imagen = Imagen.GetBytes();
                }
                else
                {
                    ModelState.AddModelError("Imagen", "El sistema unicamente acepta imagenes con formato JPG.");
                }
            }

            if (ModelState.IsValid)
            {
                db.Entry(_imagenAcutal).State       = EntityState.Detached;
                db.Entry(informacionPersonal).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Ver"));
            }
            ViewBag.TipoDocumentoID = new SelectList(db.TipoDocumentoes, "TipoDocumentoID", "NombreTipoDocumento", informacionPersonal.TipoDocumentoID);
            ViewBag.DepartamentoID  = new SelectList(db.Departamentoes, "DepartamentoID", "NombreDepartamento");
            ViewBag.MunicipioID     = new SelectList(db.Municipios.Where(m => m.DepartamentoID == db.Departamentoes.FirstOrDefault().DepartamentoID), "MunicipioID", "NombreMunicipio");
            return(View(informacionPersonal));
        }
Exemple #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            InformacionPersonal informacionPersonal = db.InformacionPersonals.Find(id);

            db.InformacionPersonals.Remove(informacionPersonal);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #3
0
 public static Universidad ObtenerUniversidad(carreras carrera, InformacionPersonal info)
 {
     if (university != null)
     {
         return(university);
     }
     university = new Universidad(carrera, info);
     return(university);
 }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "InformacionPersonalID,NombresEgresado,PrimerApellidoEgresado,SegundoApellidoEgresado,FechaNacimientoEgresado,NumeroDocumentoEgresado,FechaExpedicionDocumento,SexoEgresado,correoEgresado,DireccionResidenciaEgresado,TelefonoMovilEgresado,TelefonoFijoEgresado,ExtencionTelefonoEgresado,NumeroActaGrado,FotoEgresado,EstadoEgresado")] InformacionPersonal informacionPersonal)
 {
     if (ModelState.IsValid)
     {
         db.Entry(informacionPersonal).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(informacionPersonal));
 }
Exemple #5
0
        public ActionResult Create([Bind(Include = "InformacionPersonalID,NombresEgresado,PrimerApellidoEgresado,SegundoApellidoEgresado,FechaNacimientoEgresado,NumeroDocumentoEgresado,FechaExpedicionDocumento,SexoEgresado,correoEgresado,DireccionResidenciaEgresado,TelefonoMovilEgresado,TelefonoFijoEgresado,ExtencionTelefonoEgresado,NumeroActaGrado,FotoEgresado,TipoDocumentoID")] InformacionPersonal informacionPersonal)
        {
            if (ModelState.IsValid)
            {
                db.InformacionPersonals.Add(informacionPersonal);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.TipoDocumentoID = new SelectList(db.TipoDocumentoes, "TipoDocumentoID", "NombreTipoDocumento", informacionPersonal.TipoDocumentoID);
            return(View(informacionPersonal));
        }
Exemple #6
0
        // GET: InformacionPersonals/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InformacionPersonal informacionPersonal = db.InformacionPersonals.Find(id);

            if (informacionPersonal == null)
            {
                return(HttpNotFound());
            }
            return(View(informacionPersonal));
        }
Exemple #7
0
        // GET: InformacionPersonals/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InformacionPersonal informacionPersonal = db.InformacionPersonals.Find(id);

            if (informacionPersonal == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TipoDocumentoID = new SelectList(db.TipoDocumentoes, "TipoDocumentoID", "NombreTipoDocumento", informacionPersonal.TipoDocumentoID);
            return(View(informacionPersonal));
        }
Exemple #8
0
        public ActionResult getImage(int id)
        {
            InformacionPersonal lkinformacionPersonal = db.InformacionPersonals.Find(id); /*db.InformacionPersonal.Find(id);*/

            byte[] byteImagen = lkinformacionPersonal.Imagen;

            MemoryStream memoryStream = new MemoryStream(byteImagen);
            Image        imagen       = Image.FromStream(memoryStream);


            memoryStream = new MemoryStream();
            //imagen.Save(memoryStream, ImageFormat.Jpeg);
            imagen.Save(memoryStream, ImageFormat.Jpeg);
            memoryStream.Position = 0;

            return(File(memoryStream, "imagen/jpg"));
        }
Exemple #9
0
        // GET: InformacionPersonals/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InformacionPersonal informacionPersonal = db.InformacionPersonals.Find(id);

            if (informacionPersonal == null)
            {
                return(HttpNotFound());
            }

            ViewBag.TipoDocumentoID = new SelectList(db.TipoDocumentoes, "TipoDocumentoID", "NombreTipoDocumento", informacionPersonal.TipoDocumentoID);
            ViewBag.DepartamentoID  = new SelectList(db.Departamentoes, "DepartamentoID", "NombreDepartamento");
            ViewBag.MunicipioID     = new SelectList(db.Municipios.Where(m => m.DepartamentoID == db.Departamentoes.FirstOrDefault().DepartamentoID), "MunicipioID", "NombreMunicipio");
            return(View(informacionPersonal));
        }
 public ActionResult Edit([Bind(Include = "idInformacion,nombres,apellidos,dui,fechaNacimiento,direccionResidencia,telefono,correoElectronico")] InformacionPersonal informacionPersonal)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(informacionPersonal).State = EntityState.Modified;
             db.SaveChanges();
             TempData["CambiarD"] = "El usuario se modifico correctamente";
             return(RedirectToAction("Index"));
         }
         return(View(informacionPersonal));
     }
     catch (Exception e)
     {
         return(RedirectToAction("Index"));
     }
 }
        public void ComprobarSingleton()
        {
            //Arrange
            InformacionPersonal info  = new InformacionPersonal();
            InformacionPersonal info1 = new InformacionPersonal();

            bool variable;


            // Act CORREGIR
            if (Universidad.ObtenerUniversidad(clases.carreras.Abogacia, info) == Universidad.ObtenerUniversidad(clases.carreras.Ingenieria, info1))
            {
                variable = true;
            }
            else
            {
                variable = false;
            }

            // Assert
            Assert.AreEqual(true, variable);
        }
Exemple #12
0
 private Universidad(carreras carrera, InformacionPersonal info)
 {
     this.carrera     = carrera;
     this.Informacion = info;
 }