Пример #1
0
 private void CheckParametersForInsertMethod(InsertPlaceType place, Guid position)
 {
     if (place == InsertPlaceType.AfterGuid && position == Guid.Empty)
     {
         throw new ServiceParametersValidationException(@"Guid can't be Empty. Check the parameter 'Guid position'");
     }
 }
Пример #2
0
 private Boolean InsertEvent(String server, Int32 list, EventDTO ev, InsertPlaceType insertType, Guid position)
 {
     if (_listService == null)
     {
         return(false);
     }
     try
     {
         _listService.LockList(_loginSession, server, list, CLIENT_LOCKER_NAME);
         _listService.InsertEvent(_loginSession, server, list, ev, insertType, position);
         _listService.UnlockList(_loginSession, server, list, CLIENT_LOCKER_NAME);
         return(true);
     }
     catch (ListServiceEventProcessingException) { return(false); }
     catch (ListServiceListNotEnabledException) { return(false); }
     catch (ListServiceListLockedException) { return(false); }
     catch (ADCEventException) { return(false); }
     catch (ADCException) { return(false); }
 }
Пример #3
0
        private IEnumerable <EventDTO> InsertEventList(String server, Int32 list, InsertPlaceType insertType, IEnumerable <EventDTO> events, Guid position)
        {
            IEnumerable <EventDTO> result = null;

            if (_listService != null)
            {
                try
                {
                    _listService.LockList(_loginSession, server, list, CLIENT_LOCKER_NAME);
                    result = _listService.InsertEventList(_loginSession, server, list, events, insertType,
                                                          position);
                    _listService.UnlockList(_loginSession, server, list, CLIENT_LOCKER_NAME);
                }
                catch (ListServiceEventProcessingException) {}
                catch (ListServiceListNotEnabledException) {}
                catch (ListServiceListLockedException) {}
                catch (ADCEventException) {}
                catch (ADCException) {}
            }
            return(result);
        }
Пример #4
0
        public IEnumerable <EventDTO> InsertEventList(LoginSession session, String server, Int32 list, IEnumerable <EventDTO> events, InsertPlaceType place, Guid position)
        {
            if (events == null || !events.Any())
            {
                return(new List <EventDTO>());
            }

            CheckListLock(server, list);
            CheckParametersForInsertMethod(place, position);
            var tmpList = events.Select(pair => pair.ToPair()).ToList();

            return(_adcSrv.InsertEventList(server, list, tmpList, place, position).Select(pair => pair.ToDTO()));
        }
Пример #5
0
        public EventDTO InsertEvent(LoginSession session, String server, Int32 list, EventDTO ev, InsertPlaceType place, Guid position)
        {
            if (ev == null)
            {
                return(null);
            }
            CheckListLock(server, list);
            CheckParametersForInsertMethod(place, position);
            var tmpPair = ev.ToPair();

            return(_adcSrv.InsertEvent(server, list, tmpPair, place, position).ToDTO());
        }
Пример #6
0
        public IEnumerable <EventEventIdPair> InsertEventList(String server, Int32 list, IEnumerable <EventEventIdPair> events, InsertPlaceType place, Guid position)
        {
            IEnumerable <EventEventIdPair> result;

            result = GetListHelper(server, list).InsertEvents(position, events, place);
            return(result);
        }
Пример #7
0
        public EventEventIdPair InsertEvent(String server, Int32 list, EventEventIdPair ev, InsertPlaceType place, Guid position)
        {
            ADCListHelper           lc = GetListHelper(server, list);
            List <EventEventIdPair> el = new List <EventEventIdPair> {
                ev
            };
            var res = lc.InsertEvents(position, el, place);

            return(res.FirstOrDefault());
        }