38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using _0_Framework.Application;
|
|
using Company.Domain.InstitutionContractContactInfoAgg;
|
|
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
|
|
|
namespace CompanyManagment.Application;
|
|
|
|
public class InstitutionContractContactInfoApplication : IContactInfoApplication
|
|
{
|
|
private readonly IContactInfoRepository _contactInfoRepository;
|
|
|
|
public InstitutionContractContactInfoApplication(IContactInfoRepository contactInfoRepository)
|
|
{
|
|
_contactInfoRepository = contactInfoRepository;
|
|
}
|
|
|
|
public OperationResult Create(CreateContactInfo command)
|
|
{
|
|
var op = new OperationResult();
|
|
|
|
var res = new InstitutionContractContactInfo(command.PhoneType, command.Position, command.PhoneNumber,
|
|
command.FnameLname,command.InstitutionContractId,command.SendSms);
|
|
_contactInfoRepository.Create(res);
|
|
_contactInfoRepository.SaveChanges();
|
|
|
|
return op.Succcedded();
|
|
}
|
|
|
|
public OperationResult RemoveContactInfo(long id)
|
|
{
|
|
return _contactInfoRepository.RemoveContactInfo(id);
|
|
}
|
|
|
|
public List<CreateContactInfo> GetContactInfolist(long institutionContractId)
|
|
{
|
|
return _contactInfoRepository.GetContactInfolist(institutionContractId);
|
|
}
|
|
} |