51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using TIAM.Entities.Emails;
|
|
|
|
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
|
{
|
|
public static class MessageWizardModelExtensions
|
|
{
|
|
|
|
public static MessageWizardModel Clone(this MessageWizardModel obj)
|
|
{
|
|
return new MessageWizardModel()
|
|
{
|
|
ReceiverEmailAddress = obj.ReceiverEmailAddress,
|
|
ReceiverId = obj.ReceiverId,
|
|
SenderEmailAddress = obj.SenderEmailAddress,
|
|
SenderId = obj.SenderId,
|
|
ContextId = obj.ContextId,
|
|
Subject = obj.Subject,
|
|
Content = obj.Content
|
|
};
|
|
}
|
|
|
|
|
|
public static EmailMessage CopyToEmailMessage(this MessageWizardModel obj)
|
|
{
|
|
var id = Guid.NewGuid();
|
|
|
|
return new EmailMessage
|
|
{
|
|
Id = id,
|
|
SenderId = obj.SenderId,
|
|
ContextId = obj.ContextId,
|
|
Subject = obj.Subject,
|
|
Text = obj.Content,
|
|
EmailAddress = obj.SenderEmailAddress,
|
|
Recipients = new List<EmailRecipient> {
|
|
new EmailRecipient(
|
|
Guid.NewGuid(), obj.ReceiverId, id, obj.ReceiverEmailAddress),
|
|
new EmailRecipient(
|
|
Guid.NewGuid(), Guid.Parse("4CBAED43-2465-4D99-84F1-C8BC6B7025F7"), id, "wsdservers@gmail.com")
|
|
}
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|