Malyhin Merkulov

This commit is contained in:
Ilya 2025-11-25 12:59:48 +04:00
commit 35fa303719
26 changed files with 2790 additions and 0 deletions

63
.gitattributes vendored Normal file
View File

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

363
.gitignore vendored Normal file
View File

@ -0,0 +1,363 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

215
AddProductForm.Designer.cs generated Normal file
View File

@ -0,0 +1,215 @@
namespace megadem
{
partial class AddProductForm
{
/// <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()
{
this.Article = new System.Windows.Forms.TextBox();
this.Width = new System.Windows.Forms.TextBox();
this.MinPrice = new System.Windows.Forms.TextBox();
this.NameProd = new System.Windows.Forms.TextBox();
this.comboBoxType = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.btnAdd = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// Article
//
this.Article.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.Article.Location = new System.Drawing.Point(125, 83);
this.Article.Name = "Article";
this.Article.Size = new System.Drawing.Size(200, 35);
this.Article.TabIndex = 0;
//
// Width
//
this.Width.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.Width.Location = new System.Drawing.Point(125, 249);
this.Width.Name = "Width";
this.Width.Size = new System.Drawing.Size(200, 35);
this.Width.TabIndex = 1;
//
// MinPrice
//
this.MinPrice.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.MinPrice.Location = new System.Drawing.Point(125, 165);
this.MinPrice.Name = "MinPrice";
this.MinPrice.Size = new System.Drawing.Size(200, 35);
this.MinPrice.TabIndex = 2;
//
// NameProd
//
this.NameProd.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.NameProd.Location = new System.Drawing.Point(125, 124);
this.NameProd.Name = "NameProd";
this.NameProd.Size = new System.Drawing.Size(200, 35);
this.NameProd.TabIndex = 3;
//
// comboBoxType
//
this.comboBoxType.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.comboBoxType.FormattingEnabled = true;
this.comboBoxType.Location = new System.Drawing.Point(125, 206);
this.comboBoxType.Name = "comboBoxType";
this.comboBoxType.Size = new System.Drawing.Size(200, 37);
this.comboBoxType.TabIndex = 4;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label1.Location = new System.Drawing.Point(0, 86);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(63, 31);
this.label1.TabIndex = 5;
this.label1.Text = "Артикул";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label2.Location = new System.Drawing.Point(0, 129);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(96, 31);
this.label2.TabIndex = 6;
this.label2.Text = "Наименование ";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label3.Location = new System.Drawing.Point(0, 170);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(119, 31);
this.label3.TabIndex = 7;
this.label3.Text = "Минимальная цена";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label4.Location = new System.Drawing.Point(0, 209);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(34, 31);
this.label4.TabIndex = 8;
this.label4.Text = "Тип";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label5.Location = new System.Drawing.Point(0, 253);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(60, 31);
this.label5.TabIndex = 9;
this.label5.Text = "Ширина";
//
// btnAdd
//
this.btnAdd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(96)))), ((int)(((byte)(51)))));
this.btnAdd.Font = new System.Drawing.Font("Gabriola", 20.25F);
this.btnAdd.Location = new System.Drawing.Point(162, 306);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(126, 55);
this.btnAdd.TabIndex = 10;
this.btnAdd.Text = "Добавить";
this.btnAdd.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.btnAdd.UseVisualStyleBackColor = false;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.label6.Font = new System.Drawing.Font("Gabriola", 26.25F);
this.label6.Location = new System.Drawing.Point(105, 9);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(237, 65);
this.label6.TabIndex = 11;
this.label6.Text = "Форма добавления";
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.button1.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.button1.Location = new System.Drawing.Point(337, 365);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(68, 35);
this.button1.TabIndex = 12;
this.button1.Text = "Назад";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// AddProductForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(417, 412);
this.Controls.Add(this.button1);
this.Controls.Add(this.label6);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBoxType);
this.Controls.Add(this.NameProd);
this.Controls.Add(this.MinPrice);
this.Controls.Add(this.Width);
this.Controls.Add(this.Article);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "AddProductForm";
this.Text = "AddProductForm";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox Article;
private System.Windows.Forms.TextBox Width;
private System.Windows.Forms.TextBox MinPrice;
private System.Windows.Forms.TextBox NameProd;
private System.Windows.Forms.ComboBox comboBoxType;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button button1;
}
}

