private void InitViewModel() { IsSearched = true; Repository = new StockUnitRepository(); if (_card.IsNew) { Filter = new StockUnitFilter(); } else { var filter = new StockUnitFilterParams { Card = new List <Card> { _card } }; Filter = new StockUnitFilter(filter); } Result = new List <StockUnit>(); OkCommand = new RelayCommand(x => OkMethod()); CancelCommand = new RelayCommand(x => CloseAction()); if (RefreshCommand != null) { RefreshCommand.Execute(null); } }
private void ClearFilterMethod() { Filter = new StockUnitFilter(); ComplexFilterParams = new StockUnitFilterParams(); InitFilter(); if (string.IsNullOrEmpty(SearchString)) { IsSearched = false; } if (RefreshCommand != null) { RefreshCommand.Execute(null); } }
private void FillFilter() { var owners = (from item in FilterOwnerCheckList where item.IsChecked select item.Item).ToList(); var cards = (from item in FilterCardCheckList where item.IsChecked select item.Item).ToList(); var status = (from item in FilterStatusCheckList where item.IsChecked select item.Item).ToList(); FilterOwnerCount = owners.Count; FilterCardCount = cards.Count; FilterStatusCount = status.Count; var filterParams = ComplexFilterParams as StockUnitFilterParams; if (filterParams != null) { filterParams.Owner = owners; filterParams.Status = status; filterParams.Card = cards; Filter = new StockUnitFilter(filterParams); } }