Добавьте файлы проекта.

This commit is contained in:
Kaimal 2026-02-24 21:26:07 +03:00
parent 0fb0854671
commit c2408f3dc2
32 changed files with 2290 additions and 0 deletions

25
shoe_store.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.13.35931.197 d17.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shoe_store", "shoe_store\shoe_store.csproj", "{60757A2E-4B9E-42B9-8BD2-6AC36B6098F2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{60757A2E-4B9E-42B9-8BD2-6AC36B6098F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60757A2E-4B9E-42B9-8BD2-6AC36B6098F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60757A2E-4B9E-42B9-8BD2-6AC36B6098F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60757A2E-4B9E-42B9-8BD2-6AC36B6098F2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3F52BA18-F4A3-430E-8180-C271B118AE37}
EndGlobalSection
EndGlobal

12
shoe_store/Category.cs Normal file
View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace shoe_store
{
internal class Category
{
}
}

108
shoe_store/Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,108 @@
namespace shoe_store
{
partial class avtorization
{
/// <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()
{
textBox1 = new TextBox();
textBox2 = new TextBox();
label1 = new Label();
label2 = new Label();
button1 = new Button();
SuspendLayout();
//
// textBox1
//
textBox1.Location = new Point(125, 125);
textBox1.Name = "textBox1";
textBox1.Size = new Size(100, 27);
textBox1.TabIndex = 0;
//
// textBox2
//
textBox2.Location = new Point(125, 194);
textBox2.Name = "textBox2";
textBox2.Size = new Size(100, 27);
textBox2.TabIndex = 1;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(125, 102);
label1.Name = "label1";
label1.Size = new Size(52, 20);
label1.TabIndex = 2;
label1.Text = "Логин";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(125, 171);
label2.Name = "label2";
label2.Size = new Size(62, 20);
label2.TabIndex = 3;
label2.Text = "Пароль";
//
// button1
//
button1.Location = new Point(125, 246);
button1.Name = "button1";
button1.Size = new Size(89, 25);
button1.TabIndex = 4;
button1.Text = "вход";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// avtorization
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(336, 397);
Controls.Add(button1);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(textBox2);
Controls.Add(textBox1);
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
MinimizeBox = false;
Name = "avtorization";
StartPosition = FormStartPosition.CenterScreen;
Text = "вход";
ResumeLayout(false);
PerformLayout();
}
#endregion
private TextBox textBox1;
private TextBox textBox2;
private Label label1;
private Label label2;
private Button button1;
}
}

17
shoe_store/Form1.cs Normal file
View File

@ -0,0 +1,17 @@
namespace shoe_store
{
public partial class avtorization : Form
{
public avtorization()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
admin admin = new admin();
admin.Show();
}
}
}

120
shoe_store/Form1.resx Normal file
View File

@ -0,0 +1,120 @@
<?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>
</root>

247
shoe_store/Formadd.Designer.cs generated Normal file
View File