125
AddProductForm.cs Normal file
View File

@ -0,0 +1,125 @@
using MySql.Data.MySqlClient;
using System;
using System.Data;
using System.Windows.Forms;
namespace megadem
{
public partial class AddProductForm : Form
{
public AddProductForm()
{
InitializeComponent();
LoadTypes();
}
private void LoadTypes()
{
DB db = new DB();
DataTable types = new DataTable();
MySqlDataAdapter adapter = new MySqlDataAdapter();
MySqlCommand command = new MySqlCommand("SELECT ProductType FROM Product_type", db.getConnection());
try
{
db.openConnection();
adapter.SelectCommand = command;
adapter.Fill(types);
comboBoxType.DataSource = types;
comboBoxType.DisplayMember = "ProductType";
comboBoxType.ValueMember = "ProductType";
}
catch (Exception ex)
{
MessageBox.Show("Ошибка загрузки типов " + ex.Message);
}
finally
{
db.closeConnection();
}
}
private async void btnAdd_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(Article.Text) || string.IsNullOrEmpty(NameProd.Text) || string.IsNullOrEmpty(MinPrice.Text) || string.IsNullOrEmpty(Width.Text))
{
MessageBox.Show("Заполните все обязательные поля!");
return;
}
if (!decimal.TryParse(MinPrice.Text, out decimal price) || price <= 0)
{
MessageBox.Show("Пожалуйста введите корректное значение цены");
return;
}
DB db = new DB();
try
{
db.openConnection();
string query = "INSERT INTO Product (Product_type_id, Product_name, Article, Min_price_partner, Width)" +
"VALUES ((SELECT idProduct_type FROM Product_type WHERE ProductType = @type), @pr_name, @article, @price, @sale)";
using (MySqlCommand command = new MySqlCommand(query, db.getConnection()))
{
command.Parameters.AddWithValue("@article", Article.Text);
command.Parameters.AddWithValue("@pr_name", NameProd.Text);
command.Parameters.AddWithValue("@price", price);
command.Parameters.AddWithValue("@type", comboBoxType.SelectedValue.ToString());
command.Parameters.AddWithValue("@sale", Width.Text);
int rowsAffected = await command.ExecuteNonQueryAsync();
if (rowsAffected > 0)
{
MessageBox.Show("Товар успешно добавлен!");
DialogResult = DialogResult.OK;
this.Hide();
MainForm form = new MainForm();
form.Show();
}
else
{
MessageBox.Show("Ошибка при добавлении продукта.");
}
}
}
catch (MySqlException ex)
{
if (ex.Number == 1452)
{
MessageBox.Show("Указанная категория не существует. Введите допустимое название категории.");
}
else
{
MessageBox.Show("Ошибка базы данных: " + ex.Message);
}
}
catch (Exception ex)
{
MessageBox.Show("Произошла: " + ex.Message);
}
finally
{
db.closeConnection();
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
MainForm mainForm = new MainForm();
mainForm.Show();
}
}
}

120
AddProductForm.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>

18
App.config Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

29
DB.cs Normal file
View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
namespace megadem
{
internal class DB
{
MySqlConnection connection = new MySqlConnection("server=cfif31.ru;port=3306;username=ISPr25-21_MalykhinID;password=ISPr25-21_MalykhinID;database=ISPr25-21_MalykhinID_Dem2");
public void openConnection()
{
if (connection.State == System.Data.ConnectionState.Closed)
connection.Open();
}
public void closeConnection()
{
if (connection.State == System.Data.ConnectionState.Open)
connection.Close();
}
public MySqlConnection getConnection()
{
return connection;
}
}
}

215
EditProductForm.Designer.cs generated Normal file
View File

