public void LoadSavedFilterView(SavedFilter savedFilter) { TOBEntityEnum panelCollectionType = (TOBEntityEnum)savedFilter.PanelTypeId; _accountInfo.SelectPanel(); string savedfilterPanelKey = "SAVEDFILTERPANEL" + savedFilter.Id; UserAllTweets savedFilterView; if (_panelViewDict.ContainsKey(savedfilterPanelKey)) { savedFilterView = _panelViewDict[savedfilterPanelKey]; } else { savedFilterView = new UserAllTweets(); // savedFilterView.DataTemplate = savedFilterView.FindResource("TweetsControlsDataTemplate") as DataTemplate; SetMessageObjectPanelCollection(savedFilterView, panelCollectionType, savedFilter.AccountFilterMappings.Select(a => (int)a.AccountId).ToList()); _panelViewDict.Add(savedfilterPanelKey, savedFilterView); } _currentTweetsView = savedFilterView; _mainWindow.frmTOBMain.Content = savedFilterView; _userProfileView.Visibility = Visibility.Collapsed; _currentTweetsView.SetFilterBoxText(savedFilter.FilterText); _tweetSender.txtSearchBox.Text = ""; }
private void detach_SavedFilters(SavedFilter entity) { this.SendPropertyChanging(); entity.PanelType = null; }
public void DeleteSavedFilter(SavedFilter saveFilter) { MessageBoxResult messageResult; messageResult = MessageBox.Show("Are you sure you want to delete this saved filter?", "Delete Confirmation", MessageBoxButton.YesNo); if (messageResult == MessageBoxResult.Yes) { SavedFilter savedFilter = LocalSavedFilterBO.Get(filter => filter.Id == saveFilter.Id); if (savedFilter != null) { AccountFilterMappingBO accountMappingBO = new AccountFilterMappingBO(); List<AccountFilterMapping> accountMappingList = accountMappingBO.GetAll().Where(map => map.FilterId == saveFilter.Id).ToList(); if (accountMappingList != null) { accountMappingBO.DeleteAll(accountMappingList); accountMappingBO.SaveChanges(); } LocalSavedFilterBO.Delete(savedFilter); LocalSavedFilterBO.SaveChanges(); } } _currentTweetsView.txtFilter.Text = ""; _accountInfo.BindSavedFilters(); Panel info = null; //Need to change this LoadHomeView(info); }
partial void UpdateSavedFilter(SavedFilter instance);
partial void InsertSavedFilter(SavedFilter instance);
partial void DeleteSavedFilter(SavedFilter instance);
public void AddFilter(SavedFilter savedFilter) { if (savedFilter != null) { _savedFilerList.Add(savedFilter); savedFilter.CommandFilter = TOBCommands.FilterCommand; savedFilter.CommandDeleteFilter = TOBCommands.DeleteFilterCommand; } }