Esempio n. 1
0
        List <Delivery> IDeliveryService.RefreshAll()
        {
            List <Delivery> deliveries = _remoteHandler.GetAll();

            if (deliveries != null && deliveries.Count > 0)
            {
                _dbHandler.DeleteAll();
                _dbHandler.Add(deliveries);
            }
            return(deliveries);
        }
Esempio n. 2
0
        public bool SaveActivity(BGActivity bGActivity)
        {
            int rowsEffected = -1;

            using (_dbHandler = SADFactory.GetDBHandler <BGActivity>())
            {
                var existingActivitys = _dbHandler.GetAll(a => a.TargetObjectId == bGActivity.TargetObjectId);

                if (existingActivitys.Count > 0)
                {
                    var existingActivity = existingActivitys.First();
                    _dbHandler.DeleteItem(existingActivity.ActivityId);
                }
                rowsEffected = _dbHandler.Add(bGActivity);
            }
            return(rowsEffected != -1);
        }
Esempio n. 3
0
 public static IEnumerable <Record> DBAdd(this IEnumerable <Record> items, IDBHandler handler, Action <IEnumerable <Record> > action, int bulkCount = 10000)
 => handler.Add(items, action, bulkCount);
Esempio n. 4
0
 public static IEnumerable <T> DBAdd <T>(this IEnumerable <T> items, IDBHandler handler, int bulkCount = 10000) where T : IEntity
 => handler.Add(items, bulkCount);
Esempio n. 5
0
 public void Add(T item) => Handler.Add(item);