Files
ayanova7/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/Attributes.cs
2018-06-29 19:47:36 +00:00

207 lines
5.1 KiB
C#

using System;
namespace GZTW.AyaNova.BLL
{
#pragma warning disable 1591
///// <summary>
/////Custom attribute used to indicate the underlying
/////sql column name for a business object property.
/////
/////Used internally for sorting and filtering in grids.
/////
/////A value of "grid" indicates that the grid should
/////handle sorting for grid columns that are calculated
/////and not provided directly from the data
///// </summary>
//[AttributeUsage(AttributeTargets.Property)]
//public class SqlColumnNameAttribute:Attribute
//{
// private string _SqlColumnName;
// public SqlColumnNameAttribute(string sqlColumnName)
// {
// _SqlColumnName = sqlColumnName;
// }
// public string SqlColumnName
// {
// get
// {
// return _SqlColumnName;
// }
// }
//}
/// <summary>
///Custom attribute used to indicate the underlying
///sql column name for a business object property.
///
///Used internally for sorting and filtering in grids.
///
///A value of "grid" indicates that the grid should
///handle sorting for grid columns that are calculated
///and not provided directly from the data
///
/// SqlColumnName represents the "display" or text based column
/// SqlValueColumnName represents the underlying value column
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class SqlColumnNameAttribute : Attribute
{
private string _SqlColumnName;
private string _SqlValueColumnName;
public SqlColumnNameAttribute(string sqlColumnName)
{
_SqlColumnName = sqlColumnName;
_SqlValueColumnName = "";
}
public SqlColumnNameAttribute(string sqlColumnName, string sqlValueColumnName)
{
_SqlColumnName = sqlColumnName;
_SqlValueColumnName = sqlValueColumnName;
}
public string SqlColumnName
{
get
{
return _SqlColumnName;
}
}
public string SqlValueColumnName
{
get
{
return _SqlValueColumnName;
}
}
}
/// <summary>
/// DisplayAttribute, used to provide more detailed information to
/// the ui layer about properties in a business object collection
/// in order to simplify display process through reflection
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple=false)]
public class DisplayAttribute : Attribute
{
public DisplayAttribute(DisplayType DisplayAsControl)
{
displayAs = DisplayAsControl;
}
private DisplayType displayAs = DisplayType.Text;
public DisplayType DisplayAs
{
get { return displayAs; }
}
private bool color=false;
public bool Color
{
get { return color; }
set { color = value; }
}
private string colorField="";
public string ColorField
{
get { return colorField; }
set { colorField = value; }
}
private RootObjectTypes rootObjectType=RootObjectTypes.Nothing;
public RootObjectTypes RootObjectType
{
get { return rootObjectType; }
set { rootObjectType = value; }
}
private CompareType compareAs = CompareType.Default;
public CompareType CompareAs
{
get { return compareAs; }
set { compareAs = value; }
}
private bool showInLite = true;
public bool ShowInLite
{
get { return showInLite; }
set { showInLite = value; }
}
}
public enum CompareType : int
{
Default=0,
StringToDate=1,
StringToInt32=2
}
public enum DisplayType : int
{
Hidden = 0,
DateTime = 1,
DateOnly = 2,
TimeOnly = 3,
Text = 4,
WholeNumber = 5,
TrueFalse = 6,
Currency = 7,
URL_Email = 8,
Button = 9,
GeoCoordinate = 10,
DecimalNumber=11,
Percentage=12,
URL_Web =13,
URL_Document=14,
ListAyaDayOfWeek=15,
ListAyaUnitsOfTime=16,
ListPurchaseOrderStatus=17,
ListVendorTypes=18,
ListUsers = 19,
ListUserTypes = 20,
MultiLineText = 21,
ListClientServiceRequestStatus=22,
ListClientServiceRequestPriority=23,
ListQuoteStatusTypes=24,//Case 353
ListLoanItemRates=25,//Case 420
SpecialControl = 99//A special control field is handled by the form based on the exact circumstance, i.e. the replied checkbox on a memo form
}
#pragma warning restore 1591
}