From 1460aa71c67b910e4441830e7892ee02a2c1ccb9 Mon Sep 17 00:00:00 2001 From: Anitonchik Date: Fri, 1 Nov 2024 13:03:57 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=83=D1=89=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Client.cs | 30 ++++++++++++++++ .../Entities/Enums/ClientType.cs | 26 ++++++++++++++ .../Entities/Enums/Movement.cs | 34 ++++++++++++++++++ .../Entities/Invoice.cs | 36 +++++++++++++++++++ .../Entities/InvoiceProduct.cs | 26 ++++++++++++++ .../Entities/Manufacturer.cs | 23 ++++++++++++ .../Entities/ProductMovement.cs | 27 ++++++++++++++ 7 files changed, 202 insertions(+) create mode 100644 ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Client.cs create mode 100644 ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Enums/ClientType.cs create mode 100644 ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Enums/Movement.cs create mode 100644 ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Invoice.cs create mode 100644 ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/InvoiceProduct.cs create mode 100644 ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Manufacturer.cs create mode 100644 ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/ProductMovement.cs diff --git a/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Client.cs b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Client.cs new file mode 100644 index 0000000..33b7f98 --- /dev/null +++ b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Client.cs @@ -0,0 +1,30 @@ +using ProjectCompanyFurniture.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompanyFurniture.Entities; + +public class Client +{ + public int ID { get; private set; } + + public string Name { get; private set; } + + public ClientType ClientType { get; private set; } + + public bool Optovik { get; private set; } + + public static Client CreateClient(int id, string name, ClientType clientType, bool optovik) + { + return new Client + { + ID = id, + Name = name, + ClientType = clientType, + Optovik = optovik + }; + } +} diff --git a/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Enums/ClientType.cs b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Enums/ClientType.cs new file mode 100644 index 0000000..92c857d --- /dev/null +++ b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Enums/ClientType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompanyFurniture.Entities.Enums; + +[Flags] +public enum ClientType +{ + None = 0, + /// + /// частное лицо + /// + PrivatePerson = 1, + /// + /// предприниматель + /// + Entrepreneur = 2, + /// + /// организация + /// + Organization = 4 + +} diff --git a/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Enums/Movement.cs b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Enums/Movement.cs new file mode 100644 index 0000000..a010820 --- /dev/null +++ b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Enums/Movement.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompanyFurniture.Entities.Enums; + +public enum Movement +{ + None = 0, + /// + /// проступление + /// + Reseipt = 1, + /// + /// продажа + /// + Sale = 2, + /// + /// перемещение на склад + /// + MovingToWarehouse = 3, + + /// + /// подготовка к отправке + /// + PreparationForShipment = 4, + /// + /// перемещение в магазин + /// + MovingToStore = 5, + +} diff --git a/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Invoice.cs b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Invoice.cs new file mode 100644 index 0000000..a598aaf --- /dev/null +++ b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Invoice.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompanyFurniture.Entities; + +public class Invoice +{ + public int ID { get; private set; } + + public int ClientID { get; set; } + + public int AvailabilityOfPromotionalCode { get; set; } + + public int DiscountPercentage { get; set; } + + public int SellingPrice { get; set; } + + DateTime Data { get; set; } + + public static Invoice CreateInvoice(int id, int clientId, int availabilityOfPromotionalCode, int discountPercentage, + int sellingPrice, DateTime data) + { + return new Invoice + { + ID = id, + ClientID = clientId, + AvailabilityOfPromotionalCode = availabilityOfPromotionalCode, + DiscountPercentage = discountPercentage, + SellingPrice = sellingPrice, + Data = data + }; + } +} diff --git a/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/InvoiceProduct.cs b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/InvoiceProduct.cs new file mode 100644 index 0000000..39f2ac4 --- /dev/null +++ b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/InvoiceProduct.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompanyFurniture; + +public class InvoiceProduct +{ + public int InvoiceID { get; private set; } + + public int ProductID { get; private set; } + + public int Count { get; private set; } + + public static InvoiceProduct CreateInvoiceProduct(int invoiceId, int productID, int count) + { + return new InvoiceProduct + { + InvoiceID = invoiceId, + ProductID = productID, + Count = count + }; + } +} diff --git a/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Manufacturer.cs b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Manufacturer.cs new file mode 100644 index 0000000..995e3ee --- /dev/null +++ b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/Manufacturer.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompanyFurniture.Entities; + +public class Manufacturer +{ + public int ID { get; set; } + + public string Name { get; set; } + + public static Manufacturer CreateManufacturer(int iD, string name) + { + return new Manufacturer + { + ID = iD, + Name = name + }; + } +} diff --git a/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/ProductMovement.cs b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/ProductMovement.cs new file mode 100644 index 0000000..5628b14 --- /dev/null +++ b/ProjectCompanyFurniture/ProjectCompanyFurniture/Entities/ProductMovement.cs @@ -0,0 +1,27 @@ +using ProjectCompanyFurniture.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompanyFurniture.Entities; + +public class ProductMovement +{ + public int ID { get; private set; } + + public int ProductID { get; private set; } + + public Movement MovementProduct { get; private set; } + + public ProductMovement CreateProductMovement (int it, int productId, Movement movement) + { + return new ProductMovement + { + ID = it, + ProductID = productId, + MovementProduct = movement + }; + } +}