public void Eliminar(int id) { try { SISECOOBEntities db = new SISECOOBEntities(); SubProgramasPGOs pro = db.SubProgramasPGOs.FirstOrDefault(i => i.SubprogramaPGOID == id); db.SubProgramasPGOs.DeleteObject(pro); db.SaveChanges(); } catch (Exception e) { throw e; } }
public void Editar() { try { SISECOOBEntities db = new SISECOOBEntities(); SubProgramasPGOs pro = db.SubProgramasPGOs.FirstOrDefault(i => i.SubprogramaPGOID == this.SubprogramaPGOID); pro.SubprogramaPGO = SubprogramaPGO; db.SaveChanges(); } catch (Exception e) { throw e; } }