This commit is contained in:
2020-12-11 21:11:49 +00:00
parent 292b337cb4
commit 4218ed6b7f
9 changed files with 92 additions and 132 deletions

View File

@@ -13,7 +13,8 @@ namespace AyaNova.DataList
/// </summary>
internal abstract class AyaDataList : IAyaDataList
{
//CoreBizObject add here
//well, not here exactly but add a new DATALIST class if it will be displayed as a list anywhere in the UI or reported on
public AyaDataList()
{

View File

@@ -13,7 +13,7 @@ namespace AyaNova.PickList
{
switch (ayaType)
{
//CoreBizObject add here
//CoreBizObject add here if it will be "picked" on any other form
case AyaType.Contract:
return new ContractPickList() as IAyaPickList;
case AyaType.Customer:

View File

@@ -55,11 +55,11 @@ namespace AyaNova.Biz
InventoryFull | AccountingFull | TechLimited | TechFull | SubContractorLimited |
SubContractorFull | CustomerLimited | CustomerFull | OpsAdminLimited | OpsAdminFull | SalesFull | SalesLimited,
AllInternalRoles = BizAdminLimited | BizAdminFull | DispatchLimited | DispatchFull | InventoryLimited |
AllInsideUserRoles = BizAdminLimited | BizAdminFull | DispatchLimited | DispatchFull | InventoryLimited |
InventoryFull | AccountingFull | TechLimited | TechFull | SubContractorLimited |
SubContractorFull | SalesFull | SalesLimited
SubContractorFull | SalesFull | SalesLimited | OpsAdminLimited | OpsAdminFull
}//end AuthorizationRoles
//, 65536, 131072, 262144, 524288, 1,048,576

View File

@@ -114,9 +114,11 @@ namespace AyaNova.Biz
ServiceBank = 55,
OpsNotificationSettings = 56,
Report = 57,
DashboardView=58,
[CoreBizObject]
CustomerNote = 59
DashboardView = 58,
[CoreBizObject]
CustomerNote = 59,
[CoreBizObject]
Memo = 60
@@ -135,125 +137,3 @@ namespace AyaNova.Biz
}//eons
/*
///////////////////////////////////////////////////////////
// RootObjectTypes.cs
// Implementation of Class RootObjectTypes
// CSLA type: enumeration
// Created on: 07-Jun-2004 8:41:36 AM
// Object design: Class Incomplete
///////////////////////////////////////////////////////////
using System.ComponentModel;
namespace GZTW.AyaNova.BLL
{
/// <summary>
/// RootObject types.
/// Note that some items here are not strictly root
/// objects, but are included because they need to be identified
/// for other purposes such as indexed keywords etc.
/// </summary>
public enum RootObjectTypes : int {
[Description("LT:O.Nothing")] Nothing = 0,
[Description("LT:O.Global")] Global = 1,
[Description("LT:O.Region")] Region = 2,
[Description("LT:O.Client")] Client = 3,
[Description("LT:O.Vendor")] Vendor = 4,
[Description("LT:O.HeadOffice")] HeadOffice = 5,
[Description("LT:O.RentalUnit")] RentalUnit = 6,
[Description("LT:O.Unit")] Unit = 7,
[Description("LT:O.UnitModel")] UnitModel = 8,
[Description("LT:O.Workorder")] Workorder = 9,
[Description("LT:O.WorkorderItem")] WorkorderItem = 10,
[Description("LT:O.UserSkillAssigned")] UserSkillAssigned = 11,
[Description("LT:O.UserCertificationAssigned")] UserCertificationAssigned = 12,
[Description("LT:O.User")] User = 13,
[Description("LT:O.Part")] Part = 14,
[Description("LT:O.LoanItem")] LoanItem = 15,
[Description("LT:O.DispatchZone")] DispatchZone = 16,
[Description("LT:O.Rate")] Rate = 17,
[Description("LT:O.Contract")] Contract = 18,
[Description("LT:O.Project")] Project = 19,
[Description("LT:O.PurchaseOrder")] PurchaseOrder = 20,
[Description("LT:O.ClientGroup")] ClientGroup = 21,
[Description("LT:O.WorkorderCategory")] WorkorderCategory = 22,
[Description("LT:O.WorkorderItemScheduledUser")] WorkorderItemScheduledUser = 23,
[Description("LT:O.WorkorderItemOutsideService")] WorkorderItemOutsideService = 24,
[Description("LT:O.WorkorderItemPart")] WorkorderItemPart = 25,
[Description("LT:O.WorkorderItemLabor")] WorkorderItemLabor = 26,
[Description("LT:O.WorkorderItemTravel")] WorkorderItemTravel = 27,
[Description("LT:O.WorkorderItemMiscExpense")] WorkorderItemMiscExpense = 28,
[Description("LT:O.WorkorderItemPartRequest")] WorkorderItemPartRequest = 29,
[Description("LT:O.WorkorderItemLoan")] WorkorderItemLoan = 30,
[Description("LT:O.ClientNote")] ClientNote = 31,
[Description("LT:O.ServiceBank")] ServiceBank = 32,
[Description("LT:O.WorkorderQuote")] WorkorderQuote = 33,
[Description("LT:O.WorkorderService")] WorkorderService = 34,
[Description("LT:O.AssignedDoc")] AssignedDocument = 35,
[Description("LT:O.PartWarehouse")] PartWarehouse = 36,
[Description("LT:O.UnitMeterReading")] UnitMeterReading = 37,
[Description("LT:O.UnitModelCategory")] UnitModelCategory = 38,
[Description("LT:O.Locale")] Locale = 39,
[Description("LT:O.SearchResult")] SearchResult = 40,
[Description("LT:O.WorkorderItemType")] WorkorderItemType = 41,
[Description("LT:O.UnitServiceType")] UnitServiceType = 42,
[Description("LT:O.PartAssembly")] PartAssembly = 43,
[Description("LT:O.AyaFile")] AyaFile = 44,//case 73
[Description("LT:O.Contact")] Contact = 45,
[Description("LT:O.ContactPhone")] ContactPhone = 46,
[Description("LT:O.WorkorderPreventiveMaintenance")] WorkorderPreventiveMaintenance = 47,
[Description("LT:O.TaskGroup")] TaskGroup = 48,
[Description("LT:O.ScheduleMarker")] ScheduleMarker = 49,
[Description("LT:O.ClientServiceRequest")] ClientServiceRequest = 50,
[Description("LT:O.ScheduleableUserGroup")] ScheduleableUserGroup = 51,
[Description("LT:O.Task")] Task = 52,
[Description("LT:O.Memo")] Memo = 53,
[Description("LT:O.PartCategory")] PartCategory=54,
[Description("LT:O.UnitOfMeasure")] UnitOfMeasure=55,
[Description("LT:O.TaxCode")] TaxCode=56,
[Description("LT:O.PartSerial")] PartSerial = 57,
[Description("LT:O.PartInventoryAdjustment")] PartInventoryAdjustment = 58,
[Description("LT:O.PartInventoryAdjustmentItem")] PartInventoryAdjustmentItem = 59,
[Description("LT:O.Priority")] Priority=60,
[Description("LT:O.UserSkill")] UserSkill=61,
[Description("LT:O.WorkorderStatus")] WorkorderStatus=62,
[Description("LT:O.UserCertification")] UserCertification=63,
[Description("LT:O.ClientNoteType")] ClientNoteType=64,
[Description("LT:O.SecurityGroup")] SecurityGroup=65,
[Description("LT:O.PurchaseOrderReceiptItem")] PurchaseOrderReceiptItem=66,
[Description("LT:O.PartByWarehouseInventory")] PartByWarehouseInventory=67,
[Description("LT:O.Report")] Report=68,
[Description("LT:O.WorkorderQuoteTemplate")]
WorkorderQuoteTemplate = 69,
[Description("LT:O.WorkorderServiceTemplate")]
WorkorderServiceTemplate = 70,
[Description("LT:O.WorkorderPreventiveMaintenanceTemplate")]
WorkorderPreventiveMaintenanceTemplate = 71,
[Description("LT:O.WikiPage")]//case 73
WikiPage = 72,
[Description("LT:O.GridFilter")]//case 941
GridFilter = 73,
[Description("LT:O.NotifySubscription")]//case 941
NotifySubscription = 74,
[Description("LT:O.PurchaseOrderReceipt")]//case 941
PurchaseOrderReceipt = 75,
[Description("LT:O.Notification")]//case 1172
Notification = 76,
[Description("LT:UI.Go.Schedule")]//case 812
Schedule = 77,
[Description("LT:O.WorkorderItemTask")]//case 1317
WorkorderItemTask = 78,
[Description("LT:O.WorkorderItemUnit")]//case 1317
WorkorderItemUnit = 79,
[Description("LT:ScheduleMarker.Label.FollowUp")]//case 1975
FollowUp = 80
}//end RootObjectTypes
}//end namespace GZTW.AyaNova.BLL
*/

View File

@@ -36,12 +36,16 @@ namespace AyaNova.Biz
return await ct.Widget.AnyAsync(z => z.Id == id);
case AyaType.Customer:
return await ct.Customer.AnyAsync(z => z.Id == id);
case AyaType.CustomerNote:
return await ct.CustomerNote.AnyAsync(z => z.Id == id);
case AyaType.Contract:
return await ct.Contract.AnyAsync(z => z.Id == id);
case AyaType.HeadOffice:
return await ct.HeadOffice.AnyAsync(z => z.Id == id);
case AyaType.LoanUnit:
return await ct.LoanUnit.AnyAsync(z => z.Id == id);
case AyaType.Memo:
return await ct.Memo.AnyAsync(z => z.Id == id);
case AyaType.Part:
return await ct.Part.AnyAsync(z => z.Id == id);
case AyaType.PM:

View File

@@ -38,7 +38,8 @@ namespace AyaNova.Biz
return new CustomerNoteBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
case AyaType.User:
return new UserBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
case AyaType.Memo:
return new MemoBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);
case AyaType.Contract:
return new ContractBiz(ct, userId, ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID, roles);

View File

@@ -593,6 +593,18 @@ namespace AyaNova.Biz
Select = AuthorizationRoles.All
});
////////////////////////////////////////////////////////////
//MEMO
// (everyone but outside users Customer and HO can send and receive memos)
roles.Add(AyaType.Widget, new BizRoleSet()
{
Change = AuthorizationRoles.AllInsideUserRoles,
ReadFullRecord = AuthorizationRoles.AllInsideUserRoles,,
Select = AuthorizationRoles.AllInsideUserRoles,
});
////////////////////////////////////////////////////////////////////
#endregion all roles init

