#1.1
This commit is contained in:
parent
0425857c40
commit
b4e8aadc1f
19
ShoeStore/ShoeStore/Entities/Enums/Manufacturer.cs
Normal file
19
ShoeStore/ShoeStore/Entities/Enums/Manufacturer.cs
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
18
ShoeStore/ShoeStore/Entities/Enums/ShoesType.cs
Normal file
18
ShoeStore/ShoeStore/Entities/Enums/ShoesType.cs
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
27
ShoeStore/ShoeStore/Entities/Factory.cs
Normal file
27
ShoeStore/ShoeStore/Entities/Factory.cs
Normal file
@ -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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
23
ShoeStore/ShoeStore/Entities/Shoes.cs
Normal file
23
ShoeStore/ShoeStore/Entities/Shoes.cs
Normal file
@ -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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
30
ShoeStore/ShoeStore/Entities/ShoesReplenishment.cs
Normal file
30
ShoeStore/ShoeStore/Entities/ShoesReplenishment.cs
Normal file
@ -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> ShoesShoesReplenishment
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
} = [];
|
||||||
|
public static ShoesReplenishment CreateOpeartion(int id, int factoryId,
|
||||||
|
IEnumerable<ShoesShoesReplenishment> shoesShoesReplenishment)
|
||||||
|
{
|
||||||
|
return new ShoesReplenishment
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
FactoryId = factoryId,
|
||||||
|
DateReceipt = DateTime.Now,
|
||||||
|
ShoesShoesReplenishment = shoesShoesReplenishment
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
30
ShoeStore/ShoeStore/Entities/ShoesSale.cs
Normal file
30
ShoeStore/ShoeStore/Entities/ShoesSale.cs
Normal file
@ -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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
24
ShoeStore/ShoeStore/Entities/ShoesShoesReplenishment.cs
Normal file
24
ShoeStore/ShoeStore/Entities/ShoesShoesReplenishment.cs
Normal file
@ -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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
29
ShoeStore/ShoeStore/Entities/Store.cs
Normal file
29
ShoeStore/ShoeStore/Entities/Store.cs
Normal file
@ -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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
132
ShoeStore/ShoeStore/FormStorage.Designer.cs
generated
Normal file
132
ShoeStore/ShoeStore/FormStorage.Designer.cs
generated
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
namespace ShoeStore
|
||||||
|
{
|
||||||
|
partial class FormStorage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
namespace ShoeStore
|
namespace ShoeStore
|
||||||
{
|
{
|
||||||
public partial class Form1 : Form
|
public partial class FormStorage : Form
|
||||||
{
|
{
|
||||||
public Form1()
|
public FormStorage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
123
ShoeStore/ShoeStore/FormStorage.resx
Normal file
123
ShoeStore/ShoeStore/FormStorage.resx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
@ -1,6 +1,6 @@
|
|||||||
namespace ShoeStore
|
namespace ShoeStore.Forms
|
||||||
{
|
{
|
||||||
partial class Form1
|
partial class FormStore
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
@ -28,10 +28,17 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
SuspendLayout();
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
//
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
// FormStore
|
||||||
this.Text = "Form1";
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Name = "FormStore";
|
||||||
|
Text = "FormStore";
|
||||||
|
Load += FormStore_Load;
|
||||||
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
87
ShoeStore/ShoeStore/Forms/FormStore.cs
Normal file
87
ShoeStore/ShoeStore/Forms/FormStore.cs
Normal file
@ -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));
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,8 @@
|
|||||||
|
using ShoeStore.Repositories.Implementations;
|
||||||
|
using ShoeStore.Repositories;
|
||||||
|
using Unity.Lifetime;
|
||||||
|
using Unity;
|
||||||
|
|
||||||
namespace ShoeStore
|
namespace ShoeStore
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
@ -11,7 +16,22 @@ namespace ShoeStore
|
|||||||
// To customize application configuration such as set high DPI settings or default font,
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
// see https://aka.ms/applicationconfiguration.
|
// see https://aka.ms/applicationconfiguration.
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(new Form1());
|
Application.Run(CreateContainer().Resolve<FormStorage>());
|
||||||
|
}
|
||||||
|
private static IUnityContainer CreateContainer()
|
||||||
|
{
|
||||||
|
var container = new UnityContainer();
|
||||||
|
container.RegisterType<IFactoryRepository,
|
||||||
|
FactoryRepository>(new TransientLifetimeManager());
|
||||||
|
container.RegisterType<IStoreRepository,
|
||||||
|
StoreRepository>(new TransientLifetimeManager());
|
||||||
|
container.RegisterType<IShoesRepository, ShoesRepository>(new
|
||||||
|
TransientLifetimeManager());
|
||||||
|
container.RegisterType<IShoesSaleRepository,
|
||||||
|
ShoesSaleRepository>(new TransientLifetimeManager());
|
||||||
|
container.RegisterType<IShoesReplenishmentRepository,
|
||||||
|
ShoesReplenishmentRepository>(new TransientLifetimeManager());
|
||||||
|
return container;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
73
ShoeStore/ShoeStore/Properties/Resources.Designer.cs
generated
Normal file
73
ShoeStore/ShoeStore/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Этот код создан программой.
|
||||||
|
// Исполняемая версия:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||||
|
// повторной генерации кода.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ShoeStore.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||||
|
/// </summary>
|
||||||
|
// Этот класс создан автоматически классом 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() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||||
|
/// </summary>
|
||||||
|
[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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||||
|
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap fb3882d00f3138e7a504134cff73630f {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("fb3882d00f3138e7a504134cff73630f", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
124
ShoeStore/ShoeStore/Properties/Resources.resx
Normal file
124
ShoeStore/ShoeStore/Properties/Resources.resx
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="fb3882d00f3138e7a504134cff73630f" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\fb3882d00f3138e7a504134cff73630f.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
17
ShoeStore/ShoeStore/Repositories/IFactoryRepository.cs
Normal file
17
ShoeStore/ShoeStore/Repositories/IFactoryRepository.cs
Normal file
@ -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<Factory> ReadFactorys();
|
||||||
|
Factory ReadFactoryById(int id);
|
||||||
|
void CreateFactory(Factory factory);
|
||||||
|
void UpdateFactory(Factory factory);
|
||||||
|
void DeleteFactory(int id);
|
||||||
|
}
|
@ -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<ShoesReplenishment> ReadShoesReplenishment(DateTime? dateForm =
|
||||||
|
null, DateTime? dateTo = null,
|
||||||
|
int? shoesId = null, int? factoryId = null);
|
||||||
|
void CreateShoesReplenishment(ShoesReplenishment shoesReplenishment);
|
||||||
|
void DeleteShoesReplenishment(int id);
|
||||||
|
}
|
17
ShoeStore/ShoeStore/Repositories/IShoesRepository.cs
Normal file
17
ShoeStore/ShoeStore/Repositories/IShoesRepository.cs
Normal file
@ -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<Shoes> ReadShoess();
|
||||||
|
Shoes ReadShoesById(int id);
|
||||||
|
void CreateShoes(Shoes shoes);
|
||||||
|
void UpdateShoes(Shoes shoes);
|
||||||
|
void DeleteShoes(int id);
|
||||||
|
}
|
16
ShoeStore/ShoeStore/Repositories/IShoesSaleRepository.cs
Normal file
16
ShoeStore/ShoeStore/Repositories/IShoesSaleRepository.cs
Normal file
@ -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<ShoesSale> ReadShoesSales(DateTime? dateForm = null,
|
||||||
|
DateTime? dateTo = null, int? shoesId = null,
|
||||||
|
int? factoryId = null, int? storeId = null);
|
||||||
|
void CreateShoesSale(ShoesSale shoesSale);
|
||||||
|
}
|
17
ShoeStore/ShoeStore/Repositories/IStoreRepository.cs
Normal file
17
ShoeStore/ShoeStore/Repositories/IStoreRepository.cs
Normal file
@ -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<Store> ReadStores();
|
||||||
|
Store ReadStoreById(int id);
|
||||||
|
void CreateStore(Store store);
|
||||||
|
void UpdateStore(Store store);
|
||||||
|
void DeleteStore(int id);
|
||||||
|
}
|
@ -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<Factory> ReadFactorys()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateFactory(Factory factory)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -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<ShoesReplenishment> ReadShoesReplenishment(DateTime? dateForm = null, DateTime? dateTo = null, int? shoesId = null, int? factoryId = null)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
@ -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<Shoes> ReadShoess()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateShoes(Shoes shoes)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -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<ShoesSale> ReadShoesSales(DateTime? dateForm = null, DateTime? dateTo = null, int? shoesId = null, int? factoryId = null, int? storeId = null)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
@ -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<Store> ReadStores()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateStore(Store store)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 110 KiB |
@ -8,4 +8,23 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Unity" Version="5.11.10" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue
Block a user