41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using Church.Net.DAL.EFCoreDBF;
|
|
using Church.Net.Entity;
|
|
using Church.Net.Entity.Interface;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using WebAPI.Logics.Core;
|
|
using WebAPI.Logics.Interface;
|
|
|
|
namespace WebAPI.Logics
|
|
{
|
|
public class LineMessagingAccountLogic : LogicBase<LineMessagingAccount>, ICrudLogic<LineMessagingAccount>
|
|
{
|
|
private readonly ICrudDAL<PastoralDomain> cellGroupDAL;
|
|
|
|
public LineMessagingAccountLogic(
|
|
LogicService logicService,
|
|
ICrudDAL<LineMessagingAccount> crudDAL,
|
|
ICrudDAL<PastoralDomain> cellGroupDAL
|
|
) : base(logicService, crudDAL)
|
|
{
|
|
this.cellGroupDAL = cellGroupDAL;
|
|
}
|
|
|
|
public PastoralDomain GetCellGroup(string lineGroupId)
|
|
{
|
|
var group = cellGroupDAL.First(c => c.LineGroupId == lineGroupId);
|
|
GetLineMessagingAccount(group);
|
|
return group;
|
|
}
|
|
|
|
public void GetLineMessagingAccount(IMessengerClient messengerClient)
|
|
{
|
|
if (messengerClient != null && messengerClient.LineAccountId != null)
|
|
{
|
|
messengerClient.LineMessagingAccount = crudDAL.GetById(messengerClient.LineAccountId);
|
|
}
|
|
}
|
|
}
|
|
}
|