List <Delivery> IDeliveryService.GetAll() { List <Delivery> deliveries = (this as IDeliveryService).RefreshAll(); if (deliveries == null || deliveries.Count == 0) { deliveries = _dbHandler.GetAll(); } return(deliveries); }
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); }