diff --git a/ShoeStore/ShoeStore/Entities/Enums/Manufacturer.cs b/ShoeStore/ShoeStore/Entities/Enums/Manufacturer.cs new file mode 100644 index 0000000..b17c445 --- /dev/null +++ b/ShoeStore/ShoeStore/Entities/Enums/Manufacturer.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Entities.Enums +{ + public enum Manufacturer + { + None = 0, + + China = 1, + + USA = 2, + + Russia = 3 + } +} diff --git a/ShoeStore/ShoeStore/Entities/Enums/ShoesType.cs b/ShoeStore/ShoeStore/Entities/Enums/ShoesType.cs new file mode 100644 index 0000000..894252f --- /dev/null +++ b/ShoeStore/ShoeStore/Entities/Enums/ShoesType.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Entities.Enums +{ + [Flags] + public enum ShoesType + { + None = 0, + Classic_Shoe = 1, + Sneakers = 2, + HighHeelShoes = 4, + Sandals = 8 + } +} diff --git a/ShoeStore/ShoeStore/Entities/Factory.cs b/ShoeStore/ShoeStore/Entities/Factory.cs new file mode 100644 index 0000000..fe664b5 --- /dev/null +++ b/ShoeStore/ShoeStore/Entities/Factory.cs @@ -0,0 +1,27 @@ +using ShoeStore.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Entities; + +public class Factory +{ + public int Id { get; private set; } + public string FactoryName { get; private set; } = string.Empty; + public string LastName { get; private set; } = string.Empty; + public Manufacturer Manufacturer { get; private set; } + public static Factory CreateEntity(int id, string factoryName, string last, + Manufacturer manufacturer) + { + return new Factory + { + Id = id, + FactoryName = factoryName ?? string.Empty, + LastName = last ?? string.Empty, + Manufacturer = manufacturer + }; + } +} diff --git a/ShoeStore/ShoeStore/Entities/Shoes.cs b/ShoeStore/ShoeStore/Entities/Shoes.cs new file mode 100644 index 0000000..459b2ac --- /dev/null +++ b/ShoeStore/ShoeStore/Entities/Shoes.cs @@ -0,0 +1,23 @@ +using ShoeStore.Entities.Enums; + +namespace ShoeStore.Entities; + +public class Shoes +{ + public int Id { get; private set; } + public ShoesType ShoesType { get; private set; } /*= ShoesType.Classic_Shoe | ShoesType.Sandals;*/ + public string Name { get; private set; } = string.Empty; + public string Description { get; private set; } = string.Empty; + + public static Shoes CreateEntity(int id, ShoesType shoesType, string name, string description) + { + return new Shoes + { + Id = id, + ShoesType = shoesType, + Name = name, + Description = description + }; + } +} + diff --git a/ShoeStore/ShoeStore/Entities/ShoesReplenishment.cs b/ShoeStore/ShoeStore/Entities/ShoesReplenishment.cs new file mode 100644 index 0000000..2b757ab --- /dev/null +++ b/ShoeStore/ShoeStore/Entities/ShoesReplenishment.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Entities; + +public class ShoesReplenishment +{ + public int Id { get; private set; } + public int FactoryId { get; private set; } + public DateTime DateReceipt { get; private set; } + public IEnumerable ShoesShoesReplenishment + { + get; + private set; + } = []; + public static ShoesReplenishment CreateOpeartion(int id, int factoryId, + IEnumerable shoesShoesReplenishment) + { + return new ShoesReplenishment + { + Id = id, + FactoryId = factoryId, + DateReceipt = DateTime.Now, + ShoesShoesReplenishment = shoesShoesReplenishment + }; + } +} diff --git a/ShoeStore/ShoeStore/Entities/ShoesSale.cs b/ShoeStore/ShoeStore/Entities/ShoesSale.cs new file mode 100644 index 0000000..8a9f725 --- /dev/null +++ b/ShoeStore/ShoeStore/Entities/ShoesSale.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Entities; + +public class ShoesSale +{ + public int Id { get; private set; } + public int ShoesId { get; private set; } + public int FactoryId { get; private set; } + public int StoreId { get; private set; } + public DateTime SaleDate { get; private set; } + public int Specificity { get; private set; } + public static ShoesSale CreateOpeartion(int id, int shoesId, int + factoryId, int storeId, int specificity) + { + return new ShoesSale + { + Id = id, + ShoesId = shoesId, + FactoryId = factoryId, + StoreId = storeId, + SaleDate = DateTime.Now, + Specificity = specificity + }; + } +} diff --git a/ShoeStore/ShoeStore/Entities/ShoesShoesReplenishment.cs b/ShoeStore/ShoeStore/Entities/ShoesShoesReplenishment.cs new file mode 100644 index 0000000..15f2b92 --- /dev/null +++ b/ShoeStore/ShoeStore/Entities/ShoesShoesReplenishment.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Entities; + +public class ShoesShoesReplenishment +{ + public int Id { get; private set; } + public int ShoesId { get; private set; } + public int Count { get; private set; } + public static ShoesShoesReplenishment CreateElement(int id, int shoesId, int + count) + { + return new ShoesShoesReplenishment + { + Id = id, + ShoesId = shoesId, + Count = count + }; + } +} diff --git a/ShoeStore/ShoeStore/Entities/Store.cs b/ShoeStore/ShoeStore/Entities/Store.cs new file mode 100644 index 0000000..829191b --- /dev/null +++ b/ShoeStore/ShoeStore/Entities/Store.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Entities; + +public class Store +{ + public int Id { get; private set; } + public string StoreType { get; private set; } = string.Empty; + public string StoreName { get; private set; } = string.Empty; + public int Employees { get; private set; } + public double Visitors { get; private set; } + public static Store CreateEntity(int id, string StoreType, string + StoreName, int employees, double visitors) + { + return new Store + { + Id = id, + StoreType = StoreType ?? string.Empty, + StoreName = StoreName ?? string.Empty, + Employees = employees, + Visitors = visitors + }; + } + +} diff --git a/ShoeStore/ShoeStore/FormStorage.Designer.cs b/ShoeStore/ShoeStore/FormStorage.Designer.cs new file mode 100644 index 0000000..df3790d --- /dev/null +++ b/ShoeStore/ShoeStore/FormStorage.Designer.cs @@ -0,0 +1,132 @@ +namespace ShoeStore +{ + partial class FormStorage + { + /// + /// 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() + { + menuStrip1 = new MenuStrip(); + справочникиToolStripMenuItem = new ToolStripMenuItem(); + фабрикиToolStripMenuItem = new ToolStripMenuItem(); + магазиныToolStripMenuItem = new ToolStripMenuItem(); + обувьToolStripMenuItem = new ToolStripMenuItem(); + операцииToolStripMenuItem = new ToolStripMenuItem(); + продажаОбувиToolStripMenuItem = new ToolStripMenuItem(); + закупкаОбувиToolStripMenuItem = new ToolStripMenuItem(); + отчетыToolStripMenuItem = new ToolStripMenuItem(); + menuStrip1.SuspendLayout(); + SuspendLayout(); + // + // menuStrip1 + // + menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчетыToolStripMenuItem }); + menuStrip1.Location = new Point(0, 0); + menuStrip1.Name = "menuStrip1"; + menuStrip1.Size = new Size(784, 24); + menuStrip1.TabIndex = 0; + menuStrip1.Text = "menuStrip1"; + // + // справочникиToolStripMenuItem + // + справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { фабрикиToolStripMenuItem, магазиныToolStripMenuItem, обувьToolStripMenuItem }); + справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; + справочникиToolStripMenuItem.Size = new Size(94, 20); + справочникиToolStripMenuItem.Text = "Справочники"; + // + // фабрикиToolStripMenuItem + // + фабрикиToolStripMenuItem.Name = "фабрикиToolStripMenuItem"; + фабрикиToolStripMenuItem.Size = new Size(130, 22); + фабрикиToolStripMenuItem.Text = "Фабрики"; + // + // магазиныToolStripMenuItem + // + магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; + магазиныToolStripMenuItem.Size = new Size(130, 22); + магазиныToolStripMenuItem.Text = "Магазины"; + // + // обувьToolStripMenuItem + // + обувьToolStripMenuItem.Name = "обувьToolStripMenuItem"; + обувьToolStripMenuItem.Size = new Size(130, 22); + обувьToolStripMenuItem.Text = "Обувь"; + // + // операцииToolStripMenuItem + // + операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { продажаОбувиToolStripMenuItem, закупкаОбувиToolStripMenuItem }); + операцииToolStripMenuItem.Name = "операцииToolStripMenuItem"; + операцииToolStripMenuItem.Size = new Size(75, 20); + операцииToolStripMenuItem.Text = "Операции"; + // + // продажаОбувиToolStripMenuItem + // + продажаОбувиToolStripMenuItem.Name = "продажаОбувиToolStripMenuItem"; + продажаОбувиToolStripMenuItem.Size = new Size(160, 22); + продажаОбувиToolStripMenuItem.Text = "Продажа обуви"; + // + // закупкаОбувиToolStripMenuItem + // + закупкаОбувиToolStripMenuItem.Name = "закупкаОбувиToolStripMenuItem"; + закупкаОбувиToolStripMenuItem.Size = new Size(160, 22); + закупкаОбувиToolStripMenuItem.Text = "Закупка обуви"; + // + // отчетыToolStripMenuItem + // + отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; + отчетыToolStripMenuItem.Size = new Size(60, 20); + отчетыToolStripMenuItem.Text = "Отчеты"; + // + // FormStorage + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + BackgroundImage = Properties.Resources.fb3882d00f3138e7a504134cff73630f; + BackgroundImageLayout = ImageLayout.Stretch; + ClientSize = new Size(784, 411); + Controls.Add(menuStrip1); + MainMenuStrip = menuStrip1; + Name = "FormStorage"; + StartPosition = FormStartPosition.CenterScreen; + Text = "Склад"; + menuStrip1.ResumeLayout(false); + menuStrip1.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private MenuStrip menuStrip1; + private ToolStripMenuItem справочникиToolStripMenuItem; + private ToolStripMenuItem фабрикиToolStripMenuItem; + private ToolStripMenuItem магазиныToolStripMenuItem; + private ToolStripMenuItem обувьToolStripMenuItem; + private ToolStripMenuItem операцииToolStripMenuItem; + private ToolStripMenuItem продажаОбувиToolStripMenuItem; + private ToolStripMenuItem закупкаОбувиToolStripMenuItem; + private ToolStripMenuItem отчетыToolStripMenuItem; + } +} diff --git a/ShoeStore/ShoeStore/Form1.cs b/ShoeStore/ShoeStore/FormStorage.cs similarity index 55% rename from ShoeStore/ShoeStore/Form1.cs rename to ShoeStore/ShoeStore/FormStorage.cs index 98ad686..a177f76 100644 --- a/ShoeStore/ShoeStore/Form1.cs +++ b/ShoeStore/ShoeStore/FormStorage.cs @@ -1,8 +1,8 @@ namespace ShoeStore { - public partial class Form1 : Form + public partial class FormStorage : Form { - public Form1() + public FormStorage() { InitializeComponent(); } diff --git a/ShoeStore/ShoeStore/FormStorage.resx b/ShoeStore/ShoeStore/FormStorage.resx new file mode 100644 index 0000000..a0623c8 --- /dev/null +++ b/ShoeStore/ShoeStore/FormStorage.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/ShoeStore/ShoeStore/Form1.Designer.cs b/ShoeStore/ShoeStore/Forms/FormStore.Designer.cs similarity index 52% rename from ShoeStore/ShoeStore/Form1.Designer.cs rename to ShoeStore/ShoeStore/Forms/FormStore.Designer.cs index a3a9828..8c20130 100644 --- a/ShoeStore/ShoeStore/Form1.Designer.cs +++ b/ShoeStore/ShoeStore/Forms/FormStore.Designer.cs @@ -1,14 +1,14 @@ -namespace ShoeStore +namespace ShoeStore.Forms { - partial class Form1 + partial class FormStore { /// - /// Required designer variable. + /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// - /// Clean up any resources being used. + /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) @@ -23,17 +23,24 @@ #region Windows Form Designer generated code /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. + /// 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"; + SuspendLayout(); + // + // FormStore + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Name = "FormStore"; + Text = "FormStore"; + Load += FormStore_Load; + ResumeLayout(false); } #endregion } -} +} \ No newline at end of file diff --git a/ShoeStore/ShoeStore/Forms/FormStore.cs b/ShoeStore/ShoeStore/Forms/FormStore.cs new file mode 100644 index 0000000..0ef8f3a --- /dev/null +++ b/ShoeStore/ShoeStore/Forms/FormStore.cs @@ -0,0 +1,87 @@ +using ShoeStore.Forms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShoeStore.Forms +{ + public partial class FormStore : Form + { + private readonly IStoreRepository _storeRepository; + private int? _storeId; + public int Id + { + set + { + try + { + var store = + _storeRepository.ReadStoreById(value); + if (store == null) + { + + + + throw new InvalidDataException(nameof(store)); + } + textBoxAnimalSpecies.Text = store.AnimalSpecies; + textBoxAnimalNickName.Text = + store.AnimalNickName; + numericUpDownAge.Value = store.Age; + numericUpDownWeight.Value = + (decimal)store.Weight; + _storeId = value; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + } + public FormAnimal(IAnimalRepository storeRepository) + { + InitializeComponent(); + _storeRepository = storeRepository ?? + throw new + ArgumentNullException(nameof(storeRepository)); + } + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrWhiteSpace(textBoxAnimalSpecies.Text) || string.IsNullOrWhiteSpace(textBoxAnimalNickName.Text)) + { + throw new Exception("Имеются незаполненные поля"); + } + if (_storeId.HasValue) + { + _storeRepository.UpdateAnimal(CreateAnimal(_storeId.Value)); + } + else + { + _storeRepository.CreateAnimal(CreateAnimal(0)); + } + Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void ButtonCancel_Click(object sender, EventArgs e) => + Close(); + private Animal CreateAnimal(int id) => Animal.CreateEntity(id, + textBoxAnimalSpecies.Text, + textBoxAnimalNickName.Text, + Convert.ToInt32(numericUpDownAge.Value), + Convert.ToDouble(numericUpDownWeight.Value)); + } +} diff --git a/ShoeStore/ShoeStore/Form1.resx b/ShoeStore/ShoeStore/Forms/FormStore.resx similarity index 93% rename from ShoeStore/ShoeStore/Form1.resx rename to ShoeStore/ShoeStore/Forms/FormStore.resx index 1af7de1..af32865 100644 --- a/ShoeStore/ShoeStore/Form1.resx +++ b/ShoeStore/ShoeStore/Forms/FormStore.resx @@ -1,17 +1,17 @@  - diff --git a/ShoeStore/ShoeStore/Program.cs b/ShoeStore/ShoeStore/Program.cs index 408d118..fc14c3f 100644 --- a/ShoeStore/ShoeStore/Program.cs +++ b/ShoeStore/ShoeStore/Program.cs @@ -1,9 +1,14 @@ +using ShoeStore.Repositories.Implementations; +using ShoeStore.Repositories; +using Unity.Lifetime; +using Unity; + namespace ShoeStore { internal static class Program { /// - /// The main entry point for the application. + /// The main entry point for the application. /// [STAThread] static void Main() @@ -11,7 +16,22 @@ namespace ShoeStore // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(CreateContainer().Resolve()); + } + private static IUnityContainer CreateContainer() + { + var container = new UnityContainer(); + container.RegisterType(new TransientLifetimeManager()); + container.RegisterType(new TransientLifetimeManager()); + container.RegisterType(new + TransientLifetimeManager()); + container.RegisterType(new TransientLifetimeManager()); + container.RegisterType(new TransientLifetimeManager()); + return container; } } -} \ No newline at end of file +} diff --git a/ShoeStore/ShoeStore/Properties/Resources.Designer.cs b/ShoeStore/ShoeStore/Properties/Resources.Designer.cs new file mode 100644 index 0000000..a47acfc --- /dev/null +++ b/ShoeStore/ShoeStore/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace ShoeStore.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ShoeStore.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap fb3882d00f3138e7a504134cff73630f { + get { + object obj = ResourceManager.GetObject("fb3882d00f3138e7a504134cff73630f", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/ShoeStore/ShoeStore/Properties/Resources.resx b/ShoeStore/ShoeStore/Properties/Resources.resx new file mode 100644 index 0000000..5794ac6 --- /dev/null +++ b/ShoeStore/ShoeStore/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\fb3882d00f3138e7a504134cff73630f.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/ShoeStore/ShoeStore/Repositories/IFactoryRepository.cs b/ShoeStore/ShoeStore/Repositories/IFactoryRepository.cs new file mode 100644 index 0000000..8c37760 --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/IFactoryRepository.cs @@ -0,0 +1,17 @@ +using ShoeStore.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories; + +public interface IFactoryRepository +{ + IEnumerable ReadFactorys(); + Factory ReadFactoryById(int id); + void CreateFactory(Factory factory); + void UpdateFactory(Factory factory); + void DeleteFactory(int id); +} diff --git a/ShoeStore/ShoeStore/Repositories/IShoesReplenishmentRepository.cs b/ShoeStore/ShoeStore/Repositories/IShoesReplenishmentRepository.cs new file mode 100644 index 0000000..673ad17 --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/IShoesReplenishmentRepository.cs @@ -0,0 +1,17 @@ +using ShoeStore.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories; + +public interface IShoesReplenishmentRepository +{ + IEnumerable ReadShoesReplenishment(DateTime? dateForm = + null, DateTime? dateTo = null, + int? shoesId = null, int? factoryId = null); + void CreateShoesReplenishment(ShoesReplenishment shoesReplenishment); + void DeleteShoesReplenishment(int id); +} \ No newline at end of file diff --git a/ShoeStore/ShoeStore/Repositories/IShoesRepository.cs b/ShoeStore/ShoeStore/Repositories/IShoesRepository.cs new file mode 100644 index 0000000..07a8881 --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/IShoesRepository.cs @@ -0,0 +1,17 @@ +using ShoeStore.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories; + +public interface IShoesRepository +{ + IEnumerable ReadShoess(); + Shoes ReadShoesById(int id); + void CreateShoes(Shoes shoes); + void UpdateShoes(Shoes shoes); + void DeleteShoes(int id); +} diff --git a/ShoeStore/ShoeStore/Repositories/IShoesSaleRepository.cs b/ShoeStore/ShoeStore/Repositories/IShoesSaleRepository.cs new file mode 100644 index 0000000..bd514e4 --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/IShoesSaleRepository.cs @@ -0,0 +1,16 @@ +using ShoeStore.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories; + +public interface IShoesSaleRepository +{ + IEnumerable ReadShoesSales(DateTime? dateForm = null, + DateTime? dateTo = null, int? shoesId = null, + int? factoryId = null, int? storeId = null); + void CreateShoesSale(ShoesSale shoesSale); +} \ No newline at end of file diff --git a/ShoeStore/ShoeStore/Repositories/IStoreRepository.cs b/ShoeStore/ShoeStore/Repositories/IStoreRepository.cs new file mode 100644 index 0000000..63891fc --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/IStoreRepository.cs @@ -0,0 +1,17 @@ +using ShoeStore.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories; + +public interface IStoreRepository +{ + IEnumerable ReadStores(); + Store ReadStoreById(int id); + void CreateStore(Store store); + void UpdateStore(Store store); + void DeleteStore(int id); +} \ No newline at end of file diff --git a/ShoeStore/ShoeStore/Repositories/Implementations/FactoryRepository.cs b/ShoeStore/ShoeStore/Repositories/Implementations/FactoryRepository.cs new file mode 100644 index 0000000..176ed5e --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/Implementations/FactoryRepository.cs @@ -0,0 +1,35 @@ +using ShoeStore.Entities; +using ShoeStore.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories.Implementations; + +public class FactoryRepository : IFactoryRepository +{ + public void CreateFactory(Factory factory) + { + } + + public void DeleteFactory(int id) + { + } + + public Factory ReadFactoryById(int id) + { + return Factory.CreateEntity(0, string.Empty, string.Empty, +Manufacturer.None); + } + + public IEnumerable ReadFactorys() + { + return []; + } + + public void UpdateFactory(Factory factory) + { + } +} diff --git a/ShoeStore/ShoeStore/Repositories/Implementations/ShoesReplenishmentRepository.cs b/ShoeStore/ShoeStore/Repositories/Implementations/ShoesReplenishmentRepository.cs new file mode 100644 index 0000000..3d8a57f --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/Implementations/ShoesReplenishmentRepository.cs @@ -0,0 +1,25 @@ +using ShoeStore.Entities; +using ShoeStore.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories.Implementations; + +public class ShoesReplenishmentRepository : IShoesReplenishmentRepository +{ + public void CreateShoesReplenishment(ShoesReplenishment shoesReplenishment) + { + } + + public void DeleteShoesReplenishment(int id) + { + } + + public IEnumerable ReadShoesReplenishment(DateTime? dateForm = null, DateTime? dateTo = null, int? shoesId = null, int? factoryId = null) + { + return []; + } +} diff --git a/ShoeStore/ShoeStore/Repositories/Implementations/ShoesRepository.cs b/ShoeStore/ShoeStore/Repositories/Implementations/ShoesRepository.cs new file mode 100644 index 0000000..9bcbb9d --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/Implementations/ShoesRepository.cs @@ -0,0 +1,36 @@ +using Microsoft.VisualBasic.FileIO; +using ShoeStore.Entities; +using ShoeStore.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories.Implementations; + +public class ShoesRepository : IShoesRepository +{ + public void CreateShoes(Shoes shoes) + { + } + + public void DeleteShoes(int id) + { + } + + public Shoes ReadShoesById(int id) + { + return Shoes.CreateEntity(0, ShoesType.None, string.Empty, + string.Empty); + } + + public IEnumerable ReadShoess() + { + return []; + } + + public void UpdateShoes(Shoes shoes) + { + } +} diff --git a/ShoeStore/ShoeStore/Repositories/Implementations/ShoesSaleRepository.cs b/ShoeStore/ShoeStore/Repositories/Implementations/ShoesSaleRepository.cs new file mode 100644 index 0000000..088a404 --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/Implementations/ShoesSaleRepository.cs @@ -0,0 +1,20 @@ +using ShoeStore.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories.Implementations; + +public class ShoesSaleRepository : IShoesSaleRepository +{ + public void CreateShoesSale(ShoesSale shoesSale) + { + } + + public IEnumerable ReadShoesSales(DateTime? dateForm = null, DateTime? dateTo = null, int? shoesId = null, int? factoryId = null, int? storeId = null) + { + return []; + } +} diff --git a/ShoeStore/ShoeStore/Repositories/Implementations/StoreRepository.cs b/ShoeStore/ShoeStore/Repositories/Implementations/StoreRepository.cs new file mode 100644 index 0000000..effceed --- /dev/null +++ b/ShoeStore/ShoeStore/Repositories/Implementations/StoreRepository.cs @@ -0,0 +1,34 @@ +using ShoeStore.Entities; +using ShoeStore.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoeStore.Repositories.Implementations; + +public class StoreRepository : IStoreRepository +{ + public void CreateStore(Store store) + { + } + + public void DeleteStore(int id) + { + } + + public Store ReadStoreById(int id) + { + return Store.CreateEntity(0, string.Empty, string.Empty, 0, 0); + } + + public IEnumerable ReadStores() + { + return []; + } + + public void UpdateStore(Store store) + { + } +} diff --git a/ShoeStore/ShoeStore/Resources/fb3882d00f3138e7a504134cff73630f.jpg b/ShoeStore/ShoeStore/Resources/fb3882d00f3138e7a504134cff73630f.jpg new file mode 100644 index 0000000..fe7645d Binary files /dev/null and b/ShoeStore/ShoeStore/Resources/fb3882d00f3138e7a504134cff73630f.jpg differ diff --git a/ShoeStore/ShoeStore/ShoeStore.csproj b/ShoeStore/ShoeStore/ShoeStore.csproj index 663fdb8..accbdf0 100644 --- a/ShoeStore/ShoeStore/ShoeStore.csproj +++ b/ShoeStore/ShoeStore/ShoeStore.csproj @@ -8,4 +8,23 @@ enable + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file