private static List <SelectListItemEx> GetItemsList(IUnitOfWork db, CustomReportFieldAttribute atr) { if (atr.GetItemsFromDbFunc != null) { return(atr.GetItemsFromDbFunc(db)); } return(new List <SelectListItemEx>()); }
private CustomReportFieldAttribute(CustomReportFieldAttribute atr) { EntityName = atr.EntityName; ColumnName = atr.ColumnName; DataType = atr.DataType; Title = atr.Title; Width = atr.Width; Items = atr.Items; GetItemsFromDbFunc = atr.GetItemsFromDbFunc; Multi = atr.Multi; }
private static List <FilterOperationViewModel> GetOperations(CustomReportFieldAttribute atr) { var operations = CustomReportService.GetOperations(atr.DataType); return(operations.Select(x => new FilterOperationViewModel(x)).ToList()); }
private static CustomReportFieldViewModel GetField(string name, DisplayInGridAttribute atr, CustomReportFieldAttribute exc) { var dto = new CustomReportPredefinedFieldDTO() { EntityName = exc.EntityName ?? "", ColumnName = exc.ColumnName ?? "", DataType = exc.DataType, Width = atr == null ? exc.Width : atr.Width, Title = atr == null ? exc.Title : atr.Title, Name = name }; var res = new CustomReportFieldViewModel(dto); return(res); }