@ -0,0 +1,215 @@
namespace megadem
{
partial class EditProductForm
{
/// <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()
{
this.btnRdct = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.comboBoxType = new System.Windows.Forms.ComboBox();
this.NameProd = new System.Windows.Forms.TextBox();
this.MinPrice = new System.Windows.Forms.TextBox();
this.Width = new System.Windows.Forms.TextBox();
this.Article = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnRdct
//
this.btnRdct.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(96)))), ((int)(((byte)(51)))));
this.btnRdct.Font = new System.Drawing.Font("Gabriola", 20.25F);
this.btnRdct.Location = new System.Drawing.Point(145, 292);
this.btnRdct.Name = "btnRdct";
this.btnRdct.Size = new System.Drawing.Size(174, 54);
this.btnRdct.TabIndex = 21;
this.btnRdct.Text = "Редактировать";
this.btnRdct.UseVisualStyleBackColor = false;
this.btnRdct.Click += new System.EventHandler(this.btnAdd_Click);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label5.Location = new System.Drawing.Point(2, 256);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(60, 31);
this.label5.TabIndex = 20;
this.label5.Text = "Ширина";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label4.Location = new System.Drawing.Point(2, 210);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(34, 31);
this.label4.TabIndex = 19;
this.label4.Text = "Тип";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label3.Location = new System.Drawing.Point(2, 167);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(119, 31);
this.label3.TabIndex = 18;
this.label3.Text = "Минимальная цена";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label2.Location = new System.Drawing.Point(2, 128);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(96, 31);
this.label2.TabIndex = 17;
this.label2.Text = "Наименование ";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label1.Location = new System.Drawing.Point(2, 85);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(63, 31);
this.label1.TabIndex = 16;
this.label1.Text = "Артикул";
//
// comboBoxType
//
this.comboBoxType.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.comboBoxType.FormattingEnabled = true;
this.comboBoxType.Location = new System.Drawing.Point(127, 208);
this.comboBoxType.Name = "comboBoxType";
this.comboBoxType.Size = new System.Drawing.Size(211, 37);
this.comboBoxType.TabIndex = 15;
//
// NameProd
//
this.NameProd.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.NameProd.Location = new System.Drawing.Point(127, 126);
this.NameProd.Name = "NameProd";
this.NameProd.Size = new System.Drawing.Size(211, 35);
this.NameProd.TabIndex = 14;
//
// MinPrice
//
this.MinPrice.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.MinPrice.Location = new System.Drawing.Point(127, 167);
this.MinPrice.Name = "MinPrice";
this.MinPrice.Size = new System.Drawing.Size(211, 35);
this.MinPrice.TabIndex = 13;
//
// Width
//
this.Width.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.Width.Location = new System.Drawing.Point(127, 251);
this.Width.Name = "Width";
this.Width.Size = new System.Drawing.Size(211, 35);
this.Width.TabIndex = 12;
//
// Article
//
this.Article.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.Article.Location = new System.Drawing.Point(127, 85);
this.Article.Name = "Article";
this.Article.ReadOnly = true;
this.Article.Size = new System.Drawing.Size(211, 35);
this.Article.TabIndex = 11;
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.label6.Font = new System.Drawing.Font("Gabriola", 26.25F);
this.label6.Location = new System.Drawing.Point(77, 9);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(300, 65);
this.label6.TabIndex = 22;
this.label6.Text = "Форма редактирования";
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.button1.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.button1.Location = new System.Drawing.Point(362, 341);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(68, 35);
this.button1.TabIndex = 23;
this.button1.Text = "Назад";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// EditProductForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(442, 388);
this.Controls.Add(this.button1);
this.Controls.Add(this.label6);
this.Controls.Add(this.btnRdct);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBoxType);
this.Controls.Add(this.NameProd);
this.Controls.Add(this.MinPrice);
this.Controls.Add(this.Width);
this.Controls.Add(this.Article);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "EditProductForm";
this.Text = "EditProductForm";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnRdct;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox comboBoxType;
private System.Windows.Forms.TextBox NameProd;
private System.Windows.Forms.TextBox MinPrice;
private System.Windows.Forms.TextBox Width;
private System.Windows.Forms.TextBox Article;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button button1;
}
}

143
EditProductForm.cs Normal file
View File

