This commit is contained in:
47
server/AyaNova/models/DataListBase.cs
Normal file
47
server/AyaNova/models/DataListBase.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
|
||||
//common base class for data table display at client, reporting and mass bulk operations
|
||||
public class DataListBase
|
||||
{
|
||||
public string DataListKey { get; set; }
|
||||
public Dictionary<string, string> SortBy { get; set; }
|
||||
public List<DataListFilterOption> Filter { get; set; }
|
||||
public string ClientCriteria { get; set; }
|
||||
}
|
||||
|
||||
/*
|
||||
OLD EXAMPLE:
|
||||
{"offset":0,"limit":10,"dataListKey":"CustomerDataList",
|
||||
"listView":"[
|
||||
{\"fld\":\"customername\",\"sort\":\"+\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":\"dfdfdf\"},{\"op\":\"=\",\"value\":\"3333\"}],\"any\":true}},
|
||||
{\"fld\":\"customerphone1\",\"filter\":{\"items\":[{\"op\":\">\",\"value\":\"44444\"},
|
||||
{\"op\":\"<\",\"value\":\"7777\"}]}},
|
||||
{\"fld\":\"customeremail\"}
|
||||
{\"fld\":\"customerheadoffice\"},
|
||||
{\"fld\":\"customertags\",\"sort\":\"+\"}]"}
|
||||
|
||||
NEW:
|
||||
columns:["PartInventoryTransactionEntryDate","PartPartNumber","PartWarehouseName","PartInventoryTransactionQuantity","PartInventoryTransactionDescription","PartInventoryTransactionSource","PartInventoryBalance"]
|
||||
sortBy:[{"PartInventoryTransactionEntryDate":"-"}],//All sorted columns here as keyvalue pairs value is a string of "+" for ascending "-" for descending and are IN ORDER of how to be sorted
|
||||
filter:[{column:"PartPartNumber",any:true/false,items:[{op: "=",value: "400735"}]}],
|
||||
clientCriteria:"2" //could be anything here that makes sense to the list, in this case an example customer id for customernotedatalist
|
||||
*/
|
||||
public class DataListFilterOption
|
||||
{
|
||||
public string Column { get; set; }
|
||||
public List<DataListColumnFilter> items { get; set; }
|
||||
public bool Any { get; set; }//means "or" the filter conditions
|
||||
DataListFilterOption()
|
||||
{
|
||||
items = new List<DataListColumnFilter>();
|
||||
}
|
||||
}
|
||||
|
||||
public class DataListColumnFilter
|
||||
{
|
||||
public string op { get; set; }
|
||||
public string value { get; set; }
|
||||
}
|
||||
}
|
||||
17
server/AyaNova/models/DataListTableOptions.cs
Normal file
17
server/AyaNova/models/DataListTableOptions.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
public sealed class DataListTableOptions : DataListBase
|
||||
{
|
||||
public List<string> Columns { get; set; }
|
||||
public const int MaxPageSize = 1000;
|
||||
public const int DefaultOffset = 0;
|
||||
public const int DefaultLimit = 25;
|
||||
public int? Offset { get; set; }
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
|
||||
//TODO: Need to split this into a personal column order set and a personal filter collection
|
||||
public class DataListView
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
@@ -5,13 +5,13 @@ namespace AyaNova.Models
|
||||
//Used to drive processes that rely on selections made at client from a datalist
|
||||
//either a preselected list of id's or a datalist key and listview filter object that can
|
||||
//be used to rehydrate a list of id's
|
||||
public class DataListSelection
|
||||
public class DataListSelection : DataListBase
|
||||
{
|
||||
public AyaType ObjectType { get; set; }
|
||||
public long[] SelectedRowIds { get; set; }
|
||||
public string DataListKey { get; set; }
|
||||
public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
|
||||
public string MetaView { get; set; }//optional meta list view to integrate into the standard list view. Used by client to add "meta" filter conditions above the user's choices e.g. customer notes customer id
|
||||
// public string DataListKey { get; set; }
|
||||
// public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
|
||||
// public string MetaView { get; set; }//optional meta list view to integrate into the standard list view. Used by client to add "meta" filter conditions above the user's choices e.g. customer notes customer id
|
||||
|
||||
|
||||
public bool IsEmpty
|
||||
|
||||
@@ -2,15 +2,16 @@ using AyaNova.Biz;
|
||||
using Newtonsoft.Json.Linq;
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
|
||||
public class RenderReportParameter
|
||||
|
||||
public class RenderReportParameter : DataListSelection
|
||||
{
|
||||
public long ReportId { get; set; }
|
||||
public long[] SelectedRowIds { get; set; }
|
||||
public string DataListKey { get; set; }
|
||||
public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
|
||||
public string MetaView { get; set; }//optional meta list view to integrate into the standard list view. Used by client to add "meta" filter conditions above the user's choices e.g. customer notes customer id
|
||||
public JToken ClientMeta {get;set;}//meta JSON data passed from client, not part of biz object data
|
||||
public JToken ClientMeta { get; set; }//meta JSON data passed from client, not part of biz object data
|
||||
//public long[] SelectedRowIds { get; set; }
|
||||
// public string DataListKey { get; set; }
|
||||
// public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
|
||||
// public string MetaView { get; set; }//optional meta list view to integrate into the standard list view. Used by client to add "meta" filter conditions above the user's choices e.g. customer notes customer id
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user