public void ResetCache() { Debug.Assert(_ticketWorkspace.Ticket == null); if (_tableWorkspace == null) { var selectedDepartment = SelectedDepartment != null ? SelectedDepartment.Id : 0; var selectedTableScreen = SelectedTableScreen != null ? SelectedTableScreen.Id : 0; SelectedTableScreen = null; SelectedDepartment = null; _tableScreens = null; _departments = null; _permittedDepartments = null; _reasons = null; _lastTwoWorkPeriods = null; _users = null; _rules = null; _actions = null; _vatTemplates = null; _taxServiceTemplates = null; if (selectedTableScreen > 0 && TableScreens.Count(x => x.Id == selectedTableScreen) > 0) { SelectedTableScreen = TableScreens.Single(x => x.Id == selectedTableScreen); } if (selectedDepartment > 0 && Departments.Count(x => x.Id == selectedDepartment) > 0) { SelectedDepartment = Departments.Single(x => x.Id == selectedDepartment); } } }
public void RefreshTables() { if (SelectedTableScreen == null && TableScreens.Count() > 0) { AppServices.MainDataContext.SelectedTableScreen = TableScreens.First(); } if (SelectedTableScreen != null) { UpdateTables(SelectedTableScreen.Id); } }