using System; using System.Collections.Generic; using System.Text; using System.Xml.Linq; namespace Sarand.OperationsMgr.Core.WebService { //======================================================================= public class OpnWebServiceRequest { //------------------------------------------------------------------- // Definitions. public enum RequestType { Unknown, IsAlive, /// Item count Count, /// Query list - specific columns, compressed (csv etc) response data QueryList, /// Item list - full xml for each item with optional associated items. ItemList, /// Single Item with optional associated items. Item, /// Validate item properties without update. Validate, /// Validate properties and store (insert/update) item. Store, /// Delete item. Delete, } public enum DataType { Unknown, } //------------------------------------------------------------------- /// /// Sort column identified by column name with ascending flag. /// public class SortColumnData { public SortColumnData (String columnName, bool ascending) { ColumnName = columnName; Ascending = ascending; } public String ColumnName { get; } public bool Ascending { get; } } //------------------------------------------------------------------- // Configuration. public class Config { public bool SoapEnvelope { get; set; } public String SoapPrefix { get; set; } public DataType DataType { get; set; } public RequestType RequestType { get; set; } public class ContextProperties { public bool Commit { get; set; } public bool Debug { get; set; } } public ContextProperties Context { get; } = new ContextProperties(); } //------------------------------------------------------------------- // Data members. private readonly Config config; //------------------------------------------------------------------- // Construction. public OpnWebServiceRequest (Config config) { this.config = config; } //------------------------------------------------------------------- // Properties. public Dictionary Filters { get; } = new Dictionary(); public List Columns { get; } = new List(); public List SortColumns { get; } = new List(); public XElement ItemElement { get; set; } //------------------------------------------------------------------- // D a t a G e n e r a t i o n //------------------------------------------------------------------- //------------------------------------------------------------------- } //======================================================================= }