@ -0,0 +1,143 @@
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
namespace megadem
{
public partial class EditProductForm : Form
{
private string productID;
public EditProductForm(string productID)
{
InitializeComponent();
LoadTypes();
LoadProductData(productID);
}
private void LoadProductData(string productId)
{
try
{
DB db = new DB();
using (MySqlConnection connection = db.getConnection())
{
connection.Open();
string query = "SELECT Product_name, Product_type_id, Min_price_partner, Width FROM Product WHERE Article = @id";
using (MySqlCommand command = new MySqlCommand(query, connection))
{
command.Parameters.AddWithValue("@id", productId);
using (MySqlDataReader reader = command.ExecuteReader())
{
if (reader.Read())
{
Article.Text = productId;
NameProd.Text = reader["product_name"].ToString();
comboBoxType.Text = reader["Product_type_id"].ToString();
MinPrice.Text = reader["Min_price_partner"].ToString();
Width.Text = reader["Width"].ToString();
}
else
{
MessageBox.Show("Продукт с указанным ID не найден.");
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}
}
}
catch (MySqlException ex)
{
MessageBox.Show("Ошибка при загрузке данных продукта: " + ex.Message);
}
}
private void LoadTypes()
{
try
{
DB db = new DB();
using (MySqlConnection connection = db.getConnection())
{
connection.Open();
string query = "SELECT idProduct_Type, ProductType FROM Product_type";
using (MySqlCommand command = new MySqlCommand(query, connection))
{
using (MySqlDataReader reader = command.ExecuteReader())
{
DataTable typeTable = new DataTable();
typeTable.Load(reader);
comboBoxType.DataSource = typeTable;
comboBoxType.DisplayMember = "ProductType";
comboBoxType.ValueMember = "idProduct_Type";
}
}
}
}
catch (MySqlException ex)
{
MessageBox.Show("Ошибка при загрузке категорий: " + ex.Message);
}
}
private void btnAdd_Click(object sender, EventArgs e)
{
try
{
object typeId = comboBoxType.SelectedValue;
DB db = new DB();
using (MySqlConnection connection = db.getConnection())
{
connection.Open();
string query = "UPDATE Product SET Product_name = @pr_name, Product_type_id = @type, Min_price_partner = @price, Width = @width WHERE Article = @id";
using (MySqlCommand command = new MySqlCommand(query, connection))
{
command.Parameters.AddWithValue("@id", Article.Text);
command.Parameters.AddWithValue("@width", Convert.ToDecimal(Width.Text));
command.Parameters.AddWithValue("@pr_name", NameProd.Text);
command.Parameters.AddWithValue("@type", typeId);
command.Parameters.AddWithValue("@price", Convert.ToDecimal(MinPrice.Text));
int rowsAffected = command.ExecuteNonQuery();
if (rowsAffected > 0)
{
MessageBox.Show("Данные продукта успешно обновлены.");
this.DialogResult = DialogResult.OK;
this.Hide();
MainForm form = new MainForm();
form.Show();
}
else
{
MessageBox.Show("Не удалось обновить данные продукта.");
}
}
}
}
catch (MySqlException ex)
{
MessageBox.Show("Ошибка при сохранении данных продукта: " + ex.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
MainForm mainForm = new MainForm();
mainForm.Show();
}
}
}

120
EditProductForm.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>

344
MainForm.Designer.cs generated Normal file
View File

@ -0,0 +1,344 @@
namespace megadem
{
partial class MainForm
{
/// <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 Код, автоматически созданный конструктором форм Windows
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
this.DataGridViewProduct = new System.Windows.Forms.DataGridView();
this.panel1 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.textBoxName = new System.Windows.Forms.TextBox();
this.textBoxPrice = new System.Windows.Forms.TextBox();
this.textBoxMinPrice = new System.Windows.Forms.TextBox();
this.textBoxWidth = new System.Windows.Forms.TextBox();
this.textBoxType = new System.Windows.Forms.TextBox();
this.textBoxArticle = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.label8 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.button4 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.DataGridViewProduct)).BeginInit();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// DataGridViewProduct
//
this.DataGridViewProduct.AllowUserToAddRows = false;
this.DataGridViewProduct.AllowUserToDeleteRows = false;
this.DataGridViewProduct.AllowUserToResizeColumns = false;
this.DataGridViewProduct.AllowUserToResizeRows = false;
this.DataGridViewProduct.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
this.DataGridViewProduct.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.DataGridViewProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DataGridViewProduct.Location = new System.Drawing.Point(48, 79);
this.DataGridViewProduct.Name = "DataGridViewProduct";
this.DataGridViewProduct.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.DataGridViewProduct.Size = new System.Drawing.Size(701, 237);
this.DataGridViewProduct.TabIndex = 0;
this.DataGridViewProduct.Click += new System.EventHandler(this.dataGridViewProd_Click);
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.panel2);
this.panel1.Location = new System.Drawing.Point(121, 322);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(547, 202);
this.panel1.TabIndex = 1;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel2.Controls.Add(this.textBoxArticle);
this.panel2.Controls.Add(this.textBoxType);
this.panel2.Controls.Add(this.textBoxWidth);
this.panel2.Controls.Add(this.textBoxMinPrice);
this.panel2.Controls.Add(this.textBoxPrice);
this.panel2.Controls.Add(this.textBoxName);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.label6);
this.panel2.Controls.Add(this.label5);
this.panel2.Controls.Add(this.label4);
this.panel2.Controls.Add(this.label3);
this.panel2.Controls.Add(this.label2);
this.panel2.Controls.Add(this.label1);
this.panel2.Location = new System.Drawing.Point(25, 17);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(491, 166);
this.panel2.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label1.Location = new System.Drawing.Point(21, -1);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(34, 31);
this.label1.TabIndex = 0;
this.label1.Text = "Тип";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(99, 10);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(10, 13);
this.label2.TabIndex = 1;
this.label2.Text = "I";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label3.Location = new System.Drawing.Point(134, -1);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(149, 31);
this.label3.TabIndex = 2;
this.label3.Text = "Наименование продукта";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label4.Location = new System.Drawing.Point(9, 64);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 31);
this.label4.TabIndex = 3;
this.label4.Text = "Артикул:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label5.Location = new System.Drawing.Point(3, 92);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(239, 31);
this.label5.TabIndex = 4;
this.label5.Text = "Минимальная стоимость для партнера:";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label6.Location = new System.Drawing.Point(9, 126);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(63, 31);
this.label6.TabIndex = 5;
this.label6.Text = "Ширина:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.label7.Location = new System.Drawing.Point(381, -1);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(81, 31);
this.label7.TabIndex = 6;
this.label7.Text = "Стоимость:";
//
// textBoxName
//
this.textBoxName.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.textBoxName.Location = new System.Drawing.Point(113, 26);
this.textBoxName.Name = "textBoxName";
this.textBoxName.Size = new System.Drawing.Size(179, 35);
this.textBoxName.TabIndex = 7;
//
// textBoxPrice
//
this.textBoxPrice.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.textBoxPrice.Location = new System.Drawing.Point(372, 26);
this.textBoxPrice.Name = "textBoxPrice";
this.textBoxPrice.Size = new System.Drawing.Size(100, 35);
this.textBoxPrice.TabIndex = 8;
//
// textBoxMinPrice
//
this.textBoxMinPrice.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.textBoxMinPrice.Location = new System.Drawing.Point(248, 89);
this.textBoxMinPrice.Name = "textBoxMinPrice";
this.textBoxMinPrice.Size = new System.Drawing.Size(100, 35);
this.textBoxMinPrice.TabIndex = 9;
//
// textBoxWidth
//
this.textBoxWidth.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.textBoxWidth.Location = new System.Drawing.Point(78, 126);
this.textBoxWidth.Name = "textBoxWidth";
this.textBoxWidth.Size = new System.Drawing.Size(100, 35);
this.textBoxWidth.TabIndex = 10;
//
// textBoxType
//
this.textBoxType.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.textBoxType.Location = new System.Drawing.Point(3, 26);
this.textBoxType.Name = "textBoxType";
this.textBoxType.Size = new System.Drawing.Size(81, 35);
this.textBoxType.TabIndex = 11;
//
// textBoxArticle
//
this.textBoxArticle.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.textBoxArticle.Location = new System.Drawing.Point(81, 64);
this.textBoxArticle.Name = "textBoxArticle";
this.textBoxArticle.Size = new System.Drawing.Size(100, 35);
this.textBoxArticle.TabIndex = 12;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(96)))), ((int)(((byte)(51)))));
this.button1.Font = new System.Drawing.Font("Gabriola", 20.25F);
this.button1.Location = new System.Drawing.Point(48, 530);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(173, 61);
this.button1.TabIndex = 2;
this.button1.Text = "Добавить";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(96)))), ((int)(((byte)(51)))));
this.button2.Font = new System.Drawing.Font("Gabriola", 20.25F);
this.button2.Location = new System.Drawing.Point(554, 530);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(195, 61);
this.button2.TabIndex = 3;
this.button2.Text = "Редактировать";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.label8.Font = new System.Drawing.Font("Gabriola", 26.25F);
this.label8.Location = new System.Drawing.Point(300, 9);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(237, 65);
this.label8.TabIndex = 12;
this.label8.Text = "Форма добавления";
//
// button3
//
this.button3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.button3.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.button3.Location = new System.Drawing.Point(720, 9);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(68, 35);
this.button3.TabIndex = 24;
this.button3.Text = "Выйти";
this.button3.UseVisualStyleBackColor = false;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// pictureBox1
//
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureBox1.Location = new System.Drawing.Point(48, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(58, 50);
this.pictureBox1.TabIndex = 25;
this.pictureBox1.TabStop = false;
//
// button4
//
this.button4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(96)))), ((int)(((byte)(51)))));
this.button4.Font = new System.Drawing.Font("Gabriola", 20.25F);
this.button4.Location = new System.Drawing.Point(311, 530);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(173, 61);
this.button4.TabIndex = 26;
this.button4.Text = "Материалы";
this.button4.UseVisualStyleBackColor = false;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 596);
this.Controls.Add(this.button4);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.button3);
this.Controls.Add(this.label8);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.DataGridViewProduct);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "MainForm";
this.Text = "Form1";
this.Load += new System.EventHandler(this.MainForm_Load);
((System.ComponentModel.ISupportInitialize)(this.DataGridViewProduct)).EndInit();
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DataGridView DataGridViewProduct;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBoxWidth;
private System.Windows.Forms.TextBox textBoxMinPrice;
private System.Windows.Forms.TextBox textBoxPrice;
private System.Windows.Forms.TextBox textBoxName;
private System.Windows.Forms.TextBox textBoxArticle;
private System.Windows.Forms.TextBox textBoxType;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button button4;
}
}

