PIBD_21_Basalov_A_D_Project.../project/ProjectTourAgency/Enities/Tour.cs

42 lines
1.2 KiB
C#

using ProjectTourAgency.Enities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectTourAgency.Enities;
public class Tour
{
public int Id { get; private set; }
public int EmployeeId { get; private set; }
public int RouteId { get; private set; }
public DateTime DepartureDate { get; private set; }
public IEnumerable<ClientTour> ClientTours { get; private set; } = [];
public static Tour CreateEntity(int id, int employeeId, int routeId,
DateTime date,IEnumerable<ClientTour> clientTours)
{
return new Tour
{
Id = id,
EmployeeId = employeeId,
RouteId = routeId,
DepartureDate = date,
ClientTours = clientTours
};
}
public static Tour CreateEntity(TempClientTour tempClientTour, IEnumerable<ClientTour> clientTours)
{
return new Tour
{
Id = tempClientTour.Id,
EmployeeId = tempClientTour.EmployeeId,
RouteId = tempClientTour.RouteId,
DepartureDate = tempClientTour.DepartureDate,
ClientTours = clientTours
};
}
}