コード例 #1
0
 public void InsertarGradoEstudio(tbInfoGradoEstudio tbgradoestudio)
 {
     using (var db = new BD_SIRESEPEntities1())
     {
         db.InfoGradoEstudio.Add(MapearBD(tbgradoestudio));
         db.SaveChanges();
     }
 }
コード例 #2
0
 private InfoGradoEstudio MapearBD(tbInfoGradoEstudio tbinfoGrado)
 {
     return(new InfoGradoEstudio()
     {
         idGradoEstudio = tbinfoGrado.idGradoEstudio,
         descripcion = tbinfoGrado.descripcion,
     });
 }
コード例 #3
0
 public ActionResult Create(tbInfoGradoEstudio tbgrado)
 {
     if (ModelState.IsValid)
     {
         grado.InsertarGradoEstudio(tbgrado);
     }
     return(RedirectToAction("Index"));
 }
コード例 #4
0
 public void ActualizarGradoEstudio(tbInfoGradoEstudio tbgradoestudio)
 {
     using (var db = new BD_SIRESEPEntities1())
     {
         var editar = db.InfoGradoEstudio.Find(tbgradoestudio.idGradoEstudio);
         //solo se ponen los datos que se pueden editar
         editar.descripcion = tbgradoestudio.descripcion;
         db.SaveChanges();
     }
 }
コード例 #5
0
 public ActionResult Edit(tbInfoGradoEstudio tbgrado)
 {
     grado.ActualizarGradoEstudio(tbgrado);
     return(RedirectToAction("Index"));
 }