This commit is contained in:
70
server/biz/BizObjectFactory.cs
Normal file
70
server/biz/BizObjectFactory.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using Sockeye.Util;
|
||||
using Sockeye.Models;
|
||||
|
||||
|
||||
namespace Sockeye.Biz
|
||||
{
|
||||
|
||||
|
||||
internal static class BizObjectFactory
|
||||
{
|
||||
|
||||
|
||||
//Returns the biz object class that corresponds to the type presented
|
||||
//Used by SEARCH, REPORTING and objects with JOBS
|
||||
internal static BizObject GetBizObject(SockType sockType,
|
||||
AyContext ct,
|
||||
long userId,
|
||||
AuthorizationRoles roles,
|
||||
long translationId = 0)
|
||||
{
|
||||
if (translationId == 0)
|
||||
translationId = ServerBootConfig.SOCKEYE_DEFAULT_TRANSLATION_ID;
|
||||
|
||||
switch (sockType)
|
||||
{
|
||||
//CoreBizObject add here
|
||||
case SockType.ServerJob:
|
||||
return new JobOperationsBiz(ct, userId, roles);
|
||||
|
||||
case SockType.Translation:
|
||||
return new TranslationBiz(ct, userId, translationId, roles);
|
||||
case SockType.DataListSavedFilter:
|
||||
return new DataListSavedFilterBiz(ct, userId, translationId, roles);
|
||||
case SockType.FormCustom:
|
||||
return new FormCustomBiz(ct, userId, translationId, roles);
|
||||
case SockType.FileAttachment:
|
||||
return new AttachmentBiz(ct, userId, roles);
|
||||
case SockType.Customer:
|
||||
return new CustomerBiz(ct, userId, translationId, roles);
|
||||
case SockType.CustomerNote:
|
||||
return new CustomerNoteBiz(ct, userId, translationId, roles);
|
||||
case SockType.User:
|
||||
return new UserBiz(ct, userId, translationId, roles);
|
||||
case SockType.Memo:
|
||||
return new MemoBiz(ct, userId, translationId, roles);
|
||||
case SockType.HeadOffice:
|
||||
return new HeadOfficeBiz(ct, userId, translationId, roles);
|
||||
case SockType.Reminder:
|
||||
return new ReminderBiz(ct, userId, translationId, roles);
|
||||
case SockType.Review:
|
||||
return new ReviewBiz(ct, userId, translationId, roles);
|
||||
case SockType.CustomerNotifySubscription:
|
||||
return new CustomerNotifySubscriptionBiz(ct, userId, translationId, roles);
|
||||
case SockType.Report:
|
||||
return new ReportBiz(ct, userId, translationId, roles);
|
||||
default:
|
||||
throw new System.NotSupportedException($"Sockeye.BLL.BizObjectFactory::GetBizObject type {sockType.ToString()} is not supported");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
}//eoc
|
||||
|
||||
|
||||
}//eons
|
||||
|
||||
Reference in New Issue
Block a user