diff --git a/JewelryStoreFileImplement/DataFileSingleton.cs b/JewelryStoreFileImplement/DataFileSingleton.cs index 4479672..40f68f9 100644 --- a/JewelryStoreFileImplement/DataFileSingleton.cs +++ b/JewelryStoreFileImplement/DataFileSingleton.cs @@ -15,11 +15,14 @@ namespace JewelryStoreFileImplement private readonly string OrderFileName = "Order.xml"; private readonly string JewelFileName = "Jewel.xml"; private readonly string ClientFileName = "Client.xml"; + private readonly string ImplementerFileName = "Implementer.xml"; + public List Components { get; private set; } public List Orders { get; private set; } public List Jewels { get; private set; } public List Clients { get; private set; } + public List Implementers { get; private set; } public static DataFileSingleton GetInstance() { @@ -33,6 +36,8 @@ namespace JewelryStoreFileImplement public void SaveJewels() => SaveData(Jewels, JewelFileName, "Jewels", x => x.GetXElement); public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement); public void SaveClients() => SaveData(Clients, OrderFileName, "Clients", x => x.GetXElement); + public void SaveImplementers() => SaveData(Implementers, OrderFileName, "Implementers", x => x.GetXElement); + private DataFileSingleton() { @@ -40,6 +45,8 @@ namespace JewelryStoreFileImplement Jewels = LoadData(JewelFileName, "Jewel", x => Jewel.Create(x)!)!; Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!; Clients = LoadData(ClientFileName, "Client", x => Client.Create(x)!)!; + Implementers = LoadData(ImplementerFileName, "Implementer", x => Implementer.Create(x)!)!; + } private static List? LoadData(string filename, string xmlNodeName, Func selectFunction) diff --git a/JewelryStoreFileImplement/Implements/ImplementerStorage.cs b/JewelryStoreFileImplement/Implements/ImplementerStorage.cs index b0c823a..16ff71e 100644 --- a/JewelryStoreFileImplement/Implements/ImplementerStorage.cs +++ b/JewelryStoreFileImplement/Implements/ImplementerStorage.cs @@ -2,6 +2,7 @@ using JewelryStoreContracts.SearchModels; using JewelryStoreContracts.StoragesContracts; using JewelryStoreContracts.ViewModels; +using JewelryStoreFileImplement.Models; using System; using System.Collections.Generic; using System.Linq;