From 191dd5dfd340e4e58c5416dfa535e08e3f7b7255 Mon Sep 17 00:00:00 2001 From: ivans Date: Wed, 30 Oct 2024 11:13:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=88=D0=BB=D0=B0=20=D0=B2=D0=BE?= =?UTF-8?q?=D0=B7=D0=BD=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectAirline/Entities/Flight.cs | 32 +++++++++++++++++++ ProjectAirline/Entities/Passanger.cs | 23 +++++++++++++ ProjectAirline/Entities/Plane.cs | 26 +++++++++++++++ ProjectAirline/Entities/PreparatoryWork.cs | 12 +++++++ ProjectAirline/Entities/Ticket.cs | 15 +++++++++ ...m1.Designer.cs => FormAirline.Designer.cs} | 2 +- ProjectAirline/{Form1.cs => FormAirline.cs} | 4 +-- .../{Form1.resx => FormAirline.resx} | 0 ProjectAirline/Program.cs | 2 +- 9 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 ProjectAirline/Entities/Flight.cs create mode 100644 ProjectAirline/Entities/Passanger.cs create mode 100644 ProjectAirline/Entities/Plane.cs create mode 100644 ProjectAirline/Entities/PreparatoryWork.cs create mode 100644 ProjectAirline/Entities/Ticket.cs rename ProjectAirline/{Form1.Designer.cs => FormAirline.Designer.cs} (97%) rename ProjectAirline/{Form1.cs => FormAirline.cs} (56%) rename ProjectAirline/{Form1.resx => FormAirline.resx} (100%) diff --git a/ProjectAirline/Entities/Flight.cs b/ProjectAirline/Entities/Flight.cs new file mode 100644 index 0000000..a0ce739 --- /dev/null +++ b/ProjectAirline/Entities/Flight.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectAirline.Entities; + +public class Flight +{ + public int Id { get; private set; } + + public DateTime DatetimeDeparture { get; private set; } + + public DateTime ArrivalTime { get; private set; } + + public string ArrivalLocation { get; private set; } = string.Empty; + + public int TicketPrice { get; private set; } + + public static Flight CreateFlight(int id, DateTime dateTimeDeparture, DateTime arrivalTime, string arrivalLocation, int ticketPrice) + { + return new Flight + { + Id = id, + DatetimeDeparture = dateTimeDeparture, + ArrivalTime = arrivalTime, + ArrivalLocation = arrivalLocation, + TicketPrice = ticketPrice + }; + } +} diff --git a/ProjectAirline/Entities/Passanger.cs b/ProjectAirline/Entities/Passanger.cs new file mode 100644 index 0000000..8eee72d --- /dev/null +++ b/ProjectAirline/Entities/Passanger.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectAirline.Entities; + +public class Passanger +{ + public int Id { get; private set; } + + public string Name { get; private set; } = string.Empty; + + public static Passanger CreatePassanger(int id, string name) + { + return new Passanger + { + Id = id, + Name = name, + }; + } +} diff --git a/ProjectAirline/Entities/Plane.cs b/ProjectAirline/Entities/Plane.cs new file mode 100644 index 0000000..854f992 --- /dev/null +++ b/ProjectAirline/Entities/Plane.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectAirline.Entities; + +public class Plane +{ + public int Id { get; private set; } + + public string Name { get; private set; } = string.Empty; + + public int Capacity { get; private set; } + + public static Plane CreatePlane(int id, string name, int capacity) + { + return new Plane + { + Id = id, + Name = name, + Capacity = capacity + }; + } +} diff --git a/ProjectAirline/Entities/PreparatoryWork.cs b/ProjectAirline/Entities/PreparatoryWork.cs new file mode 100644 index 0000000..1e9b3a3 --- /dev/null +++ b/ProjectAirline/Entities/PreparatoryWork.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectAirline.Entities; + +public class PreparatoryWork +{ + +} diff --git a/ProjectAirline/Entities/Ticket.cs b/ProjectAirline/Entities/Ticket.cs new file mode 100644 index 0000000..9e71050 --- /dev/null +++ b/ProjectAirline/Entities/Ticket.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectAirline.Entities; + +public class Ticket +{ + public int Id { get; private set; } + + public DateTime DateBuy { get; private set; } + +} diff --git a/ProjectAirline/Form1.Designer.cs b/ProjectAirline/FormAirline.Designer.cs similarity index 97% rename from ProjectAirline/Form1.Designer.cs rename to ProjectAirline/FormAirline.Designer.cs index eca5924..7e0c2ec 100644 --- a/ProjectAirline/Form1.Designer.cs +++ b/ProjectAirline/FormAirline.Designer.cs @@ -1,6 +1,6 @@ namespace ProjectAirline { - partial class Form1 + partial class FormAirline { /// /// Required designer variable. diff --git a/ProjectAirline/Form1.cs b/ProjectAirline/FormAirline.cs similarity index 56% rename from ProjectAirline/Form1.cs rename to ProjectAirline/FormAirline.cs index c73297f..9d85215 100644 --- a/ProjectAirline/Form1.cs +++ b/ProjectAirline/FormAirline.cs @@ -1,8 +1,8 @@ namespace ProjectAirline { - public partial class Form1 : Form + public partial class FormAirline : Form { - public Form1() + public FormAirline() { InitializeComponent(); } diff --git a/ProjectAirline/Form1.resx b/ProjectAirline/FormAirline.resx similarity index 100% rename from ProjectAirline/Form1.resx rename to ProjectAirline/FormAirline.resx diff --git a/ProjectAirline/Program.cs b/ProjectAirline/Program.cs index 4cd196a..ae61fc9 100644 --- a/ProjectAirline/Program.cs +++ b/ProjectAirline/Program.cs @@ -11,7 +11,7 @@ namespace ProjectAirline // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(new FormAirline()); } } } \ No newline at end of file