This commit is contained in:
142
server/AyaNova/DataList/LoanUnitDataList.cs
Normal file
142
server/AyaNova/DataList/LoanUnitDataList.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class LoanUnitDataList : AyaDataList
|
||||
{
|
||||
public LoanUnitDataList()
|
||||
{
|
||||
DefaultListObjectType = AyaType.LoanUnit;
|
||||
SQLFrom = "from aloanunit " +
|
||||
"left join aunit as shadowunit on (aloanunit.unitid=aunit.id) " +
|
||||
"left join workorderitemloan as wil on (aloanunit.unitid=aunit.id) " +
|
||||
"left join aworkorderitem as wil on (aworkorderitemloan.workorderitemid=aworkorderitem.id)" +
|
||||
"left join aworkorder as w on (aworkorderitem.workorderid=aworkorder.id)";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
|
||||
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
|
||||
//Default ListView
|
||||
dynamic dlistView = new JArray();
|
||||
dynamic cm = null;
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "LoanUnitName";
|
||||
cm.sort = "+";
|
||||
dlistView.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "LoanUnitSerial";
|
||||
dlistView.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "Tags";
|
||||
dlistView.Add(cm);
|
||||
|
||||
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
||||
|
||||
|
||||
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
|
||||
FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "LoanUnitName",
|
||||
FieldKey = "LoanUnitName",
|
||||
AyaObjectType = (int)AyaType.LoanUnit,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aloanunit.id",
|
||||
SqlValueColumnName = "aloanunit.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "LoanUnitSerial",
|
||||
FieldKey = "LoanUnitSerial",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aloanunit.serial"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "LoanUnitNotes",
|
||||
FieldKey = "LoanUnitNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aloanunit.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "Active",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "aloanunit.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "Tags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "aloanunit.tags"
|
||||
});
|
||||
|
||||
|
||||
//------------
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "LoanUnitAccountNumber",
|
||||
FieldKey = "LoanUnitAccountNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aloanunit.accountnumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
FieldKey = "LoanUnitLoanUnitOverseerID",
|
||||
TKey = "LoanUnitLoanUnitOverseerID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AyaObjectType = (int)AyaType.User,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "LoanUnitDateStarted",
|
||||
FieldKey = "LoanUnitDateStarted",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "aloanunit.datestarted"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "LoanUnitDateCompleted",
|
||||
FieldKey = "LoanUnitDateCompleted",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "aloanunit.datecompleted"
|
||||
});
|
||||
//-----------
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom1", FieldKey = "loanunitcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom2", FieldKey = "loanunitcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom3", FieldKey = "loanunitcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom4", FieldKey = "loanunitcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom5", FieldKey = "loanunitcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom6", FieldKey = "loanunitcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom7", FieldKey = "loanunitcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom8", FieldKey = "loanunitcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom9", FieldKey = "loanunitcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom10", FieldKey = "loanunitcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom11", FieldKey = "loanunitcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom12", FieldKey = "loanunitcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom13", FieldKey = "loanunitcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom14", FieldKey = "loanunitcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom15", FieldKey = "loanunitcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "LoanUnitCustom16", FieldKey = "loanunitcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aloanunit.customfields" });
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
@@ -317,7 +317,7 @@ namespace AyaNova.Biz
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "LoanUnitName", FieldKey = "LoanUnitName", Hideable = false });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "LoanUnitNotes", FieldKey = "Notes" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Active", FieldKey = "Active", Hideable = false });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Tags", FieldKey = "Tags" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Tags", FieldKey = "Tags" });Hideable = false
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Wiki", FieldKey = "Wiki" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Attachments", FieldKey = "Attachments" });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user