diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/DataFileSingleton.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/DataFileSingleton.cs index f30651f..f24c7b5 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/DataFileSingleton.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/DataFileSingleton.cs @@ -20,9 +20,9 @@ namespace FurnitureAssemblyFileImplement private readonly string ClientFileName = "Client.xml"; - private readonly string ImplementerFileName = "Implementer.xml"; + private readonly string ImplementerFileName = "Implementer.xml"; - public List WorkPieces { get; private set; } + public List WorkPieces { get; private set; } public List Orders { get; private set; } @@ -30,9 +30,9 @@ namespace FurnitureAssemblyFileImplement public List Clients { get; private set; } - public List Implementers { get; private set; } + public List Implementers { get; private set; } - public static DataFileSingleton GetInstance() + public static DataFileSingleton GetInstance() { if (instance == null) { @@ -50,17 +50,17 @@ namespace FurnitureAssemblyFileImplement public void SaveClients() => SaveData(Clients, ClientFileName, "Clients", x => x.GetXElement); - public void SaveImplementers() => SaveData(Implementers, ImplementerFileName, "Implementers", x => x.GetXElement); + public void SaveImplementers() => SaveData(Implementers, ImplementerFileName, "Implementers", x => x.GetXElement); + - private DataFileSingleton() { WorkPieces = LoadData(WorkPieceFileName, "WorkPiece", x => WorkPiece.Create(x)!)!; Furnitures = LoadData(FurnitureFileName, "Furniture", x => Furniture.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)!)!; - } + Implementers = LoadData(ImplementerFileName, "Implementer", x => Implementer.Create(x)!)!; + } private static List? LoadData(string filename, string xmlNodeName, Func selectFunction) { @@ -74,7 +74,7 @@ namespace FurnitureAssemblyFileImplement private static void SaveData(List data, string filename, string xmlNodeName, Func selectFunction) { - if(data != null) + if (data != null) { new XDocument(new XElement(xmlNodeName, data.Select(selectFunction).ToArray())).Save(filename); } diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Order.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Order.cs index b9234b8..4384655 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Order.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Order.cs @@ -20,9 +20,9 @@ namespace FurnitureAssemblyFileImplement.Models public int ClientId { get; private set; } - public int? ImplementerId { get; private set; } + public int? ImplementerId { get; private set; } - public int Count { get; private set; } + public int Count { get; private set; } public double Sum { get; private set; } @@ -44,8 +44,8 @@ namespace FurnitureAssemblyFileImplement.Models Id = model.Id, FurnitureId = model.FurnitureId, ClientId = model.ClientId, - ImplementerId = model.ImplementerId, - Count = model.Count, + ImplementerId = model.ImplementerId, + Count = model.Count, Sum = model.Sum, Status = model.Status, DateCreate = model.DateCreate, @@ -65,8 +65,8 @@ namespace FurnitureAssemblyFileImplement.Models Id = Convert.ToInt32(element.Attribute("Id")!.Value), FurnitureId = Convert.ToInt32(element.Element("FurnitureId")!.Value), ClientId = Convert.ToInt32(element.Attribute("Id")!.Value), - ImplementerId = Convert.ToInt32(element.Attribute("ImplementerId")!.Value), - Count = Convert.ToInt32(element.Element("Count")!.Value), + ImplementerId = Convert.ToInt32(element.Attribute("ImplementerId")!.Value), + Count = Convert.ToInt32(element.Element("Count")!.Value), Sum = Convert.ToDouble(element.Element("Sum")!.Value), Status = (OrderStatus)Enum.Parse(typeof(OrderStatus), element.Element("Status")!.Value), DateCreate = Convert.ToDateTime(element.Element("DateCreate")!.Value), @@ -91,8 +91,8 @@ namespace FurnitureAssemblyFileImplement.Models Id = Id, FurnitureId = FurnitureId, ClientId = ClientId, - ImplementerId = ImplementerId, - Count = Count, + ImplementerId = ImplementerId, + Count = Count, Sum = Sum, Status = Status, DateCreate = DateCreate, @@ -103,8 +103,8 @@ namespace FurnitureAssemblyFileImplement.Models new XAttribute("Id", Id), new XElement("FurnitureId", FurnitureId.ToString()), new XElement("ClientId", ClientId.ToString()), - new XElement("ImplementerId", ImplementerId.ToString()), - new XElement("Count", Count.ToString()), + new XElement("ImplementerId", ImplementerId.ToString()), + new XElement("Count", Count.ToString()), new XElement("Sum", Sum.ToString()), new XElement("Status", Status.ToString()), new XElement("DateCreate", DateCreate.ToString()), diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/DataListSingleton.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/DataListSingleton.cs index 193d0a8..5964c4b 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/DataListSingleton.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/DataListSingleton.cs @@ -38,7 +38,7 @@ namespace FurnitureAssemblyListImplement public static DataListSingleton GetInstance() { - if(_instance == null) + if (_instance == null) { _instance = new DataListSingleton(); } diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Order.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Order.cs index f9dac3a..4be1f57 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Order.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Order.cs @@ -35,7 +35,7 @@ namespace FurnitureAssemblyListImplement.Models public static Order? Create(OrderBindingModel? model) { - if(model == null) + if (model == null) { return null; } @@ -45,8 +45,8 @@ namespace FurnitureAssemblyListImplement.Models Id = model.Id, FurnitureId = model.FurnitureId, ClientId = model.ClientId, - ImplementerId = model.ImplementerId, - Count = model.Count, + ImplementerId = model.ImplementerId, + Count = model.Count, Sum = model.Sum, Status = model.Status, DateCreate = model.DateCreate, @@ -57,7 +57,7 @@ namespace FurnitureAssemblyListImplement.Models // Метод изменения существующего объекта public void Update(OrderBindingModel? model) { - if(model == null) + if (model == null) { return; } @@ -72,8 +72,8 @@ namespace FurnitureAssemblyListImplement.Models Id = Id, FurnitureId = FurnitureId, ClientId = ClientId, - ImplementerId = ImplementerId, - Count = Count, + ImplementerId = ImplementerId, + Count = Count, Sum = Sum, Status = Status, DateCreate = DateCreate, diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormMain.cs b/FurnitureAssembly/FurnitureAssemblyView/FormMain.cs index c5cc0e0..fcbbead 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormMain.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormMain.cs @@ -52,8 +52,8 @@ namespace FurnitureAssemblyView dataGridView.DataSource = list; dataGridView.Columns["FurnitureId"].Visible = false; dataGridView.Columns["ClientId"].Visible = false; - dataGridView.Columns["ImplementerId"].Visible = false; - dataGridView.Columns["FurnitureName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + dataGridView.Columns["ImplementerId"].Visible = false; + dataGridView.Columns["FurnitureName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridView.Columns["ClientFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridView.Columns["ImplementerFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; }