diff --git a/ProjectLibrary/Entites/Book.cs b/ProjectLibrary/Entites/Book.cs new file mode 100644 index 0000000..024f24b --- /dev/null +++ b/ProjectLibrary/Entites/Book.cs @@ -0,0 +1,26 @@ +namespace ProjectLibrary.Entities +{ + using ProjectLibrary.Entities.Enums; + + public class Book + { + public int Id { get; private set; } + public string Author { get; private set; } = string.Empty; + public string Name { get; private set; } = string.Empty; + public BookType Type { get; private set; } = BookType.None; + + public int LibraryID { get; private set; } + + public static Book CreateEntity(int id, string author, string name, BookType type, int libraryID) + { + return new Book + { + Id = id, + Author = author ?? string.Empty, + Name = name ?? string.Empty, + Type = type, + LibraryID = libraryID + }; + } + } +} diff --git a/ProjectLibrary/Entites/Book_Orders.cs b/ProjectLibrary/Entites/Book_Orders.cs new file mode 100644 index 0000000..310aee2 --- /dev/null +++ b/ProjectLibrary/Entites/Book_Orders.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectLibrary.Entites +{ + public class BookOrders + { + public int BookID { get; private set; } + public int OrderID { get; private set; } + + public static BookOrders CreateEntity(int bookID, int orderID) + { + return new BookOrders + { + BookID = bookID, + OrderID = orderID + }; + } + } +} diff --git a/ProjectLibrary/Entites/Book_library.cs b/ProjectLibrary/Entites/Book_library.cs new file mode 100644 index 0000000..df7606d --- /dev/null +++ b/ProjectLibrary/Entites/Book_library.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectLibrary.Entites +{ + public class BookLibrary + { + public int BookID { get; private set; } + public int LibraryID { get; private set; } + public int Count { get; private set; } + + public static BookLibrary CreateEntity(int bookID, int libraryID, int count) + { + return new BookLibrary + { + BookID = bookID, + LibraryID = libraryID, + Count = count + }; + } + } +} diff --git a/ProjectLibrary/Entites/Enums/BookStatus.cs b/ProjectLibrary/Entites/Enums/BookStatus.cs new file mode 100644 index 0000000..73e2de7 --- /dev/null +++ b/ProjectLibrary/Entites/Enums/BookStatus.cs @@ -0,0 +1,11 @@ +namespace ProjectLibrary.Entities.Enums +{ + public enum BookStatus + { + None = 0, + Available = 1, + CheckedOut = 2, + Reserved = 3, + Lost = 4 + } +} diff --git a/ProjectLibrary/Entites/Enums/BookType.cs b/ProjectLibrary/Entites/Enums/BookType.cs new file mode 100644 index 0000000..865fa09 --- /dev/null +++ b/ProjectLibrary/Entites/Enums/BookType.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectLibrary.Entities.Enums +{ + [Flags] + public enum BookType + { + None = 0, + Fiction = 1, + NonFiction = 2, + Science = 4, + History = 8, + Mystery = 16, + Fantasy = 32 + } +} \ No newline at end of file diff --git a/ProjectLibrary/Entites/Library.cs b/ProjectLibrary/Entites/Library.cs new file mode 100644 index 0000000..d8c3514 --- /dev/null +++ b/ProjectLibrary/Entites/Library.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectLibrary.Entites +{ + public class Library + { + public int Id { get; private set; } + public string Name { get; private set; } = string.Empty; + public string Address { get; private set; } = string.Empty; + + public static Library CreateEntity(int id, string name, string address) + { + return new Library + { + Id = id, + Name = name ?? string.Empty, + Address = address ?? string.Empty + }; + } + } +} diff --git a/ProjectLibrary/Entites/Orders.cs b/ProjectLibrary/Entites/Orders.cs new file mode 100644 index 0000000..7198f0e --- /dev/null +++ b/ProjectLibrary/Entites/Orders.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectLibrary.Entites +{ + public class Orders + { + public int Id { get; private set; } + public int OrderDate { get; private set; } + public int ReturnDate { get; private set; } + public int ReaderID { get; private set; } + + public static Orders CreateEntity(int id, int orderDate, int returnDate, int readerID) + { + return new Orders + { + Id = id, + OrderDate = orderDate, + ReturnDate = returnDate, + ReaderID = readerID + }; + } + } +} diff --git a/ProjectLibrary/Entites/Reader.cs b/ProjectLibrary/Entites/Reader.cs new file mode 100644 index 0000000..5fd23d1 --- /dev/null +++ b/ProjectLibrary/Entites/Reader.cs @@ -0,0 +1,21 @@ +namespace ProjectLibrary.Entities +{ + public class Reader + { + public int Id { get; private set; } + public string Name { get; private set; } = string.Empty; + public int ReaderTicket { get; private set; } + public DateTime RegistrationDateRT { get; private set; } // Изменение на DateTime + + public static Reader CreateEntity(int id, string name, int readerTicket, DateTime registrationDateRT) + { + return new Reader + { + Id = id, + Name = name ?? string.Empty, + ReaderTicket = readerTicket, + RegistrationDateRT = registrationDateRT + }; + } + } +} diff --git a/ProjectLibrary/Entites/Ticket_Extension.cs b/ProjectLibrary/Entites/Ticket_Extension.cs new file mode 100644 index 0000000..9e58ce7 --- /dev/null +++ b/ProjectLibrary/Entites/Ticket_Extension.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectLibrary.Entites +{ + public class TicketExtensions + { + public int ReaderID { get; private set; } + public int ExtensionID { get; private set; } + public DateTime LastUpdateDate { get; private set; } + public DateTime NextUpdateDate { get; private set; } + + public static TicketExtensions CreateEntity(int readerID, int extensionID, DateTime lastUpdateDate, DateTime nextUpdateDate) + { + return new TicketExtensions + { + ReaderID = readerID, + ExtensionID = extensionID, + LastUpdateDate = lastUpdateDate, + NextUpdateDate = nextUpdateDate + }; + } + } +} diff --git a/ProjectLibrary/Form1.Designer.cs b/ProjectLibrary/FormLibrary.Designer.cs similarity index 97% rename from ProjectLibrary/Form1.Designer.cs rename to ProjectLibrary/FormLibrary.Designer.cs index 11bc596..6172ee3 100644 --- a/ProjectLibrary/Form1.Designer.cs +++ b/ProjectLibrary/FormLibrary.Designer.cs @@ -1,6 +1,6 @@ namespace ProjectLibrary { - partial class Form1 + partial class FormLibrary { /// /// Required designer variable. diff --git a/ProjectLibrary/Form1.cs b/ProjectLibrary/FormLibrary.cs similarity index 56% rename from ProjectLibrary/Form1.cs rename to ProjectLibrary/FormLibrary.cs index fa0ca5b..0c8abff 100644 --- a/ProjectLibrary/Form1.cs +++ b/ProjectLibrary/FormLibrary.cs @@ -1,8 +1,8 @@ namespace ProjectLibrary { - public partial class Form1 : Form + public partial class FormLibrary : Form { - public Form1() + public FormLibrary() { InitializeComponent(); } diff --git a/ProjectLibrary/Form1.resx b/ProjectLibrary/FormLibrary.resx similarity index 100% rename from ProjectLibrary/Form1.resx rename to ProjectLibrary/FormLibrary.resx diff --git a/ProjectLibrary/Program.cs b/ProjectLibrary/Program.cs index 2baf02a..bc942f4 100644 --- a/ProjectLibrary/Program.cs +++ b/ProjectLibrary/Program.cs @@ -1,3 +1,7 @@ +using ProjectLibrary.Repositories.Implementations; +using ProjectLibrary.Repositories; +using Unity; + namespace ProjectLibrary { internal static class Program @@ -11,7 +15,25 @@ namespace ProjectLibrary // 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(CreateContainer().Resolve()); } + + private static IUnityContainer CreateContainer() + { + var container = new UnityContainer(); + + // + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + + return container; + } + + } } \ No newline at end of file diff --git a/ProjectLibrary/ProjectLibrary.csproj b/ProjectLibrary/ProjectLibrary.csproj index 663fdb8..894afcd 100644 --- a/ProjectLibrary/ProjectLibrary.csproj +++ b/ProjectLibrary/ProjectLibrary.csproj @@ -8,4 +8,8 @@ enable + + + + \ No newline at end of file diff --git a/ProjectLibrary/Repositores/IBookLibraryRepository.cs b/ProjectLibrary/Repositores/IBookLibraryRepository.cs new file mode 100644 index 0000000..4ef06aa --- /dev/null +++ b/ProjectLibrary/Repositores/IBookLibraryRepository.cs @@ -0,0 +1,12 @@ +namespace ProjectLibrary.Repositories +{ + using ProjectLibrary.Entites; + using ProjectLibrary.Entities; + + public interface IBookLibraryRepository + { + IEnumerable ReadBookLibraries(int? bookId = null, int? libraryId = null); + void CreateBookLibrary(BookLibrary bookLibrary); + void DeleteBookLibrary(int bookId, int libraryId); + } +} diff --git a/ProjectLibrary/Repositores/IBookOrderRepository.cs b/ProjectLibrary/Repositores/IBookOrderRepository.cs new file mode 100644 index 0000000..d5cdfa0 --- /dev/null +++ b/ProjectLibrary/Repositores/IBookOrderRepository.cs @@ -0,0 +1,12 @@ +namespace ProjectLibrary.Repositories +{ + using ProjectLibrary.Entites; + using ProjectLibrary.Entities; + + public interface IBookOrdersRepository + { + IEnumerable ReadBookOrders(int? bookId = null, int? orderId = null); + void CreateBookOrder(BookOrders bookOrder); + void DeleteBookOrder(int bookId, int orderId); + } +} diff --git a/ProjectLibrary/Repositores/IBookRepository.cs b/ProjectLibrary/Repositores/IBookRepository.cs new file mode 100644 index 0000000..bdfb283 --- /dev/null +++ b/ProjectLibrary/Repositores/IBookRepository.cs @@ -0,0 +1,13 @@ +namespace ProjectLibrary.Repositories +{ + using ProjectLibrary.Entities; + + public interface IBookRepository + { + IEnumerable ReadBooks(); + Book ReadBookById(int id); + void CreateBook(Book book); + void UpdateBook(Book book); + void DeleteBook(int id); + } +} diff --git a/ProjectLibrary/Repositores/ILibraryRepository.cs b/ProjectLibrary/Repositores/ILibraryRepository.cs new file mode 100644 index 0000000..21c3951 --- /dev/null +++ b/ProjectLibrary/Repositores/ILibraryRepository.cs @@ -0,0 +1,14 @@ +namespace ProjectLibrary.Repositories +{ + using ProjectLibrary.Entites; + using ProjectLibrary.Entities; + + public interface ILibraryRepository + { + IEnumerable ReadLibraries(); + Library ReadLibraryById(int id); + void CreateLibrary(Library library); + void UpdateLibrary(Library library); + void DeleteLibrary(int id); + } +} diff --git a/ProjectLibrary/Repositores/IOrderRepository.cs b/ProjectLibrary/Repositores/IOrderRepository.cs new file mode 100644 index 0000000..47a1c5d --- /dev/null +++ b/ProjectLibrary/Repositores/IOrderRepository.cs @@ -0,0 +1,13 @@ +namespace ProjectLibrary.Repositories +{ + using ProjectLibrary.Entites; + + public interface IOrderRepository + { + IEnumerable ReadOrders(); + Orders ReadOrderById(int id); + void CreateOrder(Orders order); + void UpdateOrder(Orders order); + void DeleteOrder(int id); + } +} diff --git a/ProjectLibrary/Repositores/IReaderRepository.cs b/ProjectLibrary/Repositores/IReaderRepository.cs new file mode 100644 index 0000000..882131c --- /dev/null +++ b/ProjectLibrary/Repositores/IReaderRepository.cs @@ -0,0 +1,14 @@ +namespace ProjectLibrary.Repositories +{ + using ProjectLibrary.Entites; + using ProjectLibrary.Entities; + + public interface IReaderRepository + { + IEnumerable ReadReaders(); + Reader ReadReaderById(int id); + void CreateReader(Reader reader); + void UpdateReader(Reader reader); + void DeleteReader(int id); + } +} diff --git a/ProjectLibrary/Repositores/ITicketExtensionRepository.cs b/ProjectLibrary/Repositores/ITicketExtensionRepository.cs new file mode 100644 index 0000000..c030f04 --- /dev/null +++ b/ProjectLibrary/Repositores/ITicketExtensionRepository.cs @@ -0,0 +1,14 @@ +namespace ProjectLibrary.Repositories +{ + using ProjectLibrary.Entites; + using ProjectLibrary.Entities; + + public interface ITicketExtensionsRepository + { + IEnumerable ReadTicketExtensions(); + TicketExtensions ReadTicketExtensionById(int id); + void CreateTicketExtension(TicketExtensions ticketExtension); + void UpdateTicketExtension(TicketExtensions ticketExtension); + void DeleteTicketExtension(int id); + } +} diff --git a/ProjectLibrary/Repositores/Implementations/BookLibraryRepository.cs b/ProjectLibrary/Repositores/Implementations/BookLibraryRepository.cs new file mode 100644 index 0000000..3c61e25 --- /dev/null +++ b/ProjectLibrary/Repositores/Implementations/BookLibraryRepository.cs @@ -0,0 +1,49 @@ +using ProjectLibrary.Entites; +using ProjectLibrary.Entities; +using ProjectLibrary.Repositories; +using System.Collections.Generic; +using System.Linq; + +namespace ProjectLibrary.Repositories.Implementations +{ + public class BookLibraryRepository : IBookLibraryRepository + { + // Эмулируем базу данных в виде списка + private readonly List _bookLibraries = new List(); + + public void CreateBookLibrary(BookLibrary bookLibrary) + { + // Логика для добавления связи книги и библиотеки + _bookLibraries.Add(bookLibrary); + } + + public void DeleteBookLibrary(int bookId, int libraryId) + { + // Логика для удаления связи книги и библиотеки по идентификаторам + var bookLibrary = _bookLibraries.FirstOrDefault(bl => bl.BookID == bookId && bl.LibraryID == libraryId); + if (bookLibrary != null) + { + _bookLibraries.Remove(bookLibrary); + } + } + + public IEnumerable ReadBookLibraries(int? bookId = null, int? libraryId = null) + { + // Логика для получения всех связей книг и библиотек с возможностью фильтрации по bookId и libraryId + return _bookLibraries.Where(bl => + (!bookId.HasValue || bl.BookID == bookId) && + (!libraryId.HasValue || bl.LibraryID == libraryId)); + } + + public void UpdateBookLibrary(BookLibrary bookLibrary) + { + // Логика для обновления информации о связи книги и библиотеки + var existingBookLibrary = _bookLibraries.FirstOrDefault(bl => bl.BookID == bookLibrary.BookID && bl.LibraryID == bookLibrary.LibraryID); + if (existingBookLibrary != null) + { + _bookLibraries.Remove(existingBookLibrary); + _bookLibraries.Add(bookLibrary); + } + } + } +} diff --git a/ProjectLibrary/Repositores/Implementations/BookOrdersRepository.cs b/ProjectLibrary/Repositores/Implementations/BookOrdersRepository.cs new file mode 100644 index 0000000..522cea5 --- /dev/null +++ b/ProjectLibrary/Repositores/Implementations/BookOrdersRepository.cs @@ -0,0 +1,38 @@ +using ProjectLibrary.Entites; +using ProjectLibrary.Entities; +using ProjectLibrary.Repositories; +using System.Collections.Generic; +using System.Linq; + +namespace ProjectLibrary.Repositories.Implementations +{ + public class BookOrdersRepository : IBookOrdersRepository + { + // Эмулируем базу данных в виде списка + private readonly List _bookOrders = new List(); + + public void CreateBookOrder(BookOrders bookOrder) + { + // Логика для добавления связи книги и заказа + _bookOrders.Add(bookOrder); + } + + public void DeleteBookOrder(int bookId, int orderId) + { + // Логика для удаления связи книги и заказа по идентификаторам + var bookOrder = _bookOrders.FirstOrDefault(bo => bo.BookID == bookId && bo.OrderID == orderId); + if (bookOrder != null) + { + _bookOrders.Remove(bookOrder); + } + } + + public IEnumerable ReadBookOrders(int? bookId = null, int? orderId = null) + { + // Логика для получения всех связей книг и заказов с возможностью фильтрации по bookId и orderId + return _bookOrders.Where(bo => + (!bookId.HasValue || bo.BookID == bookId) && + (!orderId.HasValue || bo.OrderID == orderId)); + } + } +} diff --git a/ProjectLibrary/Repositores/Implementations/BookRepository.cs b/ProjectLibrary/Repositores/Implementations/BookRepository.cs new file mode 100644 index 0000000..44025a4 --- /dev/null +++ b/ProjectLibrary/Repositores/Implementations/BookRepository.cs @@ -0,0 +1,53 @@ +using ProjectLibrary.Entities; +using ProjectLibrary.Entities.Enums; +using ProjectLibrary.Repositories; +using System.Collections.Generic; +using System.Linq; + +namespace ProjectLibrary.Repositories.Implementations +{ + public class BookRepository : IBookRepository + { + // Эмулируем базу данных в виде списка + private readonly List _books = new List(); + + public void CreateBook(Book book) + { + // Логика для добавления книги в базу данных + _books.Add(book); + } + + public void DeleteBook(int id) + { + // Логика для удаления книги по id + var book = _books.FirstOrDefault(b => b.Id == id); + if (book != null) + { + _books.Remove(book); + } + } + + public Book ReadBookById(int id) + { + // Логика для получения книги по id + return _books.FirstOrDefault(b => b.Id == id) ?? Book.CreateEntity(id, "Unknown Author", "Unknown Title", BookType.None, 0); + } + + public IEnumerable ReadBooks() + { + // Логика для получения всех книг + return _books; + } + + public void UpdateBook(Book book) + { + // Логика для обновления информации о книге + var existingBook = _books.FirstOrDefault(b => b.Id == book.Id); + if (existingBook != null) + { + _books.Remove(existingBook); + _books.Add(book); + } + } + } +} diff --git a/ProjectLibrary/Repositores/Implementations/LibraryRepository.cs b/ProjectLibrary/Repositores/Implementations/LibraryRepository.cs new file mode 100644 index 0000000..2ffc164 --- /dev/null +++ b/ProjectLibrary/Repositores/Implementations/LibraryRepository.cs @@ -0,0 +1,47 @@ +using ProjectLibrary.Entites; +using ProjectLibrary.Entities; +using ProjectLibrary.Repositories; +using System.Collections.Generic; +using System.Linq; + +namespace ProjectLibrary.Repositories.Implementations +{ + public class LibraryRepository : ILibraryRepository + { + private readonly List _libraries = new List(); + + public void CreateLibrary(Library library) + { + _libraries.Add(library); + } + + public void DeleteLibrary(int id) + { + var library = _libraries.FirstOrDefault(l => l.Id == id); + if (library != null) + { + _libraries.Remove(library); + } + } + + public Library ReadLibraryById(int id) + { + return _libraries.FirstOrDefault(l => l.Id == id) ?? Library.CreateEntity(id, "Unknown Library", "Unknown Address"); + } + + public IEnumerable ReadLibraries() + { + return _libraries; + } + + public void UpdateLibrary(Library library) + { + var existingLibrary = _libraries.FirstOrDefault(l => l.Id == library.Id); + if (existingLibrary != null) + { + _libraries.Remove(existingLibrary); + _libraries.Add(library); + } + } + } +} diff --git a/ProjectLibrary/Repositores/Implementations/OrderRepository.cs b/ProjectLibrary/Repositores/Implementations/OrderRepository.cs new file mode 100644 index 0000000..0495c45 --- /dev/null +++ b/ProjectLibrary/Repositores/Implementations/OrderRepository.cs @@ -0,0 +1,47 @@ +using ProjectLibrary.Entites; +using ProjectLibrary.Entities; +using ProjectLibrary.Repositories; +using System.Collections.Generic; +using System.Linq; + +namespace ProjectLibrary.Repositories.Implementations +{ + public class OrderRepository : IOrderRepository + { + private readonly List _orders = new List(); + + public void CreateOrder(Orders order) + { + _orders.Add(order); + } + + public void DeleteOrder(int id) + { + var order = _orders.FirstOrDefault(o => o.Id == id); + if (order != null) + { + _orders.Remove(order); + } + } + + public Orders ReadOrderById(int id) + { + return _orders.FirstOrDefault(o => o.Id == id) ?? Orders.CreateEntity(id, 0, 0, 0); + } + + public IEnumerable ReadOrders() + { + return _orders; + } + + public void UpdateOrder(Orders order) + { + var existingOrder = _orders.FirstOrDefault(o => o.Id == order.Id); + if (existingOrder != null) + { + _orders.Remove(existingOrder); + _orders.Add(order); + } + } + } +} diff --git a/ProjectLibrary/Repositores/Implementations/ReaderRepository.cs b/ProjectLibrary/Repositores/Implementations/ReaderRepository.cs new file mode 100644 index 0000000..250ccd1 --- /dev/null +++ b/ProjectLibrary/Repositores/Implementations/ReaderRepository.cs @@ -0,0 +1,47 @@ +using ProjectLibrary.Entites; +using ProjectLibrary.Entities; +using ProjectLibrary.Repositories; +using System.Collections.Generic; +using System.Linq; + +namespace ProjectLibrary.Repositories.Implementations +{ + public class ReaderRepository : IReaderRepository + { + private readonly List _readers = new List(); + + public void CreateReader(Reader reader) + { + _readers.Add(reader); + } + + public void DeleteReader(int id) + { + var reader = _readers.FirstOrDefault(r => r.Id == id); + if (reader != null) + { + _readers.Remove(reader); + } + } + + public Reader ReadReaderById(int id) + { + return _readers.FirstOrDefault(r => r.Id == id) ?? Reader.CreateEntity(id, "Unknown Reader", 0, DateTime.Now); + } + + public IEnumerable ReadReaders() + { + return _readers; + } + + public void UpdateReader(Reader reader) + { + var existingReader = _readers.FirstOrDefault(r => r.Id == reader.Id); + if (existingReader != null) + { + _readers.Remove(existingReader); + _readers.Add(reader); + } + } + } +} diff --git a/ProjectLibrary/Repositores/Implementations/TicketExtensionsRepository.cs b/ProjectLibrary/Repositores/Implementations/TicketExtensionsRepository.cs new file mode 100644 index 0000000..60f8b44 --- /dev/null +++ b/ProjectLibrary/Repositores/Implementations/TicketExtensionsRepository.cs @@ -0,0 +1,47 @@ +using ProjectLibrary.Entites; +using ProjectLibrary.Entities; +using ProjectLibrary.Repositories; +using System.Collections.Generic; +using System.Linq; + +namespace ProjectLibrary.Repositories.Implementations +{ + public class TicketExtensionsRepository : ITicketExtensionsRepository + { + private readonly List _ticketExtensions = new List(); + + public void CreateTicketExtension(TicketExtensions ticketExtension) + { + _ticketExtensions.Add(ticketExtension); + } + + public void DeleteTicketExtension(int id) + { + var ticketExtension = _ticketExtensions.FirstOrDefault(t => t.ExtensionID == id); + if (ticketExtension != null) + { + _ticketExtensions.Remove(ticketExtension); + } + } + + public TicketExtensions ReadTicketExtensionById(int id) + { + return _ticketExtensions.FirstOrDefault(t => t.ExtensionID == id) ?? TicketExtensions.CreateEntity(0, id, DateTime.Now, DateTime.Now); + } + + public IEnumerable ReadTicketExtensions() + { + return _ticketExtensions; + } + + public void UpdateTicketExtension(TicketExtensions ticketExtension) + { + var existingTicketExtension = _ticketExtensions.FirstOrDefault(t => t.ExtensionID == ticketExtension.ExtensionID); + if (existingTicketExtension != null) + { + _ticketExtensions.Remove(existingTicketExtension); + _ticketExtensions.Add(ticketExtension); + } + } + } +}