diff --git a/ProjectHotel/ProjectHotel/Entities/Athlete.cs b/ProjectHotel/ProjectHotel/Entities/Athlete.cs new file mode 100644 index 0000000..77ee676 --- /dev/null +++ b/ProjectHotel/ProjectHotel/Entities/Athlete.cs @@ -0,0 +1,27 @@ +using ProjectHotel.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectHotel.Entities; + +public class Athlete +{ + public int Id { get; set; } + public string FirstName { get; private set; } = string.Empty; + public string LastName { get; private set; } = string.Empty; + public KindOfSport KindOfSport { get; private set; } + public static Athlete CreateEntity(int id, string first, string last, KindOfSport kindOfSport) + { + return new Athlete + { + Id = id, + FirstName = first ?? string.Empty, + LastName = last ?? string.Empty, + KindOfSport = kindOfSport + }; + } + +} diff --git a/ProjectHotel/ProjectHotel/Entities/Enums/KindOfSport.cs b/ProjectHotel/ProjectHotel/Entities/Enums/KindOfSport.cs new file mode 100644 index 0000000..c179c78 --- /dev/null +++ b/ProjectHotel/ProjectHotel/Entities/Enums/KindOfSport.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectHotel.Entities.Enums +{ + public enum KindOfSport + { + None = 0, + Archery = 1, + Athletics = 2, + Badminton = 3, + Basketball = 4, + Boxing = 5, + Cycling = 6, + Fencing = 7, + Gymnastics = 8, + Rowing = 9, + Swimming = 10 + } +} + diff --git a/ProjectHotel/ProjectHotel/Entities/Hotel.cs b/ProjectHotel/ProjectHotel/Entities/Hotel.cs new file mode 100644 index 0000000..de369fd --- /dev/null +++ b/ProjectHotel/ProjectHotel/Entities/Hotel.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectHotel.Entities; + +public class Hotel +{ + public int Id { get; private set; } + public string HotelName { get; private set; } = string.Empty; + public string Adress { get; private set; } = string.Empty; + public int TotalRooms { get; private set; } + public int SingleRooms { get; private set; } + public int DoubleRooms { get; private set; } + public int TripleRooms { get; private set; } + + + public int AvailableSingleRooms { get; private set; } + public int AvailableDoubleRooms { get; private set; } + public int AvailableTripleRooms { get; private set; } + + + public static Hotel CreateEntity(int id, string hotelName, string adress, int totalRooms, int singleRooms, int doubleRooms, int tripleRooms, + int availableSingleRooms, int availableDoubleRooms, int availableTripleRooms) + { + return new Hotel + { + Id = id, + HotelName = hotelName, + TotalRooms = totalRooms, + Adress = adress, + SingleRooms = singleRooms, + DoubleRooms = doubleRooms, + TripleRooms = tripleRooms, + AvailableSingleRooms = availableSingleRooms, + AvailableDoubleRooms = availableDoubleRooms, + AvailableTripleRooms = tripleRooms + + }; + } +} diff --git a/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs b/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs new file mode 100644 index 0000000..40c0dff --- /dev/null +++ b/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectHotel.Entities; + +public class PlacingAthlete +{ + public int Id { get; private set; } + public int AthleteId { get; private set;} + public int RoomId { get; private set; } + public DateTime PlacingDate { get; private set; } + public DateTime UnplacingDate { get; private set; } + public static PlacingAthlete CreateOpeartion(int id, int roomId, int athleteId, DateTime unplacing) + { + return new PlacingAthlete + { + Id = id, + AthleteId = athleteId, + RoomId = roomId, + PlacingDate = DateTime.Now, + UnplacingDate = unplacing, + }; + } + +} diff --git a/ProjectHotel/ProjectHotel/Entities/Rooms.cs b/ProjectHotel/ProjectHotel/Entities/Rooms.cs new file mode 100644 index 0000000..9569030 --- /dev/null +++ b/ProjectHotel/ProjectHotel/Entities/Rooms.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static System.Runtime.InteropServices.JavaScript.JSType; + +namespace ProjectHotel.Entities; + +public class Rooms +{ + public int Id { get; private set; } + public int HotelId { get; private set; } + public char RoomType { get; private set; } + public bool IsAvaiable { get; private set; } + public static Rooms CreateEntity(int id, int hotel, char type, bool avalible) + { + return new Rooms + { + Id = id, + HotelId = hotel, + RoomType = type, + IsAvaiable = avalible + }; + + } +} + diff --git a/ProjectHotel/ProjectHotel/Repositories/IAthleteRepository.cs b/ProjectHotel/ProjectHotel/Repositories/IAthleteRepository.cs new file mode 100644 index 0000000..5eedd10 --- /dev/null +++ b/ProjectHotel/ProjectHotel/Repositories/IAthleteRepository.cs @@ -0,0 +1,17 @@ +using ProjectHotel.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectHotel.Repositories; + +public interface IAthleteRepository +{ + IEnumerable ReadAthletes(); + Athlete ReadAthleteById(int id); + void CreateAthlete(Athlete athlete); + void UpdateAthlete(Athlete athlete); + void DeleteAthlete(int id); +} diff --git a/ProjectHotel/ProjectHotel/Repositories/IHotelRepository.cs b/ProjectHotel/ProjectHotel/Repositories/IHotelRepository.cs new file mode 100644 index 0000000..d523633 --- /dev/null +++ b/ProjectHotel/ProjectHotel/Repositories/IHotelRepository.cs @@ -0,0 +1,17 @@ +using ProjectHotel.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectHotel.Repositories; + +public interface IHotelRepository +{ + IEnumerable ReadAthletes(); + Athlete ReadHotelById(int id); + void CreateHotel(Hotel hotel); + void UpdateHotel(Hotel hotel); + void DeleteHotel(int id); +} diff --git a/ProjectHotel/ProjectHotel/Repositories/IPlacingRepository.cs b/ProjectHotel/ProjectHotel/Repositories/IPlacingRepository.cs new file mode 100644 index 0000000..a0d31cd --- /dev/null +++ b/ProjectHotel/ProjectHotel/Repositories/IPlacingRepository.cs @@ -0,0 +1,18 @@ +using ProjectHotel.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectHotel.Repositories; + +public interface IPlacingRepository +{ + IEnumerable ReadPlacing(); + PlacingAthlete ReadPlacingById(int id); + void CreateHotel(PlacingAthlete placing); + void UpdateHotel(PlacingAthlete placing); + void DeletePlacing(int id); +} +} diff --git a/ProjectHotel/ProjectHotel/Repositories/IRoomRepository.cs b/ProjectHotel/ProjectHotel/Repositories/IRoomRepository.cs new file mode 100644 index 0000000..f72d681 --- /dev/null +++ b/ProjectHotel/ProjectHotel/Repositories/IRoomRepository.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectHotel.Repositories +{ + internal interface IRoomRepository + { + } +}