60 lines
2.0 KiB
C#
60 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using TIAM.Entities.Transfers;
|
|
|
|
namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
|
{
|
|
public static class TransferWizardModelExtensions
|
|
{
|
|
public static TransferWizardModel Clone(this TransferWizardModel obj)
|
|
{
|
|
return new TransferWizardModel()
|
|
{
|
|
Id = Guid.NewGuid(),
|
|
UserId = obj.UserId,
|
|
ProductId = obj.ProductId,
|
|
UserProductMappingId = obj.UserProductMappingId,
|
|
UserProductToCarId = obj.UserProductToCarId,
|
|
ReferralId = obj.ReferralId,
|
|
Comment = obj.Comment,
|
|
Destination = obj.Destination,
|
|
PickupAddress = obj.PickupAddress,
|
|
TripDate = obj.TripDate,
|
|
NumberOfPassengers = obj.NumberOfPassengers,
|
|
FullName = obj.FullName,
|
|
PhoneNumber = obj.PhoneNumber,
|
|
EmailAddress = obj.EmailAddress,
|
|
Price = obj.Price,
|
|
|
|
};
|
|
}
|
|
|
|
public static Transfer CopyToTransfer(this TransferWizardModel obj)
|
|
{
|
|
var transfer = new Transfer
|
|
{
|
|
Id = obj.Id,
|
|
UserId = obj.UserId,
|
|
ProductId = obj.ProductId,
|
|
ToAddress = obj.Destination,
|
|
FromAddress = obj.PickupAddress,
|
|
Appointment = obj.TripDate,
|
|
PassengerCount = Convert.ToByte(obj.NumberOfPassengers),
|
|
ContactName = obj.FullName,
|
|
ContactPhone = obj.PhoneNumber,
|
|
ContactEmail = obj.EmailAddress,
|
|
Price = obj.Price,
|
|
//UserProductMappingId = Guid.NewGuid(),
|
|
TransferStatusType = TIAM.Core.Enums.TransferStatusType.OrderSubmitted,
|
|
Comment = "Transfer order",
|
|
|
|
};
|
|
|
|
return transfer;
|
|
}
|
|
}
|
|
}
|