From 1f669bf1cc5730cc697061c78d9e9cc73d9cec68 Mon Sep 17 00:00:00 2001 From: Shtyrkin_Egor Date: Mon, 11 Nov 2024 09:51:19 +0400 Subject: [PATCH] Lab1 Commit1 --- .../FurnitureCompany/FurnitureCompany.sln | 25 ++++ .../FurnitureCompany/Entities/Client.cs | 23 ++++ .../FurnitureCompany/Entities/Delivery.cs | 26 ++++ .../Entities/Enums/DeliveryStatus.cs | 16 +++ .../Entities/Enums/MasterExperience.cs | 18 +++ .../FurnitureCompany/Entities/Invoice.cs | 14 ++ .../FurnitureCompany/Entities/InvoiceItem.cs | 12 ++ .../FurnitureCompany/Entities/Master.cs | 27 ++++ .../FurnitureCompany/Entities/Product.cs | 32 +++++ .../FurnitureCompany/Form1.Designer.cs | 39 ++++++ .../FurnitureCompany/Form1.cs | 10 ++ .../FurnitureCompany/Form1.resx | 120 ++++++++++++++++++ .../FurnitureCompany/FurnitureCompany.csproj | 11 ++ .../FurnitureCompany/Program.cs | 17 +++ 14 files changed, 390 insertions(+) create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany.sln create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Client.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Delivery.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Enums/DeliveryStatus.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Enums/MasterExperience.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Invoice.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/InvoiceItem.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Master.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Product.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.Designer.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.cs create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.resx create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/FurnitureCompany.csproj create mode 100644 FurnitureCompany/FurnitureCompany/FurnitureCompany/Program.cs diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany.sln b/FurnitureCompany/FurnitureCompany/FurnitureCompany.sln new file mode 100644 index 0000000..614b9ce --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34616.47 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FurnitureCompany", "FurnitureCompany\FurnitureCompany.csproj", "{BEE45E7E-032A-4AAC-BF56-56E9369F739E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BEE45E7E-032A-4AAC-BF56-56E9369F739E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BEE45E7E-032A-4AAC-BF56-56E9369F739E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BEE45E7E-032A-4AAC-BF56-56E9369F739E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BEE45E7E-032A-4AAC-BF56-56E9369F739E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9075CBB6-ABF1-4808-9ADF-0681C74036A3} + EndGlobalSection +EndGlobal diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Client.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Client.cs new file mode 100644 index 0000000..07ba0ff --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Client.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureCompany.Entities; + +public class Client +{ + public int Id { get; private set; } + + public string Name { get; private set; } = string.Empty; + + public static Client CreateClient(int id, string name) + { + return new Client + { + Id = id, + Name = name + }; + } +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Delivery.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Delivery.cs new file mode 100644 index 0000000..aff57ac --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Delivery.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureCompany.Entities; + +public class Delivery +{ + public int Id { get; private set; } + + public string Info { get; private set; } = string.Empty; + + public DateTime Date { get; private set; } + + public static Delivery CreateDelivery(int id, string info) + { + return new Delivery + { + Id = id, + Info = info, + Date = DateTime.Now, + }; + } +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Enums/DeliveryStatus.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Enums/DeliveryStatus.cs new file mode 100644 index 0000000..bb67d6a --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Enums/DeliveryStatus.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureCompany.Entities.Enums; + +public enum DeliveryStatus +{ + None = 0, + + Paid = 1, + + NotPaid = 2, +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Enums/MasterExperience.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Enums/MasterExperience.cs new file mode 100644 index 0000000..6ada576 --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Enums/MasterExperience.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureCompany.Entities.Enums; + +public enum MasterExperience +{ + None = 0, + + Beginning = 1, + + Ordinary = 2, + + Experienced = 3 +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Invoice.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Invoice.cs new file mode 100644 index 0000000..e8414c5 --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Invoice.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureCompany.Entities; + +public class Invoice +{ + public int Id { get; private set; } + + +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/InvoiceItem.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/InvoiceItem.cs new file mode 100644 index 0000000..3eaf520 --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/InvoiceItem.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureCompany.Entities; + +public class InvoiceItem +{ + +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Master.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Master.cs new file mode 100644 index 0000000..27ee25b --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Master.cs @@ -0,0 +1,27 @@ +using FurnitureCompany.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureCompany.Entities; + +public class Master +{ + public int Id { get; private set; } + + public string Surname { get; private set; } = string.Empty; + + public MasterExperience Experience { get; private set; } + + public static Master CreateMaster(int id, string surname, MasterExperience experience) + { + return new Master + { + Id = id, + Surname = surname ?? string.Empty, + Experience = experience + }; + } +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Product.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Product.cs new file mode 100644 index 0000000..708c59c --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Entities/Product.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureCompany.Entities; + +public class Product +{ + public int Id { get; private set; } + + public string Name { get; private set; } = string.Empty; + + public double CostPrise { get; private set; } + + public double SellingPrice { get; private set; } + + public int MasterID { get; private set; } + + public static Product CreateProduct(int id, string name, double costPrice, double sellingPrice, int masterId) + { + return new Product + { + Id = id, + Name = name, + CostPrise = costPrice, + SellingPrice = sellingPrice, + MasterID = masterId + }; + } +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.Designer.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.Designer.cs new file mode 100644 index 0000000..58f533a --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.Designer.cs @@ -0,0 +1,39 @@ +namespace FurnitureCompany +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.cs new file mode 100644 index 0000000..223c63b --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.cs @@ -0,0 +1,10 @@ +namespace FurnitureCompany +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + } +} diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.resx b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/FurnitureCompany.csproj b/FurnitureCompany/FurnitureCompany/FurnitureCompany/FurnitureCompany.csproj new file mode 100644 index 0000000..663fdb8 --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/FurnitureCompany.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net8.0-windows + enable + true + enable + + + \ No newline at end of file diff --git a/FurnitureCompany/FurnitureCompany/FurnitureCompany/Program.cs b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Program.cs new file mode 100644 index 0000000..c460ded --- /dev/null +++ b/FurnitureCompany/FurnitureCompany/FurnitureCompany/Program.cs @@ -0,0 +1,17 @@ +namespace FurnitureCompany +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } + } +} \ No newline at end of file