еЩЕ ВОЗНЯ

This commit is contained in:
ivans 2024-11-26 01:43:42 +04:00
parent f570941eaa
commit a2be1354e8
8 changed files with 107 additions and 22 deletions

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAirline.Entities.Enums;
public enum PreparatoryWorkStatus
{
None = 0,
Waiting = 1,
InProgress = 2,
Completed = 3,
Canceled = 4
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAirline.Entities.Enums;
[Flags]
public enum TicketStatus
{
None = 0,
Paid = 1,
Canceled = 2,
Refunded = 4
}

View File

@ -1,4 +1,5 @@
using System;
using ProjectAirline.Entities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,22 @@ namespace ProjectAirline.Entities;
public class PreparatoryWork
{
public int Id { get; private set; }
public DateTime StartDate { get; private set; }
public DateTime EndDate { get; private set; }
public PreparatoryWorkStatus Status { get; private set; }
public static PreparatoryWork CreatePrerapatoryWork(int id, DateTime StartDate, DateTime EndDate, PreparatoryWorkStatus Status)
{
return new PreparatoryWork
{
Id = id,
StartDate = StartDate,
EndDate = EndDate,
Status = Status
};
}
}

View File

@ -20,5 +20,4 @@ public class Ticket
DateBuy = DateTime.Now,
};
}
}

View File

@ -9,13 +9,17 @@ namespace ProjectAirline.Repositories;
public interface IFlightRepository
{
IEnumerable<Flight> ReadFlights();
Flight ReadFlightById(int id);
IEnumerable<Flight> ReadFlights(DateTime? dateFrom = null, DateTime? dateTo = null, int? flightId = null);
void CreateFlight(Flight flight);
void UpdateFlight(Flight flight);
//IEnumerable<Flight> ReadFlights();
void DeleteFlight(int id);
//Flight ReadFlightById(int id);
//void CreateFlight(Flight flight);
//void UpdateFlight(Flight flight);
//void DeleteFlight(int id);
}

View File

@ -1,4 +1,5 @@
using System;
using ProjectAirline.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,4 +9,10 @@ namespace ProjectAirline.Repositories;
public interface IPreparatoryWorkRepository
{
IEnumerable<PreparatoryWork> ReadPreparatoryWork(DateTime? dateFrom = null, DateTime? dateTo = null, int? preparatoryWorkId = null,
PreparatoryWork? preparatoryWorkStatus = null);
void CreatePreparatoryWork(PreparatoryWork preparatoryWork);
void DeletePreparatoryWork(int id);
}

View File

@ -13,21 +13,27 @@ public class FlightRepository : IFlightRepository
{
}
public void DeleteFlight(int id)
{
}
public Flight ReadFlightById(int id)
{
return Flight.CreateFlight(0, DateTime.Now, DateTime.Now, string.Empty, 0);
}
public IEnumerable<Flight> ReadFlights()
public IEnumerable<Flight> ReadFlights(DateTime? dateFrom = null, DateTime? dateTo = null, int? flightId = null)
{
return [];
}
public void UpdateFlight(Flight flight)
{
}
//public void DeleteFlight(int id)
//{
//}
//public Flight ReadFlightById(int id)
//{
// return Flight.CreateFlight(0, DateTime.Now, DateTime.Now, string.Empty, 0);
//}
//public IEnumerable<Flight> ReadFlights()
//{
// return [];
//}
//public void UpdateFlight(Flight flight)
//{
//}
}

View File

@ -1,4 +1,5 @@
using System;
using ProjectAirline.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,16 @@ namespace ProjectAirline.Repositories.Implementations;
public class PreparatoryWorkRepository : IPreparatoryWorkRepository
{
public void CreatePreparatoryWork(PreparatoryWork preparatoryWork)
{
}
public void DeletePreparatoryWork(int id)
{
}
public IEnumerable<PreparatoryWork> ReadPreparatoryWork(DateTime? dateFrom = null, DateTime? dateTo = null, int? preparatoryWorkId = null, PreparatoryWork? preparatoryWorkStatus = null)
{
return [];
}
}