161 lines
9.4 KiB
C#
161 lines
9.4 KiB
C#
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class LoanUnitDataList : DataListProcessingBase
|
|
{
|
|
public LoanUnitDataList(long translationId)
|
|
{
|
|
DefaultListAType = AyaType.LoanUnit;
|
|
SQLFrom = "from aloanunit " +
|
|
"left join aunit as shadowunit on (aloanunit.unitid=shadowunit.id) " +
|
|
"left join aworkorderitemloan as wil on (aloanunit.workorderitemloanid=wil.id) " +
|
|
"left join aworkorderitem as wi on (wil.workorderitemid=wi.id)" +
|
|
"left join aworkorder as w on (wi.workorderid=w.id)";
|
|
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
DefaultColumns = new List<string>() { "LoanUnitName", "LoanUnitSerial", "LoanUnitCurrentWorkOrderItemLoan", "LoanUnitShadowUnit" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "LoanUnitName", "+" } };
|
|
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitName",
|
|
FieldKey = "LoanUnitName",
|
|
AType = (int)AyaType.LoanUnit,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "aloanunit.id",
|
|
SqlValueColumnName = "aloanunit.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitSerial",
|
|
FieldKey = "LoanUnitSerial",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "aloanunit.serial"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitNotes",
|
|
FieldKey = "LoanUnitNotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "aloanunit.notes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Active",
|
|
FieldKey = "Active",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "aloanunit.active"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "Tags",
|
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
|
SqlValueColumnName = "aloanunit.tags"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
FieldKey = "LoanUnitCurrentWorkOrderItemLoan",
|
|
TKey = "LoanUnitCurrentWorkOrderItemLoan",
|
|
UiFieldDataType = (int)UiFieldDataType.Integer,
|
|
AType = (int)AyaType.WorkOrderItemLoan,
|
|
SqlIdColumnName = "wil.id",
|
|
SqlValueColumnName = "w.serial"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitRateDay",
|
|
FieldKey = "LoanUnitRateDay",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "aloanunit.rateday"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitRateHalfDay",
|
|
FieldKey = "LoanUnitRateHalfDay",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "aloanunit.ratehalfday"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitRateHour",
|
|
FieldKey = "LoanUnitRateHour",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "aloanunit.ratehour"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitRateMonth",
|
|
FieldKey = "LoanUnitRateMonth",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "aloanunit.ratemonth"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitRateWeek",
|
|
FieldKey = "LoanUnitRateWeek",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "aloanunit.rateweek"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitRateYear",
|
|
FieldKey = "LoanUnitRateYear",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "aloanunit.rateyear"
|
|
});
|
|
|
|
// FieldDefinitions.Add(new DataListFieldDefinition
|
|
// {
|
|
// TKey = "LoanUnitDefaultRate",
|
|
// FieldKey = "LoanUnitDefaultRate",
|
|
// UiFieldDataType = (int)UiFieldDataType.Enum,
|
|
// EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(LoanUnitRateUnit).ToString()),
|
|
// SqlValueColumnName = "aloanunit.defaultrate"
|
|
// });
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
FieldKey = "LoanUnitShadowUnit",
|
|
TKey = "LoanUnitShadowUnit",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
AType = (int)AyaType.Unit,
|
|
SqlIdColumnName = "shadowunit.id",
|
|
SqlValueColumnName = "shadowunit.serial"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom1", FieldKey = "loanunitcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom2", FieldKey = "loanunitcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom3", FieldKey = "loanunitcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom4", FieldKey = "loanunitcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom5", FieldKey = "loanunitcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom6", FieldKey = "loanunitcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom7", FieldKey = "loanunitcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom8", FieldKey = "loanunitcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom9", FieldKey = "loanunitcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom10", FieldKey = "loanunitcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom11", FieldKey = "loanunitcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom12", FieldKey = "loanunitcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom13", FieldKey = "loanunitcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom14", FieldKey = "loanunitcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom15", FieldKey = "loanunitcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "LoanUnitCustom16", FieldKey = "loanunitcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
|
}
|
|
|
|
}//eoc
|
|
}//eons |