130
MainForm.cs Normal file
View File

@ -0,0 +1,130 @@
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;
using System.Xml;
using MySql.Data.MySqlClient;
namespace megadem
{
public partial class MainForm : Form
{
private MySqlDataAdapter dataAdapter;
private DataTable prodTable;
private BindingSource bindingSource = new BindingSource();
public MainForm()
{
InitializeComponent();
LoadProdData();
LoadImageFromResources();
}
private void LoadProdData() // загрузка данных в дгв
{
try
{
DB db = new DB();
using (MySqlConnection connection = db.getConnection())
{
connection.Open();
string query = "SELECT Article AS `Артикул`, Product_name AS `Наименование продукта`, ProductType AS `Тип продукта`, Min_price_partner AS `Минимальная цена для партнера`, Width AS `Ширина` FROM Product LEFT JOIN Product_type ON Product.Product_type_id = idProduct_type";
dataAdapter = new MySqlDataAdapter(query, connection);
prodTable = new DataTable();
dataAdapter.Fill(prodTable);
DataGridViewProduct.RowTemplate.Height = 60;
bindingSource.DataSource = prodTable;
DataGridViewProduct.DataSource = bindingSource;
DataGridViewProduct.AllowUserToAddRows = false;
DataGridViewProduct.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
DataGridViewProduct.ReadOnly = true; // настройки дгв
}
}
catch (MySqlException ex)
{
MessageBox.Show("Ошибка при подключении к базе данных или выполнении запроса: " + ex.Message);
}
catch (Exception ex)
{
MessageBox.Show("Произошла общая ошибка: " + ex.Message);
}
}
private void dataGridViewProd_Click(object sender, EventArgs e)
{
textBoxName.Text = DataGridViewProduct.CurrentRow.Cells[1].Value.ToString();
textBoxWidth.Text = DataGridViewProduct.CurrentRow.Cells[4].Value.ToString() +" (М)";
textBoxArticle.Text = DataGridViewProduct.CurrentRow.Cells[0].Value.ToString();
textBoxMinPrice.Text = DataGridViewProduct.CurrentRow.Cells[3].Value.ToString() + " (Р)";
textBoxType.Text = DataGridViewProduct.CurrentRow.Cells[2].Value.ToString();
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
AddProductForm form = new AddProductForm();
form.ShowDialog();
LoadProdData();
}
private void button2_Click(object sender, EventArgs e)
{
if (DataGridViewProduct.SelectedRows.Count > 0)
{
string articleToEdit = Convert.ToString(DataGridViewProduct.SelectedRows[0].Cells["Артикул"].Value);
EditProductForm editProductForm = new EditProductForm(articleToEdit);
this.Hide();
DialogResult result = editProductForm.ShowDialog();
if (result == DialogResult.OK)
{
LoadProdData();
}
}
else
{
MessageBox.Show("Пожалуйста, выберите строку для редактирования.");
}
}
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void MainForm_Load(object sender, EventArgs e)
{
}
private void LoadImageFromResources()
{
// Предполагаем, что вы назвали изображение в ресурсах "MyImage"
// (замените "MyImage" на фактическое имя вашего ресурса изображения)
pictureBox1.Image = Properties.Resources.decor;
// Опционально: настроить режим отображения изображения
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; // Или StretchImage, Normal, CenterImage
}
private void button4_Click(object sender, EventArgs e)
{
this.Hide();
MaterialForm materialForm = new MaterialForm();
materialForm.Show();
}
}
}

