public void InsertarGradoEstudio(tbInfoGradoEstudio tbgradoestudio) { using (var db = new BD_SIRESEPEntities1()) { db.InfoGradoEstudio.Add(MapearBD(tbgradoestudio)); db.SaveChanges(); } }
private InfoGradoEstudio MapearBD(tbInfoGradoEstudio tbinfoGrado) { return(new InfoGradoEstudio() { idGradoEstudio = tbinfoGrado.idGradoEstudio, descripcion = tbinfoGrado.descripcion, }); }
public ActionResult Create(tbInfoGradoEstudio tbgrado) { if (ModelState.IsValid) { grado.InsertarGradoEstudio(tbgrado); } return(RedirectToAction("Index")); }
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(); } }
public ActionResult Edit(tbInfoGradoEstudio tbgrado) { grado.ActualizarGradoEstudio(tbgrado); return(RedirectToAction("Index")); }