Пример #1
0
        List <Delivery> IDeliveryService.GetAll()
        {
            List <Delivery> deliveries = (this as IDeliveryService).RefreshAll();

            if (deliveries == null || deliveries.Count == 0)
            {
                deliveries = _dbHandler.GetAll();
            }
            return(deliveries);
        }
Пример #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);
        }