120
MainForm.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>

98
MaterialForm.Designer.cs generated Normal file
View File

@ -0,0 +1,98 @@
namespace megadem
{
partial class MaterialForm
{
/// <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()
{
this.dataGridViewMaterial = new System.Windows.Forms.DataGridView();
this.button1 = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dataGridViewMaterial)).BeginInit();
this.SuspendLayout();
//
// dataGridViewMaterial
//
this.dataGridViewMaterial.AllowUserToAddRows = false;
this.dataGridViewMaterial.AllowUserToDeleteRows = false;
this.dataGridViewMaterial.AllowUserToResizeColumns = false;
this.dataGridViewMaterial.AllowUserToResizeRows = false;
this.dataGridViewMaterial.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
this.dataGridViewMaterial.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.dataGridViewMaterial.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridViewMaterial.Location = new System.Drawing.Point(55, 97);
this.dataGridViewMaterial.Name = "dataGridViewMaterial";
this.dataGridViewMaterial.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridViewMaterial.Size = new System.Drawing.Size(694, 291);
this.dataGridViewMaterial.TabIndex = 0;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.button1.Font = new System.Drawing.Font("Gabriola", 12.25F);
this.button1.Location = new System.Drawing.Point(367, 402);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(68, 35);
this.button1.TabIndex = 13;
this.button1.Text = "Назад";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(187)))), ((int)(((byte)(217)))), ((int)(((byte)(178)))));
this.label6.Font = new System.Drawing.Font("Gabriola", 26.25F);
this.label6.Location = new System.Drawing.Point(314, 9);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(165, 65);
this.label6.TabIndex = 14;
this.label6.Text = "Материалы";
//
// MaterialForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 453);
this.Controls.Add(this.label6);
this.Controls.Add(this.button1);
this.Controls.Add(this.dataGridViewMaterial);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "MaterialForm";
this.Text = "MaterialForm";
((System.ComponentModel.ISupportInitialize)(this.dataGridViewMaterial)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DataGridView dataGridViewMaterial;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label6;
}
}

