Files
2020-03-06 16:07:06 +00:00

94 lines
2.8 KiB
C#

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,
/// <summary>Item count</summary>
Count,
/// <summary>Query list - specific columns, compressed (csv etc) response data</summary>
QueryList,
/// <summary>Item list - full xml for each item with optional associated items.</summary>
ItemList,
/// <summary>Single Item with optional associated items.</summary>
Item,
/// <summary>Validate item properties without update.</summary>
Validate,
/// <summary>Validate properties and store (insert/update) item.</summary>
Store,
/// <summary>Delete item.</summary>
Delete,
}
public enum DataType
{
Unknown,
}
//-------------------------------------------------------------------
/// <summary>
/// Sort column identified by column name with ascending flag.
/// </summary>
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<String, String> Filters { get; } = new Dictionary<string, string>();
public List<String> Columns { get; } = new List<String>();
public List<String> SortColumns { get; } = new List<String>();
public XElement ItemElement { get; set; }
//-------------------------------------------------------------------
// D a t a G e n e r a t i o n
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
}