View File

@@ -0,0 +1,55 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;
namespace AyaNova.Models
{
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
//otherwise the server will call it an invalid record if the field isn't sent from client
public class Memo : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public string Name { get; set; }//"subject"
// public bool Active { get; set; }
public string Notes { get; set; }//"message"
public string Wiki { get; set; }
public string CustomFields { get; set; }
public List<string> Tags { get; set; }
public bool Viewed { get; set; }
public bool Replied { get; set; }
public long? FromId { get; set; }
public long? ToId { get; set; }
public Memo()
{
Tags = new List<string>();
}
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.Memo; }
}//eoc
}//eons
/*
CREATE TABLE [dbo].[AMEMO](
[AID] [uniqueidentifier] NOT NULL,
[ACREATED] [datetime] NULL,
[AMODIFIED] [datetime] NULL,
[ACREATOR] [uniqueidentifier] NULL,
[AMODIFIER] [uniqueidentifier] NULL,
[ASUBJECT] [nvarchar](255) NULL,
[AMESSAGE] [ntext] NULL,
[AFROMID] [uniqueidentifier] NOT NULL,
[ATOID] [uniqueidentifier] NOT NULL,
[AVIEWED] [bit] NOT NULL,
[AREPLIED] [bit] NOT NULL,
*/

View File

