Exemple #1
0
            public DataTableColumnOrder GetValue(ModelBindingContext context)
            {
                var modelname = context.ModelName;

                var model = new DataTableColumnOrder();

                if (int.TryParse(DataTableBinderProvider.GetValue(context, $"{ modelname }[column]"), out int columnIndex))
                {
                    model.Column = columnIndex;
                }
                model.Dir = DataTableBinderProvider.GetValue(context, $"{ modelname }[dir]");
                return(model);
            }
Exemple #2
0
            public DataTableSearch GetValue(ModelBindingContext context)
            {
                var modelname = context.ModelName;

                var model = new DataTableSearch();

                model.Value = DataTableBinderProvider.GetValue(context, $"{ modelname }[value]");
                if (bool.TryParse(DataTableBinderProvider.GetValue(context, $"{ modelname }[regex]"), out bool regex))
                {
                    model.Regex = regex;
                }
                return(model);
            }
Exemple #3
0
            public DataTableColumn GetValue(ModelBindingContext context)
            {
                var modelname = context.ModelName;

                var model = new DataTableColumn();

                model.Data = DataTableBinderProvider.GetValue(context, $"{ modelname }[data]");
                model.Name = DataTableBinderProvider.GetValue(context, $"{ modelname }[name]");
                if (bool.TryParse(DataTableBinderProvider.GetValue(context, $"{ modelname }[searchable]"), out bool seachable))
                {
                    model.Searchable = seachable;
                }
                if (bool.TryParse(DataTableBinderProvider.GetValue(context, $"{ modelname }[orderable]"), out bool orderable))
                {
                    model.Orderable = orderable;
                }
                model.Search       = new DataTableColumnSearch();
                model.Search.Value = DataTableBinderProvider.GetValue(context, $"{ modelname }[search][value]");
                if (bool.TryParse(DataTableBinderProvider.GetValue(context, $"{ modelname }[search][regex]"), out bool regex))
                {
                    model.Search.Regex = regex;
                }
                return(model);
            }