public static void Agregar(SAB_UACI_RESPONSABLEDISTRIBUCIONCONTRATO responsable) { using (var db = new SinabEntities()) { db.SAB_UACI_RESPONSABLEDISTRIBUCIONCONTRATO.AddObject(responsable); db.SaveChanges(); } }
public static void Eliminar(SAB_UACI_RESPONSABLEDISTRIBUCIONCONTRATO responsable) { using (var db = new SinabEntities()) { var rec = db.SAB_UACI_RESPONSABLEDISTRIBUCIONCONTRATO.FirstOrDefault(r => r.IDRESPONSABLEDISTRIBUCION == responsable.IDRESPONSABLEDISTRIBUCION && r.IDESTABLECIMIENTO == responsable.IDESTABLECIMIENTO && r.IDPROVEEDOR == responsable.IDPROVEEDOR && r.IDCONTRATO == responsable.IDCONTRATO); if (rec == null) { return; } db.SAB_UACI_RESPONSABLEDISTRIBUCIONCONTRATO.DeleteObject(rec); db.SaveChanges(); } }