private void ApplyFilter(FilterEvent fe) { if (!IsSynchronized && fe.PresenterID != PresenterID) { return; } switch (fe.Filter) { case Filter.Filters.None: { Image temp = DisplayedImage; temp.Bitmap = new Rotate().SingleBitmapRotation((int)temp.Rotation * 90, temp.OriginalBitmap); DisplayedImage = temp; } break; case Filter.Filters.Brightness: { Image temp = DisplayedImage; temp.Bitmap = Filter.Brightness(temp.OriginalBitmap, fe.Value); DisplayedImage = temp; } break; case Filter.Filters.Contrast: { Image temp = DisplayedImage; temp.Bitmap = Filter.Contrast(temp.OriginalBitmap, fe.Value); DisplayedImage = temp; } break; case Filter.Filters.Sepia: { Image temp = DisplayedImage; temp.Bitmap = Filter.Sepia(temp.OriginalBitmap, fe.Value); DisplayedImage = temp; } break; case Filter.Filters.Negative: { Image temp = DisplayedImage; temp.Bitmap = Filter.Negative(temp.OriginalBitmap); DisplayedImage = temp; } break; case Filter.Filters.GreyScale: { Image temp = DisplayedImage; temp.Bitmap = Filter.GreyScale(temp.OriginalBitmap); DisplayedImage = temp; } break; default: break; } }
private void FilterTriggered(FilterEvent obj) { if (obj.IsFilterEmpty) { CurrentFilter.Reset(); } }
private void FilterChoose(Object filter) { FilterEvent fe = new FilterEvent(); fe.Filter = (Filter.Filters)filter; fe.PresenterID = this.PresenterID; fe.Value = 0; if (fe.Filter != Filter.Filters.Negative && fe.Filter != Filter.Filters.None && fe.Filter != Filter.Filters.GreyScale) { if (FilterControlWindow.Instance.Visibility == Visibility.Collapsed) { FilterControlWindow.Instance.Visibility = Visibility.Visible; } if (IsSynchronized) { _aggregator.GetEvent <FilterEvent>().Publish(fe); } } else { if (IsSynchronized) { _aggregator.GetEvent <SendFilterValueEvent>().Publish(fe); } else { ApplyFilter(fe); } } }
/// <summary> /// Метод возвращающий List объектов по фильтру /// </summary> /// <param name="filters">Фильтр данных</param> /// <param name="page">Элемент для вывода информации о страницах на UI</param> /// <returns>List<Event></returns> public List <Event> Get(FilterEvent filters, ref DataPage dataPage) { using (DataBaseModel context = new DataBaseModel()) { IQueryable <Event> query = from t in context.Events select t; if (filters.StartDate > filters.FinishDate) { filters.StartDate = DateTime.MinValue; filters.FinishDate = DateTime.MaxValue; } if (filters.StartDate != DateTime.MinValue) { query = query.Where(t => t.Time >= filters.StartDate); } if (filters.FinishDate != DateTime.MaxValue) { DateTime dateTime = filters.FinishDate.AddDays(1); query = query.Where(t => t.Time <= dateTime); } if (!String.IsNullOrEmpty(filters.Message)) { query = query.Where(t => t.Message.Contains(filters.Message)); } dataPage.sizeAll = query.Select(t => t).Count(); //Всего записей в таблице БД по данному фильтру query = query.OrderBy(t => t.Time).Skip(filters.Page * dataPage.pageSizeMax).Take(dataPage.pageSizeMax).Select(t => t); //Выборка из n записей соответствующих выбранной странице List <Event> myList = query.ToList(); return(myList); } }
private void DgResults_OnOnFilter(object sender, FilterEvent e) { var viewModel = (GeneratePurchaseViewModel)DataContext; if (_temp == 1) { viewModel.SelectedPurchaseRow.DetailsList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.DetailFilter = filter; viewModel.DetailValuesObjects = valueObjecttemp; viewModel.GetDetailData(); } else { viewModel.SelectedPurchaseRow.DetailsList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.DetailFilter = filter; viewModel.DetailValuesObjects = valueObjecttemp; viewModel.GetDetail2Data(); } }
/// <summary> /// Handle event after filter state changing /// </summary> private void FilterTriggered(FilterEvent obj) { SetFilter(obj.IsFilterEmpty, obj.CurrentFilter); LoadData(); OnHideFilter(); }
private void Grid_OnOnFilter(object sender, FilterEvent e) { string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); _viewModel.Filter = filter; _viewModel.ValuesObjects = valueObjecttemp; }
private void DetailSubGrid_OnFilter(object sender, FilterEvent e) { _viewModel.SelectedMainRow.StyleDetailList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); _viewModel.DetailSubFilter = filter; _viewModel.DetailSubValuesObjects = valueObjecttemp; _viewModel.GetRecInvStyle(); }
private void DgDyeingOrderResults_OnOnFilter(object sender, FilterEvent e) { ViewModel.DyeingOrderHeaderList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); ViewModel.Filter = filter; ViewModel.ValuesObjects = valueObjecttemp; ViewModel.SearchHeader(); }
private void DetailGrid_OnFilter(object sender, FilterEvent e) { ViewModel.TransactionHeader.DetailsList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); ViewModel.DetailFilter = filter; ViewModel.DetailValuesObjects = valueObjecttemp; ViewModel.GetDetailData(); }
private void FilterTriggered(FilterEvent obj) { if (!obj.IsFilterEmpty) { IsFilterSet = true; } _currentFilter = obj.CurrentFilter; OnHideFilter(); }
private void DetailGrid_OnOnFilter(object sender, FilterEvent e) { _viewModel.RecieveHeaderList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); _viewModel.DetailSubFilter = filter; _viewModel.DetailSubValuesObjects = valueObjecttemp; _viewModel.GetRecieveHeaderListData(); }
private void MainGrid_OnFilter(object sender, FilterEvent e) { _viewModel.MainRowList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); _viewModel.Filter = filter; _viewModel.ValuesObjects = valueObjecttemp; _viewModel.GetMaindata(); }
private void DetailGrid_OnFilter(object sender, FilterEvent e) { _viewModel.SelectedMainRow.DetailsList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); _viewModel.DetailFilter = filter; _viewModel.DetailValuesObjects = valueObjecttemp; _viewModel.GetDetailData(); }
// Update is called once per frame void Update() { var tex = textureHolder.GetTexture(); if (tex == null) { return; } imageFilterGroup.Filter(tex); FilterEvent?.Invoke(imageFilterGroup.GetRenderTexture()); }
private void MainGrid_OnFilter(object sender, FilterEvent e) { var viewModel = DataContext as AccessoriesViewModel; viewModel.MainRowList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.Filter = filter; viewModel.ValuesObjects = valueObjecttemp; viewModel.GetAllAcc(); }
private void DgResults_OnOnFilter(object sender, FilterEvent e) { var viewModel = (FabricDefectsViewModel)DataContext; viewModel.TransactionHeaderList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.DetailFilter = filter; viewModel.DetailValuesObjects = valueObjecttemp; viewModel.SearchHeader(); }
private void MainGrid_OnFilter(object sender, FilterEvent e) { var viewModel = DataContext as GlobalRetailBusinessBudgetViewModel; viewModel.MainRowList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.Filter = filter; viewModel.ValuesObjects = valueObjecttemp; viewModel.GetMaindata(); }
private void DgResults_OnOnFilter(object sender, FilterEvent e) { var viewModel = (PurchaseOrderRequestViewModel)DataContext; viewModel.MainRowList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.Filter = filter; viewModel.ValuesObjects = valueObjecttemp; viewModel.GetMaindata(); }
private void DgResults_OnOnFilter(object sender, FilterEvent e) { var viewModel = (IssueJournalViewModel)DataContext; viewModel.SelectedMainRow.SubDetailList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.DetailSubFilter = filter; viewModel.DetailSubValuesObjects = valueObjecttemp; viewModel.GetSubDetaildata(); }
private void DgResults_OnOnFilter(object sender, FilterEvent e) { var viewModel = (DyeingOrderInvoiceViewModel)DataContext; viewModel.MainRowList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.DetailFilter = filter; viewModel.DetailValuesObjects = valueObjecttemp; viewModel.SearchHeader(); }
private void RecGrid_OnOnFilter(object sender, FilterEvent e) { var viewModel = (PurchaseOrderRequestViewModel)DataContext; viewModel.SelectedMainRow.RecHeaderList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.DetailSubFilter = filter; viewModel.DetailSubValuesObjects = valueObjecttemp; viewModel.GetRecHeader(); }
private void MainGrid_OnFilter(object sender, FilterEvent e) { _viewModel.MainRowList.Clear(); var counter = 0; _viewModel.Filter = null; _viewModel.ValuesObjects = new Dictionary <string, object>(); foreach (var f in e.FiltersPredicate) { string paramter = "(@" + f.FilterColumnInfo.PropertyPath.Replace(".", "_") + counter + ")"; object myObject = null; try { myObject = Convert.ChangeType(f.FilterText, f.FilterColumnInfo.PropertyType, null); } catch (Exception) { myObject = ""; } switch (f.SelectedFilterOperation.FilterOption) { case Enums.FilterOperation.EndsWith: myObject = "%" + f.FilterText; break; case Enums.FilterOperation.StartsWith: myObject = f.FilterText + "%"; break; case Enums.FilterOperation.Contains: myObject = "%" + f.FilterText + "%"; break; } _viewModel.ValuesObjects.Add(f.FilterColumnInfo.PropertyPath.Replace(".", "_") + counter, myObject); if (counter > 0) { _viewModel.Filter = _viewModel.Filter + " and "; } _viewModel.Filter = _viewModel.Filter + "it." + f.FilterColumnInfo.PropertyPath + f.SelectedFilterOperation.LinqUse + paramter; counter++; } _viewModel.GetMaindata(); }
private void MainGrid_OnFilter(object sender, FilterEvent e) { var viewModel = DataContext as ColorLinkViewModel; if (viewModel != null) { viewModel.ColorsList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); viewModel.DetailFilter = filter; viewModel.DetailValuesObjects = valueObjecttemp; viewModel.GetDetaildata(); } }
private void StandardBomGrid_OnFilter(object sender, FilterEvent e) { if (_viewModel.Loading) { return; } _viewModel.StandardBomList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); _viewModel.DetailFilter = filter; _viewModel.DetailValuesObjects = valueObjecttemp; _viewModel.GetStandardBom(); }
private void FilterChoose(Object filter) { FilterEvent fe = new FilterEvent(); fe.Filter = (Filter.Filters)filter; fe.PresenterID = this.PresenterID; if (IsSynchronized) { _aggregator.GetEvent <FilterEvent>().Publish(fe); } else { ApplyFilter(fe); } }
public IEnumerable <vw_event> Post(FilterEvent fillter) { //List<string> statusList = fillter.iStatus.Select(y => y.statusName).ToList(); IEnumerable <vw_event> result = _context.vw_events.ToList(); if (fillter.userId == null) { result = result.Where(o => fillter.iStatus.Contains((int)o.statusCode)); } else { //user Nullable <DateTime> datenow = DateTime.Now; result = result.Where(o => o.userId == fillter.userId && o.startDate >= datenow && fillter.iStatus.Contains((int)o.statusCode)); } return(result); }
private void MainGrid_OnFilter(object sender, FilterEvent e) { var _viewModel = DataContext as PromHeaderViewModel; if (_viewModel.Loading) { return; } _viewModel.DetailList.Clear(); string filter; Dictionary <string, object> valueObjecttemp; GeneralFilter.GeneralFilterMethod(out filter, out valueObjecttemp, e); _viewModel.DetailFilter = filter; _viewModel.DetailValuesObjects = valueObjecttemp; _viewModel.GetDetailData(); }
private void MainGrid_OnOnFilter(object sender, FilterEvent e) { _viewModel.MainRowList.Clear(); int counter = 0; _viewModel.Filter = null; _viewModel.ValuesObjects = new Dictionary <string, object>(); foreach (ColumnFilterControl f in e.FiltersPredicate) { string paramter = "(@" + f.FilterColumnInfo.PropertyPath + counter + ")"; object myObject = Convert.ChangeType(f.FilterText, f.FilterColumnInfo.PropertyType, null); switch (f.SelectedFilterOperation.FilterOption) { case Enums.FilterOperation.EndsWith: myObject = Convert.ChangeType("%" + f.FilterText, f.FilterColumnInfo.PropertyType, null); break; case Enums.FilterOperation.StartsWith: myObject = Convert.ChangeType(f.FilterText + "%", f.FilterColumnInfo.PropertyType, null); break; case Enums.FilterOperation.Contains: myObject = Convert.ChangeType("%" + f.FilterText + "%", f.FilterColumnInfo.PropertyType, null); break; } _viewModel.ValuesObjects.Add(f.FilterColumnInfo.PropertyPath + counter, myObject); if (counter > 0) { _viewModel.Filter = _viewModel.Filter + " and "; } _viewModel.Filter = _viewModel.Filter + "it." + f.FilterColumnInfo.PropertyPath + f.SelectedFilterOperation.LinqUse + paramter; counter++; } if (!_viewModel.Loading) { _viewModel.GetMaindata(_userControl.Brand.Iserial); } }
private void OsGrid_OnOnFilter(object sender, FilterEvent e) { var emp = ""; var name = ""; foreach (var f in e.FiltersPredicate) { if (f.Column.SortMemberPath == "EmpId") { emp = f.FilterText; } else { name = f.FilterText; } // var myObject = Convert.ChangeType(f.FilterText, f.FilterColumnInfo.PropertyType, null); } _viewModel.SelectedMainRow = _viewModel.TransactionHeader.SelectedMainRows.FirstOrDefault( x => (x.EmpId.ToLowerInvariant().StartsWith(emp.ToLowerInvariant()) || emp == "") && (x.Name.ToLowerInvariant().StartsWith(name.ToLowerInvariant()) || name == "")); //switch (f.SelectedFilterOperation.FilterOption) // { // case Enums.FilterOperation.EndsWith: // break; // //case Enums.FilterOperation.StartsWith: // // myObject = Convert.ChangeType(f.FilterText + "%", f.FilterColumnInfo.PropertyType, null); // // break; // //case Enums.FilterOperation.Contains: // // myObject = Convert.ChangeType("%" + f.FilterText + "%", f.FilterColumnInfo.PropertyType, null); // // break; // } // _viewModel.ValuesObjects.Add(f.FilterColumnInfo.PropertyPath + counter, myObject); //} //_viewModel.GetMaindata(); }
public void Add(FilterEvent fe ) { filters.Add(fe); }
private bool? ExpandTokens(JToken jt, FilterEvent fe) { if (jt.HasValues) { JTokenType[] decodeable = { JTokenType.Boolean, JTokenType.Date, JTokenType.Integer, JTokenType.String, JTokenType.Float, JTokenType.TimeSpan }; foreach (JToken jc in jt.Children()) { //System.Diagnostics.Trace.WriteLine(string.Format(" >> Child {0} : {1} {2}", cno, jc.Path, jc.Type.ToString())); if (jc.HasValues) { bool? r = ExpandTokens(jc, fe); if (r.HasValue) return r.Value; } else if (Array.FindIndex(decodeable, x => x == jc.Type) != -1) { string name = jc.Path; string value = jc.Value<string>(); Fields f = fe.fields.Find(x => x.itemname.Equals(name)); // unique match against field names and name, can't do two here // which would imply that the JSON has two identical field names.. if (f!=null) { bool matched = false; double valued; if (f.matchtype == MatchType.Equals) matched = value.Equals(f.contentmatch,StringComparison.InvariantCultureIgnoreCase); if (f.matchtype == MatchType.EqualsCaseSensitive) matched = value.Equals(f.contentmatch); else if (f.matchtype == MatchType.NotEqual) matched = !value.Equals(f.contentmatch, StringComparison.InvariantCultureIgnoreCase); else if (f.matchtype == MatchType.NotEqualCaseSensitive) matched = !value.Equals(f.contentmatch); else if (f.matchtype == MatchType.Contains) matched = value.IndexOf(f.contentmatch, StringComparison.InvariantCultureIgnoreCase) >= 0; else if (f.matchtype == MatchType.ContainsCaseSensitive) matched = value.Contains(f.contentmatch); else if (f.matchtype == MatchType.DoesNotContain) matched = value.IndexOf(f.contentmatch, StringComparison.InvariantCultureIgnoreCase) < 0; else if (f.matchtype == MatchType.DoesNotContainCaseSensitive) matched = !value.Contains(f.contentmatch); else if (f.matchtype == MatchType.NumericEquals) matched = double.TryParse(value, out valued) && Math.Abs(valued - f.contentvalue) < 0.0000000001; // allow for rounding else if (f.matchtype == MatchType.NumericNotEquals) matched = double.TryParse(value, out valued) && Math.Abs(valued - f.contentvalue) >= 0.0000000001; else if (f.matchtype == MatchType.NumericGreater) matched = double.TryParse(value, out valued) && valued > f.contentvalue; else if (f.matchtype == MatchType.NumericGreaterEqual) matched = double.TryParse(value, out valued) && valued >= f.contentvalue; else if (f.matchtype == MatchType.NumericLessThan) matched = double.TryParse(value, out valued) && valued < f.contentvalue; else if (f.matchtype == MatchType.NumericLessThanEqual) matched = double.TryParse(value, out valued) && valued <= f.contentvalue; else if (f.matchtype == MatchType.DateBefore) { DateTime dt = jc.Value<DateTime>(); matched = dt.CompareTo(f.contentdate) < 0; } else if (f.matchtype == MatchType.DateAfter) { DateTime dt = jc.Value<DateTime>(); matched = dt.CompareTo(f.contentdate) >= 0; } // System.Diagnostics.Debug.WriteLine(fe.eventname + ":Compare " + f.matchtype + " '" + f.contentmatch + "' with '" + value + "' res " + matched + " IC " + fe.innercondition); if (fe.innercondition == FilterType.And && !matched) // Short cut, if AND, all must pass, and it did not return false; // positive non match if (fe.innercondition == FilterType.Nand && !matched) // Short cut, if NAND, and not matched return true; // positive non match - NAND produces a true if (fe.innercondition == FilterType.Or && matched) // Short cut, if NOR, and matched return true; // positive match if (fe.innercondition == FilterType.Nor && matched) // Short cut, if NOR, and matched return false; // positive non match - any matches produce a false. } } } } return null; // no result either way }