67
MaterialForm.cs Normal file
View File

@ -0,0 +1,67 @@
using MySql.Data.MySqlClient;
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;
namespace megadem
{
public partial class MaterialForm : Form
{
private MySqlDataAdapter dataAdapter;
private DataTable prodTable;
private BindingSource bindingSource = new BindingSource();
public MaterialForm()
{
InitializeComponent();
LoadProdData();
}
private void LoadProdData() // загрузка данных в дгв
{
try
{
DB db = new DB();
using (MySqlConnection connection = db.getConnection())
{
connection.Open();
string query = "SELECT Product_name AS `Название продукта`, Material_name AS `Название материала`, Quantity_of_material AS `Количество материала` FROM ProductMaterial LEFT JOIN Product ON Product.idProduct = ProductMaterial.ProductID LEFT JOIN Material ON Material.Material_name = ProductMaterial.MaterialID";
dataAdapter = new MySqlDataAdapter(query, connection);
prodTable = new DataTable();
dataAdapter.Fill(prodTable);
dataGridViewMaterial.RowTemplate.Height = 60;
bindingSource.DataSource = prodTable;
dataGridViewMaterial.DataSource = bindingSource;
dataGridViewMaterial.AllowUserToAddRows = false;
dataGridViewMaterial.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
dataGridViewMaterial.ReadOnly = true; // настройки дгв
}
}
catch (MySqlException ex)
{
MessageBox.Show("Ошибка при подключении к базе данных или выполнении запроса: " + ex.Message);
}
catch (Exception ex)
{
MessageBox.Show("Произошла общая ошибка: " + ex.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
MainForm form = new MainForm();
form.Show();
}
}
}

120
MaterialForm.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>

22
Program.cs Normal file
View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace megadem
{
internal static class Program
{
/// <summary>
/// Главная точка входа для приложения.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Общие сведения об этой сборке предоставляются следующим набором
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// связанных со сборкой.
[assembly: AssemblyTitle("megadem")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("megadem")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
[assembly: ComVisible(false)]
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("d95767eb-b12c-4bfc-9a75-3c15e0caa10d")]
// Сведения о версии сборки состоят из указанных ниже четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

73
Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,73 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace megadem.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("megadem.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 decor {
get {
object obj = ResourceManager.GetObject("decor", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

124
Properties/Resources.resx Normal file
View 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="decor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Наш декор.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

30
Properties/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace megadem.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

165
megadem.csproj Normal file
View File

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D95767EB-B12C-4BFC-9A75-3C15E0CAA10D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>megadem</RootNamespace>
<AssemblyName>megadem</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
<HintPath>packages\BouncyCastle.Cryptography.2.6.2\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf, Version=3.32.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>packages\Google.Protobuf.3.32.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>packages\K4os.Compression.LZ4.1.3.8\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>packages\K4os.Compression.LZ4.Streams.1.3.8\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=9.5.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>packages\MySql.Data.9.5.0\lib\net48\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.ConfigurationManager, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Configuration.ConfigurationManager.8.0.0\lib\net462\System.Configuration.ConfigurationManager.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="ZstdSharp, Version=0.8.6.0, Culture=neutral, PublicKeyToken=8d151af33a4ad5cf, processorArchitecture=MSIL">
<HintPath>packages\ZstdSharp.Port.0.8.6\lib\net462\ZstdSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AddProductForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AddProductForm.Designer.cs">
<DependentUpon>AddProductForm.cs</DependentUpon>
</Compile>
<Compile Include="DB.cs" />
<Compile Include="EditProductForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="EditProductForm.Designer.cs">
<DependentUpon>EditProductForm.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="MaterialForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MaterialForm.Designer.cs">
<DependentUpon>MaterialForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="AddProductForm.resx">
<DependentUpon>AddProductForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="EditProductForm.resx">
<DependentUpon>EditProductForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MaterialForm.resx">
<DependentUpon>MaterialForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Наш декор.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

25
megadem.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34511.84
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "megadem", "megadem.csproj", "{D95767EB-B12C-4BFC-9A75-3C15E0CAA10D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D95767EB-B12C-4BFC-9A75-3C15E0CAA10D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D95767EB-B12C-4BFC-9A75-3C15E0CAA10D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D95767EB-B12C-4BFC-9A75-3C15E0CAA10D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D95767EB-B12C-4BFC-9A75-3C15E0CAA10D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {369DFD79-5020-4F80-966D-6734703A7FAD}
EndGlobalSection
EndGlobal

18
packages.config Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle.Cryptography" version="2.6.2" targetFramework="net48" />
<package id="Google.Protobuf" version="3.32.0" targetFramework="net48" />
<package id="K4os.Compression.LZ4" version="1.3.8" targetFramework="net48" />
<package id="K4os.Compression.LZ4.Streams" version="1.3.8" targetFramework="net48" />
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net48" />
<package id="MySql.Data" version="9.5.0" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Configuration.ConfigurationManager" version="8.0.0" targetFramework="net48" />
<package id="System.IO.Pipelines" version="5.0.2" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
<package id="ZstdSharp.Port" version="0.8.6" targetFramework="net48" />
</packages>