public void StartCycle(Dispatcher dispatcher) { var result = startCycle(MyTrainingOperationType.Start); //now refresh Training days cache var customerId = Customer != null ? Customer.GlobalId : (Guid?)null; var myCache = TrainingDaysReposidory.GetCache(customerId, null); myCache.Clear(); MyTrainingsReposidory.GetCache(customerId, null).AddOrUpdate(result); }
public MyTrainingsViewModel(IBAWindow parentView, UserDTO user, CustomerDTO customer) { this.parentView = parentView; User = user; ActiveMonthDateTime = DateTime.Now; Customer = customer; Guid?customerId = Customer != null ? Customer.GlobalId : (Guid?)null; Guid?userId = User != null ? User.GlobalId : (Guid?)null; myTrainingsCache = MyTrainingsReposidory.GetCache(customerId, userId); CollectionChangedEventManager.AddListener(myTrainingsCache, this); updateButtons(); }
public override void AfterSave(bool isWindowClosing) { var cache = MyTrainingsReposidory.GetCache(A6WEntry.TrainingDay.CustomerId, A6WEntry.TrainingDay.ProfileId); cache.ClearCache(); }