private void DeleteDetail(IList<EPerVacaProg> col, bool filterModified)
        {
            if (col == null)
            return;

             IDOUpdate objDO = new RHDOMnt.PerVacaProg();
             IEnumerable<EPerVacaProg> colSel = null;

             if (filterModified)
             {
            var deleteItems = from itm in col
                              where itm.EntityState == EntityState.Deleted
                              select itm;

            colSel = (IEnumerable<EPerVacaProg>)deleteItems;
             }
             else
             {
            var deleteItems = from itm in col
                              select itm;

            colSel = (IEnumerable<EPerVacaProg>)deleteItems;
             }
             foreach (EPerVacaProg objE in colSel)
            objDO.Delete(objE);
        }
        private void UpdateDetail(IList<EPerVacaProg> col, object[] primKey)
        {
            if (col == null)
            return;

             IDOUpdate objDO = new RHDOMnt.PerVacaProg();

             foreach (EPerVacaProg objE in col)
             {

            object[] objRet = null;

            if (primKey != null)
            {
               objE.IdEmpresa = primKey[0].ToString();
            }

            switch (objE.EntityState)
            {

               case EntityState.Added:
                  objRet = objDO.Insert(objE);
                  break;

               case EntityState.Modified:
                  if (objE.StAnulado == ConstFlagEstado.DESACTIVADO)
                     objDO.Update(objE);
                  else
                     objDO.Delete(objE);
                  break;

            }

             }
        }
        private object[] UpdateMaster(EPerVacaProg entity)
        {
            IDOUpdate objDO = new RHDOMnt.PerVacaProg();

             if (entity.EntityState == EntityState.Unchanged)
            return null;

             object[] objRet = null;

             switch (entity.EntityState)
             {

            case EntityState.Added:
               objRet = objDO.Insert(entity);
               break;

            case EntityState.Modified:
               if (entity.StAnulado == ConstFlagEstado.DESACTIVADO)
                  objDO.Update(entity);
               else
                  objDO.Delete(entity);
               break;

            case EntityState.Deleted:
               objDO.Delete(entity);
               break;

             }

             return objRet;
        }
        private void DeleteMaster(EPerVacaProg entity)
        {
            IDOUpdate objDO = new RHDOMnt.PerVacaProg();

             if (entity.EntityState == EntityState.Unchanged)
            return;

             objDO.Delete(entity);
        }