From a9b7625b2b15839f99523cbd01d1f23e6c33a5d5 Mon Sep 17 00:00:00 2001 From: "ityurner02@mail.ru" Date: Sat, 18 Feb 2023 19:58:39 +0400 Subject: [PATCH 1/2] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PlumbingRepair/PlumbingRepair.sln | 14 ++- .../PlumbingRepair/PlumbingRepair.csproj | 1 + PlumbingRepair/PlumbingRepair/Program.cs | 2 +- .../DataFileSingleton.cs | 56 ++++++++++ .../Implements/ComponentStorage.cs | 89 ++++++++++++++++ .../Implements/OrderStorage.cs | 89 ++++++++++++++++ .../Implements/WorkStorage.cs | 89 ++++++++++++++++ .../Models/Component.cs | 64 +++++++++++ .../Models/Order.cs | 100 ++++++++++++++++++ .../Models/Work.cs | 91 ++++++++++++++++ .../PlumbingRepairFileImplement.csproj | 14 +++ 11 files changed, 604 insertions(+), 5 deletions(-) create mode 100644 PlumbingRepair/PlumpingRepairFileImplement/DataFileSingleton.cs create mode 100644 PlumbingRepair/PlumpingRepairFileImplement/Implements/ComponentStorage.cs create mode 100644 PlumbingRepair/PlumpingRepairFileImplement/Implements/OrderStorage.cs create mode 100644 PlumbingRepair/PlumpingRepairFileImplement/Implements/WorkStorage.cs create mode 100644 PlumbingRepair/PlumpingRepairFileImplement/Models/Component.cs create mode 100644 PlumbingRepair/PlumpingRepairFileImplement/Models/Order.cs create mode 100644 PlumbingRepair/PlumpingRepairFileImplement/Models/Work.cs create mode 100644 PlumbingRepair/PlumpingRepairFileImplement/PlumbingRepairFileImplement.csproj diff --git a/PlumbingRepair/PlumbingRepair.sln b/PlumbingRepair/PlumbingRepair.sln index d074019..579e499 100644 --- a/PlumbingRepair/PlumbingRepair.sln +++ b/PlumbingRepair/PlumbingRepair.sln @@ -5,13 +5,15 @@ VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlumbingRepair", "PlumbingRepair\PlumbingRepair.csproj", "{F0AEA1F3-7D99-4EC1-B79F-97E6927ECBCA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlumbingRepairDataModels", "PlumbingRepairDataModels\PlumbingRepairDataModels.csproj", "{90DD7D7A-91FD-403D-8D3A-FE8842AA5848}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlumbingRepairDataModels", "PlumbingRepairDataModels\PlumbingRepairDataModels.csproj", "{90DD7D7A-91FD-403D-8D3A-FE8842AA5848}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlumbingRepairContracts", "PlumbingRepairContracts\PlumbingRepairContracts.csproj", "{5200A7ED-CC3F-4602-984D-1B56A43A50D2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlumbingRepairContracts", "PlumbingRepairContracts\PlumbingRepairContracts.csproj", "{5200A7ED-CC3F-4602-984D-1B56A43A50D2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlumbingRepairBusinessLogic", "PlumbingRepairBusinessLogic\PlumbingRepairBusinessLogic.csproj", "{3C711D99-7E84-4B26-8312-7C10A360BD54}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlumbingRepairBusinessLogic", "PlumbingRepairBusinessLogic\PlumbingRepairBusinessLogic.csproj", "{3C711D99-7E84-4B26-8312-7C10A360BD54}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlumbingRepairListImplement", "PlumbingRepairListImplement\PlumbingRepairListImplement.csproj", "{9B17B17E-1201-4B23-ACCD-EF7F4495E4B7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlumbingRepairListImplement", "PlumbingRepairListImplement\PlumbingRepairListImplement.csproj", "{9B17B17E-1201-4B23-ACCD-EF7F4495E4B7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlumbingRepairFileImplement", "PlumpingRepairFileImplement\PlumbingRepairFileImplement.csproj", "{BA7E2CE6-7797-42C7-931C-40C48EA521C7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -39,6 +41,10 @@ Global {9B17B17E-1201-4B23-ACCD-EF7F4495E4B7}.Debug|Any CPU.Build.0 = Debug|Any CPU {9B17B17E-1201-4B23-ACCD-EF7F4495E4B7}.Release|Any CPU.ActiveCfg = Release|Any CPU {9B17B17E-1201-4B23-ACCD-EF7F4495E4B7}.Release|Any CPU.Build.0 = Release|Any CPU + {BA7E2CE6-7797-42C7-931C-40C48EA521C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA7E2CE6-7797-42C7-931C-40C48EA521C7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA7E2CE6-7797-42C7-931C-40C48EA521C7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA7E2CE6-7797-42C7-931C-40C48EA521C7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj b/PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj index ac9aa16..55fd7eb 100644 --- a/PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj +++ b/PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj @@ -15,6 +15,7 @@ + \ No newline at end of file diff --git a/PlumbingRepair/PlumbingRepair/Program.cs b/PlumbingRepair/PlumbingRepair/Program.cs index dd9d41f..106d4fb 100644 --- a/PlumbingRepair/PlumbingRepair/Program.cs +++ b/PlumbingRepair/PlumbingRepair/Program.cs @@ -1,6 +1,6 @@ using PlumbingRepairContracts.BusinessLogicsContracts; using PlumbingRepairContracts.StoragesContracts; -using PlumbingRepairListImplement.Implements; +using PlumbingRepairFileImplement.Implements; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; diff --git a/PlumbingRepair/PlumpingRepairFileImplement/DataFileSingleton.cs b/PlumbingRepair/PlumpingRepairFileImplement/DataFileSingleton.cs new file mode 100644 index 0000000..2f5e914 --- /dev/null +++ b/PlumbingRepair/PlumpingRepairFileImplement/DataFileSingleton.cs @@ -0,0 +1,56 @@ +using PlumbingRepairFileImplement.Models; +using System.Xml.Linq; + +namespace PlumbingRepairFileImplement +{ + public class DataFileSingleton + { + private static DataFileSingleton? instance; + + private readonly string ComponentFileName = "Component.xml"; + private readonly string OrderFileName = "Order.xml"; + private readonly string WorkFileName = "Work.xml"; + + public List Components { get; private set; } + public List Orders { get; private set; } + public List Works { get; private set; } + + public static DataFileSingleton GetInstance() + { + if (instance == null) + { + instance = new DataFileSingleton(); + } + return instance; + } + + public void SaveComponents() => SaveData(Components, ComponentFileName, "Components", x => x.GetXElement); + public void SaveWorks() => SaveData(Works, WorkFileName, "Works", x => x.GetXElement); + public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement); + + private DataFileSingleton() + { + Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!; + Works = LoadData(WorkFileName, "Work", x => Work.Create(x)!)!; + Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!; + } + + private static List? LoadData(string filename, string xmlNodeName, Func selectFunction) + { + if (File.Exists(filename)) + { + return XDocument.Load(filename)?.Root?.Elements(xmlNodeName)?.Select(selectFunction)?.ToList(); + } + + return new List(); + } + + private static void SaveData(List data, string filename, string xmlNodeName, Func selectFunction) + { + if (data != null) + { + new XDocument(new XElement(xmlNodeName, data.Select(selectFunction).ToArray())).Save(filename); + } + } + } +} \ No newline at end of file diff --git a/PlumbingRepair/PlumpingRepairFileImplement/Implements/ComponentStorage.cs b/PlumbingRepair/PlumpingRepairFileImplement/Implements/ComponentStorage.cs new file mode 100644 index 0000000..f742f99 --- /dev/null +++ b/PlumbingRepair/PlumpingRepairFileImplement/Implements/ComponentStorage.cs @@ -0,0 +1,89 @@ +using PlumbingRepairContracts.BindingModels; +using PlumbingRepairContracts.SearchModels; +using PlumbingRepairContracts.StoragesContracts; +using PlumbingRepairContracts.ViewModels; +using PlumbingRepairFileImplement.Models; + +namespace PlumbingRepairFileImplement.Implements +{ + public class ComponentStorage : IComponentStorage + { + private readonly DataFileSingleton source; + + public ComponentStorage() + { + source = DataFileSingleton.GetInstance(); + } + + public List GetFullList() + { + return source.Components.Select(x => x.GetViewModel).ToList(); + } + + public List GetFilteredList(ComponentSearchModel model) + { + if (string.IsNullOrEmpty(model.ComponentName)) + { + return new(); + } + + return source.Components.Where(x => x.ComponentName.Contains(model.ComponentName)).Select(x => x.GetViewModel).ToList(); + } + + public ComponentViewModel? GetElement(ComponentSearchModel model) + { + if (string.IsNullOrEmpty(model.ComponentName) && !model.Id.HasValue) + { + return null; + } + + return source.Components.FirstOrDefault(x => (!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName == model.ComponentName) || (model.Id.HasValue && x.Id == model.Id))?.GetViewModel; + } + + public ComponentViewModel? Insert(ComponentBindingModel model) + { + model.Id = source.Components.Count > 0 ? source.Components.Max(x => x.Id) + 1 : 1; + var newComponent = Component.Create(model); + + if (newComponent == null) + { + return null; + } + + source.Components.Add(newComponent); + source.SaveComponents(); + + return newComponent.GetViewModel; + } + + public ComponentViewModel? Update(ComponentBindingModel model) + { + var component = source.Components.FirstOrDefault(x => x.Id == model.Id); + + if (component == null) + { + return null; + } + + component.Update(model); + source.SaveComponents(); + + return component.GetViewModel; + } + + public ComponentViewModel? Delete(ComponentBindingModel model) + { + var element = source.Components.FirstOrDefault(x => x.Id == model.Id); + + if (element != null) + { + source.Components.Remove(element); + source.SaveComponents(); + + return element.GetViewModel; + } + + return null; + } + } +} diff --git a/PlumbingRepair/PlumpingRepairFileImplement/Implements/OrderStorage.cs b/PlumbingRepair/PlumpingRepairFileImplement/Implements/OrderStorage.cs new file mode 100644 index 0000000..5d1dc92 --- /dev/null +++ b/PlumbingRepair/PlumpingRepairFileImplement/Implements/OrderStorage.cs @@ -0,0 +1,89 @@ +using PlumbingRepairContracts.BindingModels; +using PlumbingRepairContracts.SearchModels; +using PlumbingRepairContracts.StoragesContracts; +using PlumbingRepairContracts.ViewModels; +using PlumbingRepairFileImplement.Models; + +namespace PlumbingRepairFileImplement.Implements +{ + public class OrderStorage : IOrderStorage + { + private readonly DataFileSingleton source; + + public OrderStorage() + { + source = DataFileSingleton.GetInstance(); + } + + public List GetFullList() + { + return source.Orders.Select(x => x.GetViewModel).ToList(); + } + + public List GetFilteredList(OrderSearchModel model) + { + if (!model.Id.HasValue) + { + return new(); + } + + return source.Orders.Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList(); + } + + public OrderViewModel? GetElement(OrderSearchModel model) + { + if (!model.Id.HasValue) + { + return null; + } + + return source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel; + } + + public OrderViewModel? Insert(OrderBindingModel model) + { + model.Id = source.Orders.Count > 0 ? source.Orders.Max(x => x.Id) + 1 : 1; + var newOrder = Order.Create(model); + + if (newOrder == null) + { + return null; + } + + source.Orders.Add(newOrder); + source.SaveOrders(); + + return newOrder.GetViewModel; + } + + public OrderViewModel? Update(OrderBindingModel model) + { + var order = source.Orders.FirstOrDefault(x => x.Id == model.Id); + + if (order == null) + { + return null; + } + + order.Update(model); + source.SaveOrders(); + + return order.GetViewModel; + } + + public OrderViewModel? Delete(OrderBindingModel model) + { + var element = source.Orders.FirstOrDefault(x => x.Id == model.Id); + + if (element != null) + { + source.Orders.Remove(element); + source.SaveOrders(); + + return element.GetViewModel; + } + + return null; + } + } +} diff --git a/PlumbingRepair/PlumpingRepairFileImplement/Implements/WorkStorage.cs b/PlumbingRepair/PlumpingRepairFileImplement/Implements/WorkStorage.cs new file mode 100644 index 0000000..21ad208 --- /dev/null +++ b/PlumbingRepair/PlumpingRepairFileImplement/Implements/WorkStorage.cs @@ -0,0 +1,89 @@ +using PlumbingRepairContracts.BindingModels; +using PlumbingRepairContracts.SearchModels; +using PlumbingRepairContracts.StoragesContracts; +using PlumbingRepairContracts.ViewModels; +using PlumbingRepairFileImplement.Models; + +namespace PlumbingRepairFileImplement.Implements +{ + public class WorkStorage : IWorkStorage + { + private readonly DataFileSingleton source; + + public WorkStorage() + { + source = DataFileSingleton.GetInstance(); + } + + public List GetFullList() + { + return source.Works.Select(x => x.GetViewModel).ToList(); + } + + public List GetFilteredList(WorkSearchModel model) + { + if (string.IsNullOrEmpty(model.WorkName)) + { + return new(); + } + + return source.Works.Where(x => x.WorkName.Contains(model.WorkName)).Select(x => x.GetViewModel).ToList(); + } + + public WorkViewModel? GetElement(WorkSearchModel model) + { + if (string.IsNullOrEmpty(model.WorkName) && !model.Id.HasValue) + { + return null; + } + + return source.Works.FirstOrDefault(x => (!string.IsNullOrEmpty(model.WorkName) && x.WorkName == model.WorkName) || (model.Id.HasValue && x.Id == model.Id))?.GetViewModel; + } + + public WorkViewModel? Insert(WorkBindingModel model) + { + model.Id = source.Works.Count > 0 ? source.Works.Max(x => x.Id) + 1 : 1; + var newWork = Work.Create(model); + + if (newWork == null) + { + return null; + } + + source.Works.Add(newWork); + source.SaveWorks(); + + return newWork.GetViewModel; + } + + public WorkViewModel? Update(WorkBindingModel model) + { + var work = source.Works.FirstOrDefault(x => x.Id == model.Id); + + if (work == null) + { + return null; + } + + work.Update(model); + source.SaveWorks(); + + return work.GetViewModel; + } + + public WorkViewModel? Delete(WorkBindingModel model) + { + var element = source.Works.FirstOrDefault(x => x.Id == model.Id); + + if (element != null) + { + source.Works.Remove(element); + source.SaveWorks(); + + return element.GetViewModel; + } + + return null; + } + } +} diff --git a/PlumbingRepair/PlumpingRepairFileImplement/Models/Component.cs b/PlumbingRepair/PlumpingRepairFileImplement/Models/Component.cs new file mode 100644 index 0000000..a9b833e --- /dev/null +++ b/PlumbingRepair/PlumpingRepairFileImplement/Models/Component.cs @@ -0,0 +1,64 @@ +using PlumbingRepairContracts.BindingModels; +using PlumbingRepairContracts.ViewModels; +using PlumbingRepairDataModels.Models; +using System.Xml.Linq; + +namespace PlumbingRepairFileImplement.Models +{ + public class Component : IComponentModel + { + public int Id { get; private set; } + public string ComponentName { get; private set; } = string.Empty; + public double Cost { get; set; } + + public static Component? Create(ComponentBindingModel model) + { + if (model == null) + { + return null; + } + return new Component() + { + Id = model.Id, + ComponentName = model.ComponentName, + Cost = model.Cost + }; + } + + public static Component? Create(XElement element) + { + if (element == null) + { + return null; + } + return new Component() + { + Id = Convert.ToInt32(element.Attribute("Id")!.Value), + ComponentName = element.Element("ComponentName")!.Value, + Cost = Convert.ToDouble(element.Element("Cost")!.Value) + }; + } + + public void Update(ComponentBindingModel model) + { + if (model == null) + { + return; + } + ComponentName = model.ComponentName; + Cost = model.Cost; + } + + public ComponentViewModel GetViewModel => new() + { + Id = Id, + ComponentName = ComponentName, + Cost = Cost + }; + + public XElement GetXElement => new("Component", + new XAttribute("Id", Id), + new XElement("ComponentName", ComponentName), + new XElement("Cost", Cost.ToString())); + } +} diff --git a/PlumbingRepair/PlumpingRepairFileImplement/Models/Order.cs b/PlumbingRepair/PlumpingRepairFileImplement/Models/Order.cs new file mode 100644 index 0000000..6dd1d40 --- /dev/null +++ b/PlumbingRepair/PlumpingRepairFileImplement/Models/Order.cs @@ -0,0 +1,100 @@ +using PlumbingRepairContracts.BindingModels; +using PlumbingRepairContracts.ViewModels; +using PlumbingRepairDataModels.Enums; +using PlumbingRepairDataModels.Models; +using System.Xml.Linq; + +namespace PlumbingRepairFileImplement.Models +{ + public class Order : IOrderModel + { + public int Id { get; private set; } + public int WorkId { get; private set; } + public string WorkName { get; private set; } = string.Empty; + public int Count { get; private set; } + public double Sum { get; private set; } + public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен; + public DateTime DateCreate { get; private set; } = DateTime.Now; + public DateTime? DateImplement { get; private set; } + + public static Order? Create(OrderBindingModel model) + { + if (model == null) + { + return null; + } + return new Order() + { + Id = model.Id, + WorkId = model.WorkId, + WorkName = model.WorkName, + Count = model.Count, + Sum = model.Sum, + Status = model.Status, + DateCreate = model.DateCreate, + DateImplement = model.DateImplement + }; + } + + public static Order? Create(XElement element) + { + if (element == null) + { + return null; + } + + var order = new Order() + { + Id = Convert.ToInt32(element.Attribute("Id")!.Value), + WorkId = Convert.ToInt32(element.Element("WorkId")!.Value), + WorkName = element.Element("WorkName")!.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 = DateTime.ParseExact(element.Element("DateCreate")!.Value, "G", null) + }; + + DateTime.TryParse(element.Element("DateImplement")!.Value, out DateTime dateImpl); + order.DateImplement = dateImpl; + + return order; + } + + public void Update(OrderBindingModel model) + { + if (model == null) + { + return; + } + WorkId = model.WorkId; + WorkName = model.WorkName; + Count = model.Count; + Sum = model.Sum; + Status = model.Status; + DateCreate = model.DateCreate; + DateImplement = model.DateImplement; + } + + public OrderViewModel GetViewModel => new() + { + Id = Id, + WorkId = WorkId, + WorkName = WorkName, + Count = Count, + Sum = Sum, + Status = Status, + DateCreate = DateCreate, + DateImplement = DateImplement + }; + + public XElement GetXElement => new("Order", + new XAttribute("Id", Id), + new XElement("WorkName", WorkName), + new XElement("WorkId", WorkId.ToString()), + new XElement("Count", Count.ToString()), + new XElement("Sum", Sum.ToString()), + new XElement("Status", Status.ToString()), + new XElement("DateCreate", DateCreate.ToString()), + new XElement("DateImplement", DateImplement.ToString())); + } +} diff --git a/PlumbingRepair/PlumpingRepairFileImplement/Models/Work.cs b/PlumbingRepair/PlumpingRepairFileImplement/Models/Work.cs new file mode 100644 index 0000000..8f24dd2 --- /dev/null +++ b/PlumbingRepair/PlumpingRepairFileImplement/Models/Work.cs @@ -0,0 +1,91 @@ +using PlumbingRepairContracts.BindingModels; +using PlumbingRepairContracts.ViewModels; +using PlumbingRepairDataModels.Models; +using System.Xml.Linq; + +namespace PlumbingRepairFileImplement.Models +{ + public class Work : IWorkModel + { + public int Id { get; private set; } + public string WorkName { get; private set; } = string.Empty; + public double Price { get; private set; } + + public Dictionary Components { get; private set; } = new(); + + public Dictionary _workComponents = null; + + public Dictionary WorkComponents + { + get + { + if (_workComponents == null) + { + var source = DataFileSingleton.GetInstance(); + _workComponents = Components.ToDictionary(x => x.Key, y => ((source.Components.FirstOrDefault(z => z.Id == y.Key) as IComponentModel)!, y.Value)); + } + return _workComponents; + } + } + + public static Work? Create(WorkBindingModel model) + { + if (model == null) + { + return null; + } + return new Work() + { + Id = model.Id, + WorkName = model.WorkName, + Price = model.Price, + Components = model.WorkComponents.ToDictionary(x => x.Key, x => x.Value.Item2) + + }; + } + + public static Work? Create(XElement element) + { + if (element == null) + { + return null; + } + return new Work() + { + Id = Convert.ToInt32(element.Attribute("Id")!.Value), + WorkName = element.Element("WorkName")!.Value, + Price = Convert.ToDouble(element.Element("Price")!.Value), + Components = element.Element("WorkComponents")!.Elements("WorkComponent").ToDictionary(x => Convert.ToInt32(x.Element("Key")?.Value), x => Convert.ToInt32(x.Element("Value")?.Value)) + }; + } + + public void Update(WorkBindingModel model) + { + if (model == null) + { + return; + } + WorkName = model.WorkName; + Price = model.Price; + Components = model.WorkComponents.ToDictionary(x => x.Key, x => x.Value.Item2); + _workComponents = null; + } + + public WorkViewModel GetViewModel => new() + { + Id = Id, + WorkName = WorkName, + Price = Price, + WorkComponents = WorkComponents + }; + + public XElement GetXElement => new("Work", + new XAttribute("Id", Id), + new XElement("WorkName", WorkName), + new XElement("Price", Price.ToString()), + new XElement("WorkComponents", Components.Select(x => + new XElement("WorkComponent", + new XElement("Key", x.Key), + new XElement("Value", x.Value))).ToArray())); + } +} diff --git a/PlumbingRepair/PlumpingRepairFileImplement/PlumbingRepairFileImplement.csproj b/PlumbingRepair/PlumpingRepairFileImplement/PlumbingRepairFileImplement.csproj new file mode 100644 index 0000000..05f8377 --- /dev/null +++ b/PlumbingRepair/PlumpingRepairFileImplement/PlumbingRepairFileImplement.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + -- 2.25.1 From b7a64957f7914e4628effdfce3efa6bb76a94335 Mon Sep 17 00:00:00 2001 From: "ityurner02@mail.ru" Date: Tue, 21 Feb 2023 12:22:35 +0400 Subject: [PATCH 2/2] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=84=D0=BE=D1=80=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlumbingRepair/FormComponents.Designer.cs | 30 +++++---- .../PlumbingRepair/FormComponents.resx | 62 +------------------ .../PlumbingRepair/FormMain.Designer.cs | 1 + .../PlumbingRepair/FormWorks.Designer.cs | 30 +++++---- PlumbingRepair/PlumbingRepair/FormWorks.resx | 62 +------------------ 5 files changed, 41 insertions(+), 144 deletions(-) diff --git a/PlumbingRepair/PlumbingRepair/FormComponents.Designer.cs b/PlumbingRepair/PlumbingRepair/FormComponents.Designer.cs index 5d5f0b0..f4a6e58 100644 --- a/PlumbingRepair/PlumbingRepair/FormComponents.Designer.cs +++ b/PlumbingRepair/PlumbingRepair/FormComponents.Designer.cs @@ -40,16 +40,19 @@ // this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.DataGridView.Location = new System.Drawing.Point(2, 0); + this.DataGridView.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.DataGridView.Name = "DataGridView"; + this.DataGridView.RowHeadersWidth = 51; this.DataGridView.RowTemplate.Height = 25; - this.DataGridView.Size = new System.Drawing.Size(551, 551); + this.DataGridView.Size = new System.Drawing.Size(630, 735); this.DataGridView.TabIndex = 0; // // AddButton // - this.AddButton.Location = new System.Drawing.Point(571, 26); + this.AddButton.Location = new System.Drawing.Point(653, 35); + this.AddButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.AddButton.Name = "AddButton"; - this.AddButton.Size = new System.Drawing.Size(142, 45); + this.AddButton.Size = new System.Drawing.Size(162, 60); this.AddButton.TabIndex = 1; this.AddButton.Text = "Добавить"; this.AddButton.UseVisualStyleBackColor = true; @@ -57,9 +60,10 @@ // // ChangeButton // - this.ChangeButton.Location = new System.Drawing.Point(571, 93); + this.ChangeButton.Location = new System.Drawing.Point(653, 124); + this.ChangeButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.ChangeButton.Name = "ChangeButton"; - this.ChangeButton.Size = new System.Drawing.Size(142, 45); + this.ChangeButton.Size = new System.Drawing.Size(162, 60); this.ChangeButton.TabIndex = 2; this.ChangeButton.Text = "Изменить"; this.ChangeButton.UseVisualStyleBackColor = true; @@ -67,9 +71,10 @@ // // DeleteButton // - this.DeleteButton.Location = new System.Drawing.Point(571, 162); + this.DeleteButton.Location = new System.Drawing.Point(653, 216); + this.DeleteButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.DeleteButton.Name = "DeleteButton"; - this.DeleteButton.Size = new System.Drawing.Size(142, 45); + this.DeleteButton.Size = new System.Drawing.Size(162, 60); this.DeleteButton.TabIndex = 3; this.DeleteButton.Text = "Удалить"; this.DeleteButton.UseVisualStyleBackColor = true; @@ -77,9 +82,10 @@ // // UpdateButton // - this.UpdateButton.Location = new System.Drawing.Point(571, 230); + this.UpdateButton.Location = new System.Drawing.Point(653, 307); + this.UpdateButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.UpdateButton.Name = "UpdateButton"; - this.UpdateButton.Size = new System.Drawing.Size(142, 45); + this.UpdateButton.Size = new System.Drawing.Size(162, 60); this.UpdateButton.TabIndex = 4; this.UpdateButton.Text = "Обновить"; this.UpdateButton.UseVisualStyleBackColor = true; @@ -87,16 +93,18 @@ // // FormComponents // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(725, 552); + this.ClientSize = new System.Drawing.Size(829, 736); this.Controls.Add(this.UpdateButton); this.Controls.Add(this.DeleteButton); this.Controls.Add(this.ChangeButton); this.Controls.Add(this.AddButton); this.Controls.Add(this.DataGridView); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "FormComponents"; this.Text = "Компоненты"; + this.Load += new System.EventHandler(this.FormComponents_Load); ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); this.ResumeLayout(false); diff --git a/PlumbingRepair/PlumbingRepair/FormComponents.resx b/PlumbingRepair/PlumbingRepair/FormComponents.resx index 1af7de1..f298a7b 100644 --- a/PlumbingRepair/PlumbingRepair/FormComponents.resx +++ b/PlumbingRepair/PlumbingRepair/FormComponents.resx @@ -1,64 +1,4 @@ - - - + diff --git a/PlumbingRepair/PlumbingRepair/FormMain.Designer.cs b/PlumbingRepair/PlumbingRepair/FormMain.Designer.cs index 495612f..3812a8c 100644 --- a/PlumbingRepair/PlumbingRepair/FormMain.Designer.cs +++ b/PlumbingRepair/PlumbingRepair/FormMain.Designer.cs @@ -159,6 +159,7 @@ this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "FormMain"; this.Text = "Ремонт сантехники"; + this.Load += new System.EventHandler(this.FormMain_Load); this.MenuStrip.ResumeLayout(false); this.MenuStrip.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); diff --git a/PlumbingRepair/PlumbingRepair/FormWorks.Designer.cs b/PlumbingRepair/PlumbingRepair/FormWorks.Designer.cs index 882dac0..e966303 100644 --- a/PlumbingRepair/PlumbingRepair/FormWorks.Designer.cs +++ b/PlumbingRepair/PlumbingRepair/FormWorks.Designer.cs @@ -40,16 +40,19 @@ // this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.DataGridView.Location = new System.Drawing.Point(1, 1); + this.DataGridView.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.DataGridView.Name = "DataGridView"; + this.DataGridView.RowHeadersWidth = 51; this.DataGridView.RowTemplate.Height = 25; - this.DataGridView.Size = new System.Drawing.Size(562, 495); + this.DataGridView.Size = new System.Drawing.Size(642, 660); this.DataGridView.TabIndex = 0; // // AddButton // - this.AddButton.Location = new System.Drawing.Point(585, 12); + this.AddButton.Location = new System.Drawing.Point(669, 16); + this.AddButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.AddButton.Name = "AddButton"; - this.AddButton.Size = new System.Drawing.Size(120, 41); + this.AddButton.Size = new System.Drawing.Size(137, 55); this.AddButton.TabIndex = 1; this.AddButton.Text = "Добавить"; this.AddButton.UseVisualStyleBackColor = true; @@ -57,9 +60,10 @@ // // ChangeButton // - this.ChangeButton.Location = new System.Drawing.Point(585, 71); + this.ChangeButton.Location = new System.Drawing.Point(669, 95); + this.ChangeButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.ChangeButton.Name = "ChangeButton"; - this.ChangeButton.Size = new System.Drawing.Size(120, 41); + this.ChangeButton.Size = new System.Drawing.Size(137, 55); this.ChangeButton.TabIndex = 2; this.ChangeButton.Text = "Изменить"; this.ChangeButton.UseVisualStyleBackColor = true; @@ -67,9 +71,10 @@ // // DeleteButton // - this.DeleteButton.Location = new System.Drawing.Point(585, 130); + this.DeleteButton.Location = new System.Drawing.Point(669, 173); + this.DeleteButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.DeleteButton.Name = "DeleteButton"; - this.DeleteButton.Size = new System.Drawing.Size(120, 41); + this.DeleteButton.Size = new System.Drawing.Size(137, 55); this.DeleteButton.TabIndex = 3; this.DeleteButton.Text = "Удалить"; this.DeleteButton.UseVisualStyleBackColor = true; @@ -77,9 +82,10 @@ // // UpdateButton // - this.UpdateButton.Location = new System.Drawing.Point(585, 191); + this.UpdateButton.Location = new System.Drawing.Point(669, 255); + this.UpdateButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.UpdateButton.Name = "UpdateButton"; - this.UpdateButton.Size = new System.Drawing.Size(120, 41); + this.UpdateButton.Size = new System.Drawing.Size(137, 55); this.UpdateButton.TabIndex = 4; this.UpdateButton.Text = "Обновить"; this.UpdateButton.UseVisualStyleBackColor = true; @@ -87,16 +93,18 @@ // // FormWorks // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(717, 502); + this.ClientSize = new System.Drawing.Size(819, 669); this.Controls.Add(this.UpdateButton); this.Controls.Add(this.DeleteButton); this.Controls.Add(this.ChangeButton); this.Controls.Add(this.AddButton); this.Controls.Add(this.DataGridView); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "FormWorks"; this.Text = "Изделия"; + this.Load += new System.EventHandler(this.FormComponents_Load); ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); this.ResumeLayout(false); diff --git a/PlumbingRepair/PlumbingRepair/FormWorks.resx b/PlumbingRepair/PlumbingRepair/FormWorks.resx index 1af7de1..f298a7b 100644 --- a/PlumbingRepair/PlumbingRepair/FormWorks.resx +++ b/PlumbingRepair/PlumbingRepair/FormWorks.resx @@ -1,64 +1,4 @@ - - - + -- 2.25.1