Example #1
0
 private static List <SelectListItemEx> GetItemsList(IUnitOfWork db, CustomReportFieldAttribute atr)
 {
     if (atr.GetItemsFromDbFunc != null)
     {
         return(atr.GetItemsFromDbFunc(db));
     }
     return(new List <SelectListItemEx>());
 }
Example #2
0
 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;
 }
Example #3
0
        private static List <FilterOperationViewModel> GetOperations(CustomReportFieldAttribute atr)
        {
            var operations = CustomReportService.GetOperations(atr.DataType);

            return(operations.Select(x => new FilterOperationViewModel(x)).ToList());
        }
Example #4
0
        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);
        }