Добавлены все сущности
This commit is contained in:
parent
de84a27c8d
commit
13bcafdf4e
31
project/ProjectTourAgency/Enities/Client.cs
Normal file
31
project/ProjectTourAgency/Enities/Client.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
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 Client
|
||||||
|
{
|
||||||
|
public int Id { get;private set; }
|
||||||
|
public string FullName { get; private set; } = string.Empty;
|
||||||
|
public DateTime BirthDate { get; private set; }
|
||||||
|
public string PhoneNumber { get; private set; } = string.Empty;
|
||||||
|
public ClientSocialStatus ClientSocialStatus { get; private set; }
|
||||||
|
|
||||||
|
public static Client CreateEntity(int id, string fullName,
|
||||||
|
DateTime birthDate, string phoneNumber, ClientSocialStatus clientSocialStatus)
|
||||||
|
{
|
||||||
|
return new Client
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
FullName = fullName,
|
||||||
|
BirthDate = birthDate,
|
||||||
|
PhoneNumber = phoneNumber,
|
||||||
|
ClientSocialStatus = clientSocialStatus
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
26
project/ProjectTourAgency/Enities/ClientTour.cs
Normal file
26
project/ProjectTourAgency/Enities/ClientTour.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
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 ClientTour
|
||||||
|
{
|
||||||
|
public int ClientId { get; private set; }
|
||||||
|
public int TourId { get; private set; }
|
||||||
|
public ClientSocialStatus ClientSocialStatus { get; private set; }
|
||||||
|
|
||||||
|
public static ClientTour CreateEntity(int clientId, int tourId, ClientSocialStatus clientSocialStatus)
|
||||||
|
{
|
||||||
|
return new ClientTour
|
||||||
|
{
|
||||||
|
ClientId = clientId,
|
||||||
|
TourId = tourId,
|
||||||
|
ClientSocialStatus = clientSocialStatus
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
27
project/ProjectTourAgency/Enities/Discount.cs
Normal file
27
project/ProjectTourAgency/Enities/Discount.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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 Discount
|
||||||
|
{
|
||||||
|
public int Id { get; private set; }
|
||||||
|
public float DiscountPercent { get; private set; }
|
||||||
|
public ClientSocialStatus ClientSocialStatus { get; private set; }
|
||||||
|
public int ClientId { get; private set; }
|
||||||
|
public static Discount CreateEntity(int id, int clientId,
|
||||||
|
ClientSocialStatus clientSocialStatus,float discountPercent)
|
||||||
|
{
|
||||||
|
return new Discount
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
ClientId = clientId,
|
||||||
|
ClientSocialStatus = clientSocialStatus,
|
||||||
|
DiscountPercent = discountPercent
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectTourAgency.Enities.Enums;
|
||||||
|
|
||||||
|
public enum ClientSocialStatus
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Student = 1,
|
||||||
|
Veteran = 2,
|
||||||
|
aged = 3
|
||||||
|
}
|
32
project/ProjectTourAgency/Enities/Receipt.cs
Normal file
32
project/ProjectTourAgency/Enities/Receipt.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
using ProjectTourAgency.Enities.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectTourAgency.Enities;
|
||||||
|
|
||||||
|
public class Receipt
|
||||||
|
{
|
||||||
|
public int ClientId { get; private set; }
|
||||||
|
public DateTime Date { get; private set; }
|
||||||
|
public int Duration { get; private set; }
|
||||||
|
public int TourId { get; private set; }
|
||||||
|
public int FinalCost { get; private set; }
|
||||||
|
|
||||||
|
public static Receipt CreateEntity(int clientId, int tourId, int duration, int finalCost)
|
||||||
|
{
|
||||||
|
return new Receipt
|
||||||
|
{
|
||||||
|
ClientId = clientId,
|
||||||
|
TourId = tourId,
|
||||||
|
Date = DateTime.Now,
|
||||||
|
Duration = duration,
|
||||||
|
FinalCost = finalCost
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
29
project/ProjectTourAgency/Enities/Tour.cs
Normal file
29
project/ProjectTourAgency/Enities/Tour.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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 string Destination { get; private set; } = string.Empty;
|
||||||
|
public string Departure { get; private set; } = string.Empty;
|
||||||
|
public DateTime DepartureDate { get; private set; }
|
||||||
|
public int Cost { get; private set; }
|
||||||
|
public static Tour CreateEntity(int id, string destination,
|
||||||
|
DateTime date, string departure, int cost)
|
||||||
|
{
|
||||||
|
return new Tour
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
Destination = destination,
|
||||||
|
Departure = departure,
|
||||||
|
DepartureDate = date,
|
||||||
|
Cost = cost
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user