@@ -481,6 +481,13 @@ $BODY$;
{
LogUpdateMessage(log);
//MEMO
await ExecQueryAsync("CREATE TABLE amemo (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null, " +
"notes text, wiki text, customfields text, tags varchar(255) ARRAY, " +
"viewed bool default false, replied bool default false, fromid bigint not null REFERENCES auser(id), toid bigint not null REFERENCES auser(id) )");
await ExecQueryAsync("CREATE INDEX aproject_tags ON aproject using GIN(tags)");
//CUSTOMER
await ExecQueryAsync("CREATE TABLE acustomer (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " +
"notes text, wiki text, customfields text, tags varchar(255) ARRAY, " +
@@ -508,7 +515,7 @@ $BODY$;
//HEADOFFICE
await ExecQueryAsync("CREATE TABLE aheadoffice (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " +
"notes text, wiki text, customfields text, tags varchar(255) ARRAY," +
"notes text, wiki text, customfields text, tags varchar(255) ARRAY," +
"webaddress text, accountnumber text, usesbanking bool, contractexpires timestamp null, contractid bigint null references acontract(id), " +
"phone1 text, phone2 text, phone3 text, phone4 text, phone5 text, emailaddress text, " +
"postaddress text, postcity text, postregion text, postcountry text, postcode text, address text, city text, region text, country text, latitude decimal(8,6), longitude decimal(9,6)" +