@ -0,0 +1,247 @@
namespace shoe_store
{
partial class Formadd
{
/// <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()
{
components = new System.ComponentModel.Container();
button1 = new Button();
productBindingSource = new BindingSource(components);
Save = new Button();
textBox1 = new TextBox();
comboBox1 = new ComboBox();
categoryBindingSourse = new BindingSource(components);
comboBox2 = new ComboBox();
manufacturerBindingSourse = new BindingSource(components);
comboBox3 = new ComboBox();
supplierBindingSource = new BindingSource(components);
textBox2 = new TextBox();
textBox3 = new TextBox();
textBox4 = new TextBox();
textBox5 = new TextBox();
textBox6 = new TextBox();
textBox7 = new TextBox();
((System.ComponentModel.ISupportInitialize)productBindingSource).BeginInit();
((System.ComponentModel.ISupportInitialize)categoryBindingSourse).BeginInit();
((System.ComponentModel.ISupportInitialize)manufacturerBindingSourse).BeginInit();
((System.ComponentModel.ISupportInitialize)supplierBindingSource).BeginInit();
SuspendLayout();
//
// button1
//
button1.Location = new Point(346, 297);
button1.Margin = new Padding(3, 2, 3, 2);
button1.Name = "button1";
button1.Size = new Size(80, 23);
button1.TabIndex = 0;
button1.Text = "Exit";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// productBindingSource
//
productBindingSource.DataSource = typeof(Models.Product);
//
// Save
//
Save.Location = new Point(321, 244);
Save.Margin = new Padding(3, 2, 3, 2);
Save.Name = "Save";
Save.Size = new Size(97, 35);
Save.TabIndex = 1;
Save.Text = "save";
Save.UseVisualStyleBackColor = true;
//
// textBox1
//
textBox1.DataBindings.Add(new Binding("Text", productBindingSource, "ArticleProduct", true));
textBox1.Location = new Point(46, 9);
textBox1.Margin = new Padding(3, 2, 3, 2);
textBox1.Name = "textBox1";
textBox1.Size = new Size(128, 23);
textBox1.TabIndex = 2;
textBox1.TextChanged += textBox1_TextChanged;
//
// comboBox1
//
comboBox1.DataBindings.Add(new Binding("SelectedValue", productBindingSource, "CategoryId", true));
comboBox1.DataSource = categoryBindingSourse;
comboBox1.DisplayMember = "CategoryName";
comboBox1.FormattingEnabled = true;
comboBox1.Location = new Point(46, 164);
comboBox1.Margin = new Padding(3, 2, 3, 2);
comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(106, 23);
comboBox1.TabIndex = 3;
comboBox1.ValueMember = "IdCategory";
//
// categoryBindingSourse
//
categoryBindingSourse.DataSource = typeof(Models.Category);
//
// comboBox2
//
comboBox2.DataBindings.Add(new Binding("SelectedValue", productBindingSource, "ManufacturerId", true));
comboBox2.DataSource = manufacturerBindingSourse;
comboBox2.DisplayMember = "ManufacturerName";
comboBox2.FormattingEnabled = true;
comboBox2.Location = new Point(46, 139);
comboBox2.Margin = new Padding(3, 2, 3, 2);
comboBox2.Name = "comboBox2";
comboBox2.Size = new Size(106, 23);
comboBox2.TabIndex = 4;
comboBox2.ValueMember = "IdManufacturer";
//
// manufacturerBindingSourse
//
manufacturerBindingSourse.DataSource = typeof(Models.Manufacturer);
//
// comboBox3
//
comboBox3.DataBindings.Add(new Binding("SelectedValue", productBindingSource, "SupplierId", true));
comboBox3.DataSource = supplierBindingSource;
comboBox3.DisplayMember = "SupplierName";
comboBox3.FormattingEnabled = true;
comboBox3.Location = new Point(46, 105);
comboBox3.Margin = new Padding(3, 2, 3, 2);
comboBox3.Name = "comboBox3";
comboBox3.Size = new Size(128, 23);
comboBox3.TabIndex = 5;
comboBox3.ValueMember = "IdSupplier";
//
// supplierBindingSource
//
supplierBindingSource.DataSource = typeof(Models.Supplier);
//
// textBox2
//
textBox2.DataBindings.Add(new Binding("Text", productBindingSource, "ProductName", true));
textBox2.Location = new Point(46, 41);
textBox2.Margin = new Padding(3, 2, 3, 2);
textBox2.Name = "textBox2";
textBox2.Size = new Size(128, 23);
textBox2.TabIndex = 7;
textBox2.Text = "v";
//
// textBox3
//
textBox3.DataBindings.Add(new Binding("Text", productBindingSource, "SalePercent", true));
textBox3.Location = new Point(46, 190);
textBox3.Margin = new Padding(3, 2, 3, 2);
textBox3.Name = "textBox3";
textBox3.Size = new Size(128, 23);
textBox3.TabIndex = 9;
//
// textBox4
//
textBox4.DataBindings.Add(new Binding("Text", productBindingSource, "Price", true));
textBox4.Location = new Point(46, 71);
textBox4.Margin = new Padding(3, 2, 3, 2);
textBox4.Name = "textBox4";
textBox4.Size = new Size(128, 23);
textBox4.TabIndex = 8;
//
// textBox5
//
textBox5.DataBindings.Add(new Binding("Text", productBindingSource, "Description", true));
textBox5.Location = new Point(46, 251);
textBox5.Margin = new Padding(3, 2, 3, 2);
textBox5.Name = "textBox5";
textBox5.Size = new Size(128, 23);
textBox5.TabIndex = 12;
//
// textBox6
//
textBox6.DataBindings.Add(new Binding("Text", productBindingSource, "UnitType", true));
textBox6.Location = new Point(46, 219);
textBox6.Margin = new Padding(3, 2, 3, 2);
textBox6.Name = "textBox6";
textBox6.Size = new Size(128, 23);
textBox6.TabIndex = 11;
//
// textBox7
//
textBox7.DataBindings.Add(new Binding("Text", productBindingSource, "QuantityInStock", true));
textBox7.Location = new Point(55, 312);
textBox7.Margin = new Padding(3, 2, 3, 2);
textBox7.Name = "textBox7";
textBox7.Size = new Size(128, 23);
textBox7.TabIndex = 10;
//
// Formadd
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(441, 341);
Controls.Add(textBox5);
Controls.Add(textBox6);
Controls.Add(textBox7);
Controls.Add(textBox3);
Controls.Add(textBox4);
Controls.Add(textBox2);
Controls.Add(comboBox3);
Controls.Add(comboBox2);
Controls.Add(comboBox1);
Controls.Add(textBox1);
Controls.Add(Save);
Controls.Add(button1);
FormBorderStyle = FormBorderStyle.FixedSingle;
Margin = new Padding(3, 2, 3, 2);
MaximizeBox = false;
MinimizeBox = false;
Name = "Formadd";
StartPosition = FormStartPosition.CenterScreen;
Text = "Formadd";
Load += Formadd_Load;
((System.ComponentModel.ISupportInitialize)productBindingSource).EndInit();
((System.ComponentModel.ISupportInitialize)categoryBindingSourse).EndInit();
((System.ComponentModel.ISupportInitialize)manufacturerBindingSourse).EndInit();
((System.ComponentModel.ISupportInitialize)supplierBindingSource).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button button1;
public BindingSource productBindingSource;
public Button Save;
private TextBox textBox1;
private ComboBox comboBox1;
private ComboBox comboBox2;
private ComboBox comboBox3;
private TextBox textBox2;
private TextBox textBox3;
private TextBox textBox4;
private TextBox textBox5;
private TextBox textBox6;
private TextBox textBox7;
public BindingSource categoryBindingSourse;
public BindingSource manufacturerBindingSourse;
public BindingSource supplierBindingSource;
}
}

35
shoe_store/Formadd.cs Normal file
View File

@ -0,0 +1,35 @@
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 shoe_store
{
public partial class Formadd : Form
{
public Formadd()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
private void Formadd_Load(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}

144
shoe_store/Formadd.resx Normal file
View File

@ -0,0 +1,144 @@
<?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="productBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="categoryBindingSourse.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>225, 22</value>
</metadata>
<metadata name="categoryBindingSourse.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>225, 22</value>
</metadata>
<metadata name="manufacturerBindingSourse.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>454, 19</value>
</metadata>
<metadata name="manufacturerBindingSourse.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>454, 19</value>
</metadata>
<metadata name="supplierBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>687, 16</value>
</metadata>
<metadata name="supplierBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>687, 16</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>128</value>
</metadata>
</root>

202
shoe_store/LayoutControl.Designer.cs generated Normal file
View File

@ -0,0 +1,202 @@
namespace shoe_store
{
partial class LayoutControl
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором компонентов
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
descri = new TextBox();
productBindingSource = new BindingSource(components);
unitttttttttte = new TextBox();
kwanttodm = new TextBox();
sale = new TextBox();
articledb = new TextBox();
Price = new TextBox();
suppluer = new ComboBox();
supplierbindingSource = new BindingSource(components);
manufac = new ComboBox();
manuSource2 = new BindingSource(components);
catgor = new ComboBox();
CategorSource1 = new BindingSource(components);
name = new TextBox();
((System.ComponentModel.ISupportInitialize)productBindingSource).BeginInit();
((System.ComponentModel.ISupportInitialize)supplierbindingSource).BeginInit();
((System.ComponentModel.ISupportInitialize)manuSource2).BeginInit();
((System.ComponentModel.ISupportInitialize)CategorSource1).BeginInit();
SuspendLayout();
//
// descri
//
descri.DataBindings.Add(new Binding("Text", productBindingSource, "Description", true));
descri.Location = new Point(194, 109);
descri.Name = "descri";
descri.Size = new Size(146, 27);
descri.TabIndex = 22;
//
// productBindingSource
//
productBindingSource.DataSource = typeof(Models.Product);
//
// unitttttttttte
//
unitttttttttte.DataBindings.Add(new Binding("Text", productBindingSource, "UnitType", true));
unitttttttttte.Location = new Point(194, 66);
unitttttttttte.Name = "unitttttttttte";
unitttttttttte.Size = new Size(146, 27);
unitttttttttte.TabIndex = 21;
//
// kwanttodm
//
kwanttodm.DataBindings.Add(new Binding("Text", productBindingSource, "QuantityInStock", true));
kwanttodm.Location = new Point(194, 155);
kwanttodm.Name = "kwanttodm";
kwanttodm.Size = new Size(146, 27);
kwanttodm.TabIndex = 20;
//
// sale
//
sale.DataBindings.Add(new Binding("Text", productBindingSource, "SalePercent", true));
sale.Location = new Point(194, 18);
sale.Name = "sale";
sale.Size = new Size(146, 27);
sale.TabIndex = 19;
//
// articledb
//
articledb.DataBindings.Add(new Binding("Text", productBindingSource, "ArticleProduct", true));
articledb.Location = new Point(42, 17);
articledb.Name = "articledb";
articledb.Size = new Size(146, 27);
articledb.TabIndex = 18;
//
// Price
//
Price.DataBindings.Add(new Binding("Text", productBindingSource, "Price", true));
Price.Location = new Point(42, 97);
Price.Name = "Price";
Price.Size = new Size(146, 27);
Price.TabIndex = 17;
//
// suppluer
//
suppluer.DataBindings.Add(new Binding("SelectedValue", supplierbindingSource, "IdSupplier", true));
suppluer.DataSource = supplierbindingSource;
suppluer.DisplayMember = "SupplierName";
suppluer.FormattingEnabled = true;
suppluer.Location = new Point(42, 144);
suppluer.Name = "suppluer";
suppluer.Size = new Size(146, 28);
suppluer.TabIndex = 16;
suppluer.ValueMember = "IdSupplier";
//
// supplierbindingSource
//
supplierbindingSource.DataSource = typeof(Models.Supplier);
//
// manufac
//
manufac.DataBindings.Add(new Binding("SelectedValue", manuSource2, "IdManufacturer", true));
manufac.DataSource = manuSource2;
manufac.DisplayMember = "ManufacturerName";
manufac.FormattingEnabled = true;
manufac.Location = new Point(42, 189);
manufac.Name = "manufac";
manufac.Size = new Size(121, 28);
manufac.TabIndex = 15;
manufac.ValueMember = "IdManufacturer";
//
// manuSource2
//
manuSource2.DataSource = typeof(Models.Manufacturer);
manuSource2.CurrentChanged += bindingSource2_CurrentChanged;
//
// catgor
//
catgor.DataBindings.Add(new Binding("SelectedValue", CategorSource1, "IdCategory", true));
catgor.DataSource = CategorSource1;
catgor.DisplayMember = "CategoryName";
catgor.FormattingEnabled = true;
catgor.Location = new Point(194, 188);
catgor.Name = "catgor";
catgor.Size = new Size(121, 28);
catgor.TabIndex = 14;
catgor.ValueMember = "IdCategory";
//
// CategorSource1
//
CategorSource1.DataSource = typeof(Models.Category);
//
// name
//
name.DataBindings.Add(new Binding("Text", productBindingSource, "ProductName", true));
name.Location = new Point(42, 50);
name.Name = "name";
name.Size = new Size(146, 27);
name.TabIndex = 13;
//
// LayoutControl
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
Controls.Add(descri);
Controls.Add(unitttttttttte);
Controls.Add(kwanttodm);
Controls.Add(sale);
Controls.Add(articledb);
Controls.Add(Price);
Controls.Add(suppluer);
Controls.Add(manufac);
Controls.Add(catgor);
Controls.Add(name);
Name = "LayoutControl";
Size = new Size(344, 235);
((System.ComponentModel.ISupportInitialize)productBindingSource).EndInit();
((System.ComponentModel.ISupportInitialize)supplierbindingSource).EndInit();
((System.ComponentModel.ISupportInitialize)manuSource2).EndInit();
((System.ComponentModel.ISupportInitialize)CategorSource1).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private TextBox descri;
private TextBox unitttttttttte;
private TextBox kwanttodm;
private TextBox sale;
private TextBox articledb;
private TextBox Price;
private ComboBox suppluer;
private ComboBox manufac;
private ComboBox catgor;
private TextBox name;
public BindingSource productBindingSource;
public BindingSource CategorSource1;
public BindingSource supplierbindingSource;
public BindingSource manuSource2;
}
}

View File

@ -0,0 +1,25 @@
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 shoe_store
{
public partial class LayoutControl : UserControl
{
public LayoutControl()
{
InitializeComponent();
}
private void bindingSource2_CurrentChanged(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,132 @@
<?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="productBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="supplierbindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>425, 8</value>
</metadata>
<metadata name="manuSource2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>739, 18</value>
</metadata>
<metadata name="CategorSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class Category
{
public int IdCategory { get; set; }
public string CategoryName { get; set; } = null!;
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
}

View File

@ -0,0 +1,265 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Pomelo.EntityFrameworkCore.MySql.Scaffolding.Internal;
namespace shoe_store.Models;
public partial class Ispr2521TimofeevKoShoestoreContext : DbContext
{
public Ispr2521TimofeevKoShoestoreContext()
{
}
public Ispr2521TimofeevKoShoestoreContext(DbContextOptions<Ispr2521TimofeevKoShoestoreContext> options)
: base(options)
{
}
public virtual DbSet<Category> Categories { get; set; }
public virtual DbSet<Manufacturer> Manufacturers { get; set; }
public virtual DbSet<Order> Orders { get; set; }
public virtual DbSet<OrderItem> OrderItems { get; set; }
public virtual DbSet<OrderStatus> OrderStatuses { get; set; }
public virtual DbSet<PickupPoint> PickupPoints { get; set; }
public virtual DbSet<Product> Products { get; set; }
public virtual DbSet<Role> Roles { get; set; }
public virtual DbSet<Supplier> Suppliers { get; set; }
public virtual DbSet<User> Users { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
=> optionsBuilder.UseMySql("server=cfif31.ru;username=ISPr25-21_TimofeevKO;password=ISPr25-21_TimofeevKO;database=ISPr25-21_TimofeevKO_shoestore", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.45-mysql"));
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder
.UseCollation("utf8mb4_0900_ai_ci")
.HasCharSet("utf8mb4");
modelBuilder.Entity<Category>(entity =>
{
entity.HasKey(e => e.IdCategory).HasName("PRIMARY");
entity.ToTable("Category");
entity.Property(e => e.IdCategory).HasColumnName("id_Category");
entity.Property(e => e.CategoryName)
.HasMaxLength(45)
.HasColumnName("Category_name");
});
modelBuilder.Entity<Manufacturer>(entity =>
{
entity.HasKey(e => e.IdManufacturer).HasName("PRIMARY");
entity.ToTable("Manufacturer");
entity.Property(e => e.IdManufacturer).HasColumnName("id_Manufacturer");
entity.Property(e => e.ManufacturerName)
.HasMaxLength(45)
.HasColumnName("Manufacturer_name");
});
modelBuilder.Entity<Order>(entity =>
{
entity.HasKey(e => e.IdOrders).HasName("PRIMARY");
entity.HasIndex(e => e.PickupPointId, "from order to pickup_idx");
entity.HasIndex(e => e.OrderstatusId, "from order to status_idx");
entity.HasIndex(e => e.UserInitialsId, "from order to user_idx");
entity.Property(e => e.IdOrders).HasColumnName("id_Orders");
entity.Property(e => e.Code).HasColumnName("code");
entity.Property(e => e.DeliveryDate).HasColumnName("delivery_date");
entity.Property(e => e.OrderDate).HasColumnName("order_date");
entity.Property(e => e.OrderstatusId).HasColumnName("orderstatus_id");
entity.Property(e => e.PickupPointId).HasColumnName("pickup_point_id");
entity.Property(e => e.UserInitialsId).HasColumnName("user_initials_id");
entity.HasOne(d => d.Orderstatus).WithMany(p => p.Orders)
.HasForeignKey(d => d.OrderstatusId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("from order to status");
entity.HasOne(d => d.PickupPoint).WithMany(p => p.Orders)
.HasForeignKey(d => d.PickupPointId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("from order to pickup");
entity.HasOne(d => d.UserInitials).WithMany(p => p.Orders)
.HasForeignKey(d => d.UserInitialsId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("from order to user");
});
modelBuilder.Entity<OrderItem>(entity =>
{
entity.HasKey(e => e.IdOrderItems).HasName("PRIMARY");
entity.HasIndex(e => e.OrderId, "from items to order_idx");
entity.HasIndex(e => e.ProductArticle, "from items to product_idx");
entity.Property(e => e.IdOrderItems).HasColumnName("id_OrderItems");
entity.Property(e => e.OrderId).HasColumnName("order_id");
entity.Property(e => e.ProductArticle)
.HasMaxLength(20)
.HasColumnName("product_article");
entity.Property(e => e.Quantity).HasColumnName("quantity");
entity.HasOne(d => d.Order).WithMany(p => p.OrderItems)
.HasForeignKey(d => d.OrderId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("from items to order");
entity.HasOne(d => d.ProductArticleNavigation).WithMany(p => p.OrderItems)
.HasForeignKey(d => d.ProductArticle)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("from items to product");
});
modelBuilder.Entity<OrderStatus>(entity =>
{
entity.HasKey(e => e.IdOrderStatus).HasName("PRIMARY");
entity.ToTable("OrderStatus");
entity.Property(e => e.IdOrderStatus).HasColumnName("id_OrderStatus");
entity.Property(e => e.StatusName)
.HasMaxLength(75)
.HasColumnName("status_name");
});
modelBuilder.Entity<PickupPoint>(entity =>
{
entity.HasKey(e => e.IdpickupPoints).HasName("PRIMARY");
entity.ToTable("pickup_points");
entity.Property(e => e.IdpickupPoints).HasColumnName("idpickup_points");
entity.Property(e => e.City)
.HasMaxLength(75)
.HasColumnName("city");
entity.Property(e => e.HouseNumber).HasColumnName("house_number");
entity.Property(e => e.Index).HasColumnName("index");
entity.Property(e => e.Street)
.HasMaxLength(100)
.HasColumnName("street");
});
modelBuilder.Entity<Product>(entity =>
{
entity.HasKey(e => e.ArticleProduct).HasName("PRIMARY");
entity.ToTable("products");
entity.HasIndex(e => e.CategoryId, "from prod to category_idx");
entity.HasIndex(e => e.ManufacturerId, "from prod to manufacturer_idx");
entity.HasIndex(e => e.SupplierId, "from prod to suppleir_idx");
entity.Property(e => e.ArticleProduct)
.HasMaxLength(20)
.HasColumnName("article_product");
entity.Property(e => e.CategoryId).HasColumnName("category_id");
entity.Property(e => e.Description)
.HasColumnType("text")
.HasColumnName("description");
entity.Property(e => e.ManufacturerId).HasColumnName("manufacturer_id");
entity.Property(e => e.Photo)
.HasColumnType("mediumblob")
.HasColumnName("photo");
entity.Property(e => e.Price)
.HasPrecision(10, 2)
.HasColumnName("price");
entity.Property(e => e.ProductName)
.HasMaxLength(100)
.HasColumnName("product_name");
entity.Property(e => e.QuantityInStock).HasColumnName("quantity_in_stock");
entity.Property(e => e.SalePercent).HasColumnName("sale_percent");
entity.Property(e => e.SupplierId).HasColumnName("supplier_id");
entity.Property(e => e.UnitType)
.HasMaxLength(45)
.HasColumnName("unit_type");
entity.HasOne(d => d.Category).WithMany(p => p.Products)
.HasForeignKey(d => d.CategoryId)
.HasConstraintName("from prod to category");
entity.HasOne(d => d.Manufacturer).WithMany(p => p.Products)
.HasForeignKey(d => d.ManufacturerId)
.HasConstraintName("from prod to manufacturer");
entity.HasOne(d => d.Supplier).WithMany(p => p.Products)
.HasForeignKey(d => d.SupplierId)
.HasConstraintName("from prod to suppleir");
});
modelBuilder.Entity<Role>(entity =>
{
entity.HasKey(e => e.IdRole).HasName("PRIMARY");
entity.ToTable("Role");
entity.Property(e => e.IdRole).HasColumnName("idRole");
entity.Property(e => e.RoleName)
.HasMaxLength(75)
.HasColumnName("Role_name");
});
modelBuilder.Entity<Supplier>(entity =>
{
entity.HasKey(e => e.IdSupplier).HasName("PRIMARY");
entity.ToTable("Supplier");
entity.Property(e => e.IdSupplier).HasColumnName("id_Supplier");
entity.Property(e => e.SupplierName)
.HasMaxLength(75)
.HasColumnName("supplier_name");
});
modelBuilder.Entity<User>(entity =>
{
entity.HasKey(e => e.IdUsers).HasName("PRIMARY");
entity.ToTable("users");
entity.HasIndex(e => e.RoleId, "from users to role_idx");
entity.Property(e => e.IdUsers).HasColumnName("id_users");
entity.Property(e => e.Login)
.HasMaxLength(45)
.HasColumnName("login");
entity.Property(e => e.Name).HasMaxLength(45);
entity.Property(e => e.Password)
.HasMaxLength(45)
.HasColumnName("password");
entity.Property(e => e.Patronymic).HasMaxLength(45);
entity.Property(e => e.RoleId).HasColumnName("RoleID");
entity.Property(e => e.Surname).HasMaxLength(45);
entity.HasOne(d => d.Role).WithMany(p => p.Users)
.HasForeignKey(d => d.RoleId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("from users to role");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class Manufacturer
{
public int IdManufacturer { get; set; }
public string ManufacturerName { get; set; } = null!;
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
}

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class Order
{
public int IdOrders { get; set; }
public DateOnly OrderDate { get; set; }
public DateOnly DeliveryDate { get; set; }
public int PickupPointId { get; set; }
public int UserInitialsId { get; set; }
public int Code { get; set; }
public int OrderstatusId { get; set; }
public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
public virtual OrderStatus Orderstatus { get; set; } = null!;
public virtual PickupPoint PickupPoint { get; set; } = null!;
public virtual User UserInitials { get; set; } = null!;
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class OrderItem
{
public int IdOrderItems { get; set; }
public int OrderId { get; set; }
public string ProductArticle { get; set; } = null!;
public int Quantity { get; set; }
public virtual Order Order { get; set; } = null!;
public virtual Product ProductArticleNavigation { get; set; } = null!;
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class OrderStatus
{
public int IdOrderStatus { get; set; }
public string StatusName { get; set; } = null!;
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class PickupPoint
{
public int IdpickupPoints { get; set; }
public int Index { get; set; }
public string Street { get; set; } = null!;
public string City { get; set; } = null!;
public int HouseNumber { get; set; }
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
}

View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class Product
{
public string ArticleProduct { get; set; } = null!;
public string ProductName { get; set; } = null!;
public decimal Price { get; set; }
public int? SupplierId { get; set; }
public int? ManufacturerId { get; set; }
public int? CategoryId { get; set; }
public int SalePercent { get; set; }
public string UnitType { get; set; } = null!;
public string Description { get; set; } = null!;
public byte[]? Photo { get; set; }
public int QuantityInStock { get; set; }
public virtual Category? Category { get; set; }
public virtual Manufacturer? Manufacturer { get; set; }
public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
public virtual Supplier? Supplier { get; set; }
}

13
shoe_store/Models/Role.cs Normal file
View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class Role
{
public int IdRole { get; set; }
public string RoleName { get; set; } = null!;
public virtual ICollection<User> Users { get; set; } = new List<User>();
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class Supplier
{
public int IdSupplier { get; set; }
public string SupplierName { get; set; } = null!;
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace shoe_store.Models
{
public class Test1
{
public string? ManufacturerName { get; set; }
}
}

25
shoe_store/Models/User.cs Normal file
View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace shoe_store.Models;
public partial class User
{
public int IdUsers { get; set; }
public string Login { get; set; } = null!;
public string Password { get; set; } = null!;
public int RoleId { get; set; }
public string Surname { get; set; } = null!;
public string Name { get; set; } = null!;
public string? Patronymic { get; set; }
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
public virtual Role Role { get; set; } = null!;
}

15
shoe_store/Product.cs Normal file
View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace shoe_store
{
internal class Product
{
}
}

17
shoe_store/Program.cs Normal file
View File

@ -0,0 +1,17 @@
namespace shoe_store
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[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 avtorization());
}
}
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Manufacturer" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>shoe_store.Models.Manufacturer, shoe_store, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

46
shoe_store/Validation.cs Normal file
View File

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using shoe_store.Models;
namespace shoe_store.Models
{
internal partial class Product : IEditableObject
{
Ispr2521TimofeevKoShoestoreContext context;
public void BeginEdit()
{
context = new();
context.Update(this);
}
public void CancelEdit()
{
var entry = context.Entry(this);
if (entry.State == Microsoft.EntityFrameworkCore.EntityState.Modified)
{
entry.Reload();
}
}
public void EndEdit()
{
if (string.IsNullOrEmpty(ProductName))
{
throw new ValidationException("Имя не должно быть пустым");
}
context.SaveChanges();
}
}
}

341
shoe_store/admin.Designer.cs generated Normal file
View File

@ -0,0 +1,341 @@
namespace shoe_store
{
partial class admin
{
/// <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()
{
components = new System.ComponentModel.Container();
dataGridView1 = new DataGridView();
articleProductDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
Photo = new DataGridViewImageColumn();
productNameDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
priceDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
supplierIdDataGridViewTextBoxColumn = new DataGridViewComboBoxColumn();
supplierBindingSource = new BindingSource(components);
Manufacturer = new DataGridViewTextBoxColumn();
manufacturerIdDataGridViewTextBoxColumn = new DataGridViewComboBoxColumn();
manufacturerBindingSource = new BindingSource(components);
categoryIdDataGridViewTextBoxColumn = new DataGridViewComboBoxColumn();
categoryBindingSource = new BindingSource(components);
salePercentDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
unitTypeDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
descriptionDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
quantityInStockDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
productBindingSource = new BindingSource(components);
userBindingSource = new BindingSource(components);
button1 = new Button();
button2 = new Button();
ex = new Button();
button3 = new Button();
button4 = new Button();
cancel = new Button();
flowLayoutPanel1 = new FlowLayoutPanel();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
((System.ComponentModel.ISupportInitialize)supplierBindingSource).BeginInit();
((System.ComponentModel.ISupportInitialize)manufacturerBindingSource).BeginInit();
((System.ComponentModel.ISupportInitialize)categoryBindingSource).BeginInit();
((System.ComponentModel.ISupportInitialize)productBindingSource).BeginInit();
((System.ComponentModel.ISupportInitialize)userBindingSource).BeginInit();
SuspendLayout();
//
// dataGridView1
//
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AutoGenerateColumns = false;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { articleProductDataGridViewTextBoxColumn, Photo, productNameDataGridViewTextBoxColumn, priceDataGridViewTextBoxColumn, supplierIdDataGridViewTextBoxColumn, Manufacturer, manufacturerIdDataGridViewTextBoxColumn, categoryIdDataGridViewTextBoxColumn, salePercentDataGridViewTextBoxColumn, unitTypeDataGridViewTextBoxColumn, descriptionDataGridViewTextBoxColumn, quantityInStockDataGridViewTextBoxColumn });
dataGridView1.DataSource = productBindingSource;
dataGridView1.Enabled = false;
dataGridView1.Location = new Point(13, 15);
dataGridView1.Margin = new Padding(3, 2, 3, 2);
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.Size = new Size(439, 220);
dataGridView1.TabIndex = 0;
dataGridView1.CellContentClick += dataGridView1_CellContentClick;
//
// articleProductDataGridViewTextBoxColumn
//
articleProductDataGridViewTextBoxColumn.DataPropertyName = "ArticleProduct";
articleProductDataGridViewTextBoxColumn.HeaderText = "ArticleProduct";
articleProductDataGridViewTextBoxColumn.Name = "articleProductDataGridViewTextBoxColumn";
articleProductDataGridViewTextBoxColumn.ReadOnly = true;
//
// Photo
//
Photo.DataPropertyName = "Photo";
Photo.HeaderText = "Photo";
Photo.ImageLayout = DataGridViewImageCellLayout.Stretch;
Photo.Name = "Photo";
Photo.ReadOnly = true;
//
// productNameDataGridViewTextBoxColumn
//
productNameDataGridViewTextBoxColumn.DataPropertyName = "ProductName";
productNameDataGridViewTextBoxColumn.HeaderText = "ProductName";
productNameDataGridViewTextBoxColumn.Name = "productNameDataGridViewTextBoxColumn";
productNameDataGridViewTextBoxColumn.ReadOnly = true;
//
// priceDataGridViewTextBoxColumn
//
priceDataGridViewTextBoxColumn.DataPropertyName = "Price";
priceDataGridViewTextBoxColumn.HeaderText = "Price";
priceDataGridViewTextBoxColumn.Name = "priceDataGridViewTextBoxColumn";
priceDataGridViewTextBoxColumn.ReadOnly = true;
//
// supplierIdDataGridViewTextBoxColumn
//
supplierIdDataGridViewTextBoxColumn.DataPropertyName = "SupplierId";
supplierIdDataGridViewTextBoxColumn.DataSource = supplierBindingSource;
supplierIdDataGridViewTextBoxColumn.DisplayMember = "SupplierName";
supplierIdDataGridViewTextBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;
supplierIdDataGridViewTextBoxColumn.HeaderText = "Помставсщике";
supplierIdDataGridViewTextBoxColumn.Name = "supplierIdDataGridViewTextBoxColumn";
supplierIdDataGridViewTextBoxColumn.ReadOnly = true;
supplierIdDataGridViewTextBoxColumn.Resizable = DataGridViewTriState.True;
supplierIdDataGridViewTextBoxColumn.SortMode = DataGridViewColumnSortMode.Automatic;
supplierIdDataGridViewTextBoxColumn.ValueMember = "IdSupplier";
//
// supplierBindingSource
//
supplierBindingSource.DataSource = typeof(Models.Supplier);
//
// Manufacturer
//
Manufacturer.DataPropertyName = "Manufacturer";
Manufacturer.HeaderText = "Manufacturer";
Manufacturer.Name = "Manufacturer";
Manufacturer.ReadOnly = true;
Manufacturer.Visible = false;
//
// manufacturerIdDataGridViewTextBoxColumn
//
manufacturerIdDataGridViewTextBoxColumn.DataPropertyName = "ManufacturerId";
manufacturerIdDataGridViewTextBoxColumn.DataSource = manufacturerBindingSource;
manufacturerIdDataGridViewTextBoxColumn.DisplayMember = "ManufacturerName";
manufacturerIdDataGridViewTextBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;
manufacturerIdDataGridViewTextBoxColumn.HeaderText = "Произхводтиелть";
manufacturerIdDataGridViewTextBoxColumn.Name = "manufacturerIdDataGridViewTextBoxColumn";
manufacturerIdDataGridViewTextBoxColumn.ReadOnly = true;
manufacturerIdDataGridViewTextBoxColumn.Resizable = DataGridViewTriState.True;
manufacturerIdDataGridViewTextBoxColumn.SortMode = DataGridViewColumnSortMode.Automatic;
manufacturerIdDataGridViewTextBoxColumn.ValueMember = "IdManufacturer";
//
// manufacturerBindingSource
//
manufacturerBindingSource.DataSource = typeof(Models.Manufacturer);
//
// categoryIdDataGridViewTextBoxColumn
//
categoryIdDataGridViewTextBoxColumn.DataPropertyName = "CategoryId";
categoryIdDataGridViewTextBoxColumn.DataSource = categoryBindingSource;
categoryIdDataGridViewTextBoxColumn.DisplayMember = "CategoryName";
categoryIdDataGridViewTextBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;
categoryIdDataGridViewTextBoxColumn.HeaderText = "категория";
categoryIdDataGridViewTextBoxColumn.Name = "categoryIdDataGridViewTextBoxColumn";
categoryIdDataGridViewTextBoxColumn.ReadOnly = true;
categoryIdDataGridViewTextBoxColumn.Resizable = DataGridViewTriState.True;
categoryIdDataGridViewTextBoxColumn.SortMode = DataGridViewColumnSortMode.Automatic;
categoryIdDataGridViewTextBoxColumn.ValueMember = "IdCategory";
//
// categoryBindingSource
//
categoryBindingSource.DataSource = typeof(Models.Category);
//
// salePercentDataGridViewTextBoxColumn
//
salePercentDataGridViewTextBoxColumn.DataPropertyName = "SalePercent";
salePercentDataGridViewTextBoxColumn.HeaderText = "SalePercent";
salePercentDataGridViewTextBoxColumn.Name = "salePercentDataGridViewTextBoxColumn";
salePercentDataGridViewTextBoxColumn.ReadOnly = true;
//
// unitTypeDataGridViewTextBoxColumn
//
unitTypeDataGridViewTextBoxColumn.DataPropertyName = "UnitType";
unitTypeDataGridViewTextBoxColumn.HeaderText = "UnitType";
unitTypeDataGridViewTextBoxColumn.Name = "unitTypeDataGridViewTextBoxColumn";
unitTypeDataGridViewTextBoxColumn.ReadOnly = true;
//
// descriptionDataGridViewTextBoxColumn
//
descriptionDataGridViewTextBoxColumn.DataPropertyName = "Description";
descriptionDataGridViewTextBoxColumn.HeaderText = "Description";
descriptionDataGridViewTextBoxColumn.Name = "descriptionDataGridViewTextBoxColumn";
descriptionDataGridViewTextBoxColumn.ReadOnly = true;
//
// quantityInStockDataGridViewTextBoxColumn
//
quantityInStockDataGridViewTextBoxColumn.DataPropertyName = "QuantityInStock";
quantityInStockDataGridViewTextBoxColumn.HeaderText = "QuantityInStock";
quantityInStockDataGridViewTextBoxColumn.Name = "quantityInStockDataGridViewTextBoxColumn";
quantityInStockDataGridViewTextBoxColumn.ReadOnly = true;
//
// productBindingSource
//
productBindingSource.DataSource = typeof(Models.Product);
//
// userBindingSource
//
userBindingSource.DataSource = typeof(Models.User);
//
// button1
//
button1.Location = new Point(32, 306);
button1.Margin = new Padding(3, 2, 3, 2);
button1.Name = "button1";
button1.Size = new Size(66, 22);
button1.TabIndex = 1;
button1.Text = "Exit";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// button2
//
button2.Location = new Point(527, 252);
button2.Margin = new Padding(3, 2, 3, 2);
button2.Name = "button2";
button2.Size = new Size(134, 28);
button2.TabIndex = 2;
button2.Text = "Редактирование";
button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click;
//
// ex
//
ex.Location = new Point(283, 280);
ex.Margin = new Padding(3, 2, 3, 2);
ex.Name = "ex";
ex.Size = new Size(172, 34);
ex.TabIndex = 3;
ex.Text = "ex";
ex.UseVisualStyleBackColor = true;
ex.Click += ex_Click;
//
// button3
//
button3.Location = new Point(32, 252);
button3.Margin = new Padding(3, 2, 3, 2);
button3.Name = "button3";
button3.Size = new Size(150, 32);
button3.TabIndex = 4;
button3.Text = "Добавление";
button3.UseVisualStyleBackColor = true;
button3.Click += button3_Click;
//
// button4
//
button4.Location = new Point(187, 249);
button4.Margin = new Padding(3, 2, 3, 2);
button4.Name = "button4";
button4.Size = new Size(156, 26);
button4.TabIndex = 5;
button4.Text = "Удаление";
button4.UseVisualStyleBackColor = true;
button4.Click += button4_Click;
//
// cancel
//
cancel.Location = new Point(415, 239);
cancel.Margin = new Padding(3, 2, 3, 2);
cancel.Name = "cancel";
cancel.Size = new Size(80, 36);
cancel.TabIndex = 6;
cancel.Text = "Отмена";
cancel.UseVisualStyleBackColor = true;
cancel.Click += cancel_Click;
//
// flowLayoutPanel1
//
flowLayoutPanel1.AutoScroll = true;
flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
flowLayoutPanel1.Location = new Point(458, 15);
flowLayoutPanel1.Margin = new Padding(3, 2, 3, 2);
flowLayoutPanel1.Name = "flowLayoutPanel1";
flowLayoutPanel1.Size = new Size(363, 220);
flowLayoutPanel1.TabIndex = 7;
flowLayoutPanel1.WrapContents = false;
//
// admin
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(833, 322);
Controls.Add(flowLayoutPanel1);
Controls.Add(cancel);
Controls.Add(button4);
Controls.Add(button3);
Controls.Add(ex);
Controls.Add(button2);
Controls.Add(button1);
Controls.Add(dataGridView1);
FormBorderStyle = FormBorderStyle.None;
Margin = new Padding(3, 2, 3, 2);
MaximizeBox = false;
MinimizeBox = false;
Name = "admin";
StartPosition = FormStartPosition.CenterScreen;
Text = "admin";
Load += admin_Load;
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
((System.ComponentModel.ISupportInitialize)supplierBindingSource).EndInit();
((System.ComponentModel.ISupportInitialize)manufacturerBindingSource).EndInit();
((System.ComponentModel.ISupportInitialize)categoryBindingSource).EndInit();
((System.ComponentModel.ISupportInitialize)productBindingSource).EndInit();
((System.ComponentModel.ISupportInitialize)userBindingSource).EndInit();
ResumeLayout(false);
}
#endregion
private DataGridView dataGridView1;
private Button button1;
private BindingSource userBindingSource;
private BindingSource productBindingSource;
private BindingSource supplierBindingSource;
private BindingSource manufacturerBindingSource;
private Button button2;
public BindingSource categoryBindingSource;
private Button ex;
private Button button3;
private Button button4;
private DataGridViewTextBoxColumn articleProductDataGridViewTextBoxColumn;
private DataGridViewImageColumn Photo;
private DataGridViewTextBoxColumn productNameDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn priceDataGridViewTextBoxColumn;
private DataGridViewComboBoxColumn supplierIdDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn Manufacturer;
private DataGridViewComboBoxColumn manufacturerIdDataGridViewTextBoxColumn;
private DataGridViewComboBoxColumn categoryIdDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn salePercentDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn unitTypeDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn descriptionDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn quantityInStockDataGridViewTextBoxColumn;
private Button cancel;
private FlowLayoutPanel flowLayoutPanel1;
}
}

143
shoe_store/admin.cs Normal file
View File

@ -0,0 +1,143 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.EntityFrameworkCore;
using shoe_store.Models;
namespace shoe_store
{
public partial class admin : Form
{
Ispr2521TimofeevKoShoestoreContext context;
public admin()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
avtorization avtorization = new avtorization();
avtorization.Show();
}
private void admin_Load(object sender, EventArgs e)
{
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
context = new Ispr2521TimofeevKoShoestoreContext();
context.Products.Include(x => x.Category).Include(x => x.Supplier).Include(x => x.Manufacturer).Load();
context.Database.EnsureCreated();
productBindingSource.DataSource = context.Products.Local.ToBindingList();
categoryBindingSource.DataSource = context.Categories.Local.ToBindingList();
supplierBindingSource.DataSource = context.Suppliers.Local.ToBindingList();
manufacturerBindingSource.DataSource = context.Manufacturers.Local.ToBindingList();
Populate();
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
public void button2_Click(object sender, EventArgs e)
{
var form = new Formadd();
form.categoryBindingSourse.DataSource = categoryBindingSource.DataSource;
form.manufacturerBindingSourse.DataSource = manufacturerBindingSource.DataSource;
form.supplierBindingSource.DataSource = supplierBindingSource.DataSource;
form.productBindingSource.DataSource = productBindingSource.Current;
form.Save.Click += SaveButton_Click;
form.Show();
Populate();
}
private void SaveButton_Click(object sender, EventArgs e)
{
productBindingSource.EndEdit();
context.SaveChanges();
dataGridView1.Refresh();
Populate();
}
private void ex_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void button3_Click(object sender, EventArgs e)
{
var form = new Formadd();
form.categoryBindingSourse.DataSource = categoryBindingSource.DataSource;
form.manufacturerBindingSourse.DataSource = manufacturerBindingSource.DataSource;
form.supplierBindingSource.DataSource = supplierBindingSource.DataSource;
form.productBindingSource.DataSource = productBindingSource.AddNew();
var ob = form.productBindingSource.DataSource as Product;
form.Save.Click += (o, e) =>
{
if (!string.IsNullOrEmpty(ob?.ProductName))
{
context.SaveChanges();
}
else
{
MessageBox.Show("Название не должно быть пустым!");
}
}
;
form.Show();
Populate();
}
private void button4_Click(object sender, EventArgs e)
{
productBindingSource.RemoveCurrent();
context.SaveChanges();
dataGridView1.Refresh();
Populate();
}
private void cancel_Click(object sender, EventArgs e)
{
productBindingSource.CancelEdit();
}
private void Populate()
{
flowLayoutPanel1.Controls.Clear();
foreach (var binding in productBindingSource)
{
var control = new LayoutControl();
control.productBindingSource.DataSource = binding;
control.CategorSource1.DataSource = categoryBindingSource;
control.supplierbindingSource.DataSource = supplierBindingSource;
control.manuSource2.DataSource = manufacturerBindingSource;
flowLayoutPanel1.Controls.Add(control);
}
}
}
}

144
shoe_store/admin.resx Normal file
View File

@ -0,0 +1,144 @@
<?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="Photo.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="supplierBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>850, 17</value>
</metadata>
<metadata name="Manufacturer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="manufacturerBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>610, 17</value>
</metadata>
<metadata name="categoryBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="productBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>406, 17</value>
</metadata>
<metadata name="userBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>227, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>91</value>
</metadata>
</root>

12
shoe_store/categoty.cs Normal file
View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace shoe_store
{
internal class categoty
{
}
}

View File

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
</ItemGroup>
</Project>