This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace AyaNova.PickList
|
namespace AyaNova.PickList
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -10,7 +9,7 @@ namespace AyaNova.PickList
|
|||||||
internal abstract class AyaPickList : IAyaPickList
|
internal abstract class AyaPickList : IAyaPickList
|
||||||
{
|
{
|
||||||
public AyaPickList()
|
public AyaPickList()
|
||||||
{}
|
{ }
|
||||||
public string SQLFrom { get; set; }
|
public string SQLFrom { get; set; }
|
||||||
public List<AyaPickListFieldDefinition> ColumnDefinitions { get; set; }
|
public List<AyaPickListFieldDefinition> ColumnDefinitions { get; set; }
|
||||||
public AuthorizationRoles AllowedRoles { get; set; }
|
public AuthorizationRoles AllowedRoles { get; set; }
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace AyaNova.PickList
|
namespace AyaNova.PickList
|
||||||
{
|
{
|
||||||
|
//This class defines a field used for pick list templating querying processing editing and returning
|
||||||
//This class defines a field used for returning data in list format for UI pick lists
|
|
||||||
public class AyaPickListFieldDefinition
|
public class AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
//CLIENT / SERVER Unique identifier used at BOTH client and server
|
//CLIENT / SERVER Unique identifier used at BOTH client and server
|
||||||
@@ -28,8 +25,6 @@ namespace AyaNova.PickList
|
|||||||
//most common defaults
|
//most common defaults
|
||||||
IsRowId = false;
|
IsRowId = false;
|
||||||
IsActiveColumn = false;
|
IsActiveColumn = false;
|
||||||
// AyaObjectType = (int)AyaType.NoType;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get column to query for display name or use FieldName if there is no difference
|
//Get column to query for display name or use FieldName if there is no difference
|
||||||
@@ -44,11 +39,5 @@ namespace AyaNova.PickList
|
|||||||
return SqlValueColumnName;
|
return SqlValueColumnName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public bool HasIdColumn()
|
|
||||||
// {
|
|
||||||
// return !string.IsNullOrWhiteSpace(SqlIdColumnName);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,8 +13,11 @@ namespace AyaNova.PickList
|
|||||||
{
|
{
|
||||||
switch (ayaType)
|
switch (ayaType)
|
||||||
{
|
{
|
||||||
|
//CoreBizObject add here
|
||||||
case AyaType.Widget:
|
case AyaType.Widget:
|
||||||
return new WidgetPickList() as IAyaPickList;
|
return new WidgetPickList() as IAyaPickList;
|
||||||
|
case AyaType.User:
|
||||||
|
return new UserPickList() as IAyaPickList;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -33,9 +36,7 @@ namespace AyaNova.PickList
|
|||||||
TranslationKeysToFetch.Add(name);
|
TranslationKeysToFetch.Add(name);
|
||||||
ret.Add(new NameIdItem() { Name = name, Id = (long)t });
|
ret.Add(new NameIdItem() { Name = name, Id = (long)t });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var LT = TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, TranslationId).Result;
|
var LT = TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, TranslationId).Result;
|
||||||
foreach (NameIdItem i in ret)
|
foreach (NameIdItem i in ret)
|
||||||
{
|
{
|
||||||
@@ -43,7 +44,5 @@ namespace AyaNova.PickList
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
@@ -11,11 +11,8 @@ namespace AyaNova.PickList
|
|||||||
DefaultListObjectType = AyaType.User;
|
DefaultListObjectType = AyaType.User;
|
||||||
SQLFrom = "from auser";
|
SQLFrom = "from auser";
|
||||||
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||||
|
|
||||||
//Default template
|
|
||||||
dynamic dTemplate = new JArray();
|
dynamic dTemplate = new JArray();
|
||||||
|
|
||||||
|
|
||||||
dynamic cm = new JObject();
|
dynamic cm = new JObject();
|
||||||
cm.fld = "username";
|
cm.fld = "username";
|
||||||
dTemplate.Add(cm);
|
dTemplate.Add(cm);
|
||||||
@@ -30,9 +27,8 @@ namespace AyaNova.PickList
|
|||||||
|
|
||||||
base.DefaultTemplate = dTemplate.ToString(Newtonsoft.Json.Formatting.None);
|
base.DefaultTemplate = dTemplate.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
|
|
||||||
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
|
||||||
ColumnDefinitions = new List<AyaPickListFieldDefinition>();
|
ColumnDefinitions = new List<AyaPickListFieldDefinition>();
|
||||||
|
|
||||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "Active",
|
LtKey = "Active",
|
||||||
@@ -41,7 +37,6 @@ namespace AyaNova.PickList
|
|||||||
SqlValueColumnName = "auser.active",
|
SqlValueColumnName = "auser.active",
|
||||||
IsActiveColumn = true
|
IsActiveColumn = true
|
||||||
});
|
});
|
||||||
|
|
||||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "UserName",
|
LtKey = "UserName",
|
||||||
@@ -51,7 +46,6 @@ namespace AyaNova.PickList
|
|||||||
SqlValueColumnName = "auser.name",
|
SqlValueColumnName = "auser.name",
|
||||||
IsRowId = true
|
IsRowId = true
|
||||||
});
|
});
|
||||||
|
|
||||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "UserEmployeeNumber",
|
LtKey = "UserEmployeeNumber",
|
||||||
@@ -60,7 +54,6 @@ namespace AyaNova.PickList
|
|||||||
SqlValueColumnName = "auser.employeenumber"
|
SqlValueColumnName = "auser.employeenumber"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "Tags",
|
LtKey = "Tags",
|
||||||
@@ -68,8 +61,6 @@ namespace AyaNova.PickList
|
|||||||
ColumnDataType = UiFieldDataType.Tags,
|
ColumnDataType = UiFieldDataType.Tags,
|
||||||
SqlValueColumnName = "auser.tags"
|
SqlValueColumnName = "auser.tags"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
@@ -7,7 +7,6 @@ namespace AyaNova.PickList
|
|||||||
{
|
{
|
||||||
public WidgetPickList()
|
public WidgetPickList()
|
||||||
{
|
{
|
||||||
|
|
||||||
DefaultListObjectType = AyaType.Widget;
|
DefaultListObjectType = AyaType.Widget;
|
||||||
SQLFrom = "from awidget left outer join auser on (awidget.userid=auser.id)";
|
SQLFrom = "from awidget left outer join auser on (awidget.userid=auser.id)";
|
||||||
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||||
@@ -31,8 +30,6 @@ namespace AyaNova.PickList
|
|||||||
|
|
||||||
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
||||||
ColumnDefinitions = new List<AyaPickListFieldDefinition>();
|
ColumnDefinitions = new List<AyaPickListFieldDefinition>();
|
||||||
//DEPRECATED: FieldDefinitions.Add(new AyaPickListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id", IsFilterable = false, IsSortable = false, });
|
|
||||||
|
|
||||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "Active",
|
LtKey = "Active",
|
||||||
@@ -77,8 +74,6 @@ namespace AyaNova.PickList
|
|||||||
ColumnDataType = UiFieldDataType.Tags,
|
ColumnDataType = UiFieldDataType.Tags,
|
||||||
SqlValueColumnName = "awidget.tags"
|
SqlValueColumnName = "awidget.tags"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
@@ -20,6 +20,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
//CoreBizObject add here
|
||||||
List<string> l = new List<string>{
|
List<string> l = new List<string>{
|
||||||
AyaType.Widget.ToString(),AyaType.User.ToString()
|
AyaType.Widget.ToString(),AyaType.User.ToString()
|
||||||
};
|
};
|
||||||
@@ -40,7 +41,7 @@ namespace AyaNova.Biz
|
|||||||
***************************** Otherwise the hidden field can't be set and the object can't be saved EVER
|
***************************** Otherwise the hidden field can't be set and the object can't be saved EVER
|
||||||
*/
|
*/
|
||||||
List<AyaFormFieldDefinition> l = new List<AyaFormFieldDefinition>();
|
List<AyaFormFieldDefinition> l = new List<AyaFormFieldDefinition>();
|
||||||
|
//CoreBizObject add here
|
||||||
if (key == AyaType.Widget.ToString())
|
if (key == AyaType.Widget.ToString())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,17 @@ namespace AyaNova.Biz
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public enum AyaType : int
|
public enum AyaType : int
|
||||||
{
|
{
|
||||||
//COREBIZOBJECT attribute must be set on objects that are:
|
//COREBIZOBJECT attribute must be set on objects that are:
|
||||||
//Attachable objects can have attachments,
|
//Attachable objects can have attachments,
|
||||||
//wikiable objects can have a wiki
|
//wikiable objects can have a wiki
|
||||||
//reviewable objects can have a review which is basically the same as a Reminder but with an object attached (was follow up schedmarker in v7)
|
//reviewable objects can have a review which is basically the same as a Reminder but with an object attached (was follow up schedmarker in v7)
|
||||||
//PIckList-able (has picklist template)
|
//PIckList-able (has picklist template)
|
||||||
//Pretty much everything that represents some kind of real world object is wikiable or attachable as long as it has an ID and a type
|
//Pretty much everything that represents some kind of real world object is wikiable or attachable as long as it has an ID and a type
|
||||||
//exceptions would be utility type objects like datalistview, formcustom etc that are not
|
//exceptions would be utility type objects like datalistview, formcustom etc that are not
|
||||||
|
|
||||||
|
//NOTE: NEW CORE OBJECTS - All areas of server code that require adding any new core objects have been tagged with the following comment:
|
||||||
|
//CoreBizObject add here
|
||||||
|
//Search for that and you will see all areas that need coding for the new object
|
||||||
|
|
||||||
NoType = 0,
|
NoType = 0,
|
||||||
Global = 1,
|
Global = 1,
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
switch (aytype)
|
switch (aytype)
|
||||||
{
|
{
|
||||||
|
//CoreBizObject add here
|
||||||
case AyaType.User:
|
case AyaType.User:
|
||||||
return await ct.User.AnyAsync(m => m.Id == id);
|
return await ct.User.AnyAsync(m => m.Id == id);
|
||||||
case AyaType.Widget:
|
case AyaType.Widget:
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
switch (aytype)
|
switch (aytype)
|
||||||
{
|
{
|
||||||
|
//CoreBizObject add here
|
||||||
case AyaType.User:
|
case AyaType.User:
|
||||||
return new UserBiz(dbcontext, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
return new UserBiz(dbcontext, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
|
||||||
case AyaType.Widget:
|
case AyaType.Widget:
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
string TABLE = string.Empty;
|
string TABLE = string.Empty;
|
||||||
string COLUMN = "name";
|
string COLUMN = "name";
|
||||||
|
//CoreBizObject add here
|
||||||
switch (aytype)
|
switch (aytype)
|
||||||
{
|
{
|
||||||
case AyaType.User:
|
case AyaType.User:
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace AyaNova.Biz
|
|||||||
//DELETE = There is no specific delete right for now though it's checked for by routes in Authorized.cs in case we want to add it in future as a separate right from create.
|
//DELETE = There is no specific delete right for now though it's checked for by routes in Authorized.cs in case we want to add it in future as a separate right from create.
|
||||||
|
|
||||||
#region All roles initialization
|
#region All roles initialization
|
||||||
|
//CoreBizObject add here
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//USER
|
//USER
|
||||||
|
|||||||
Reference in New Issue
Block a user