Exemplo n.º 1
0
        private void DeleteDetail(IList<EHora> col, bool filterModified)
        {
            if (col == null)
            return;

             IDOUpdate objDO = new RHDOMnt.Hora();
             IEnumerable<EHora> colSel = null;

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

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

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

             IDOUpdate objDO = new RHDOMnt.Hora();

             foreach (EHora objE in col)
             {

            object[] objRet = null;

            if (primKey != null)
            {
               objE.IdHora = 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;

            }

             }
        }
Exemplo n.º 3
0
        private object[] UpdateMaster(EHora entity)
        {
            IDOUpdate objDO = new RHDOMnt.Hora();

             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;
        }
Exemplo n.º 4
0
        private void DeleteMaster(EHora entity)
        {
            IDOUpdate objDO = new RHDOMnt.Hora();

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

             objDO.Delete(entity);
        }