void SetDefaultFilter() { filterDate = BasePage.GetFilterDate(api.CompanyEntity, false); var filterSorthelper = new FilterSortHelper(typeof(DebtorInvoiceLines), DefaultFilters(), null); List <string> errors; filterValues = filterSorthelper.GetPropValuePair(out errors); }
private List <PropValuePair> GetPropValuePairForDataSource(Type TableType, List <FilterProperties> filterProps) { List <PropValuePair> propPairLst = new List <PropValuePair>(); Filter[] filters = filterProps.Select(p => new Filter() { name = p.PropertyName, value = p.UserInput, parameterType = p.ParameterType }).ToArray(); var filterSorthelper = new FilterSortHelper(TableType, filters, null); List <string> errors; propPairLst = filterSorthelper.GetPropValuePair(out errors); return(propPairLst); }
void GetFields(Type dialogType = null) { Type sltype = null; if (dialogType != null) { var usertype = api.CompanyEntity.GetUserType(dialogType); if (usertype != null) { sltype = usertype; } } tablestype = Global.GetTables(api.CompanyEntity); if (dialogType == null) { sltype = (from l in tablestype where l.Name.Split('.').Last() == tableName select l).FirstOrDefault(); } if (sltype == null) { sltype = dialogType; } FilterSortHelper FilterSortingHelper = new FilterSortHelper(sltype, null, null, api, null); var displayProperties = FilterSortingHelper.GetDisplayProperties(true, true); displayProperties.AddRange(GetAllInputPropertiesFromType(sltype, api.CompanyEntity)); dgTableValueGrid.Tag = displayProperties; var customDictionary = UtilFunctions.GetCustomFormattedNonReadOnlyDisplayPropertyNames(sltype, null); var dimProp = (from p in displayProperties where p.PropertyName.StartsWith("Dim") select p); foreach (var dim in dimProp) { var prName = dim.PropertyName; if (!customDictionary.ContainsKey(prName)) { customDictionary.Add(prName, string.Concat(prName, " (", dim.DisplayName, ")")); } } cmbTableProperties.ItemsSource = customDictionary.OrderBy(s => s.Value); }