commit 35fa303719cf64881100c22dd73c21ab8c3aeab2 Author: Ilya Date: Tue Nov 25 12:59:48 2025 +0400 Malyhin Merkulov diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9491a2f --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/AddProductForm.Designer.cs b/AddProductForm.Designer.cs new file mode 100644 index 0000000..9796947 --- /dev/null +++ b/AddProductForm.Designer.cs @@ -0,0 +1,215 @@ +namespace megadem +{ + partial class AddProductForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + 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; + } +} \ No newline at end of file diff --git a/AddProductForm.cs b/AddProductForm.cs new file mode 100644 index 0000000..f3f6f74 --- /dev/null +++ b/AddProductForm.cs @@ -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(); + } + } +} diff --git a/AddProductForm.resx b/AddProductForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/AddProductForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/App.config b/App.config new file mode 100644 index 0000000..abb8196 --- /dev/null +++ b/App.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DB.cs b/DB.cs new file mode 100644 index 0000000..3c1352c --- /dev/null +++ b/DB.cs @@ -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; + } + } +} diff --git a/EditProductForm.Designer.cs b/EditProductForm.Designer.cs new file mode 100644 index 0000000..2a9983c --- /dev/null +++ b/EditProductForm.Designer.cs @@ -0,0 +1,215 @@ +namespace megadem +{ + partial class EditProductForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + 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; + } +} \ No newline at end of file diff --git a/EditProductForm.cs b/EditProductForm.cs new file mode 100644 index 0000000..b0c12ea --- /dev/null +++ b/EditProductForm.cs @@ -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(); + } + } +} diff --git a/EditProductForm.resx b/EditProductForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/EditProductForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs new file mode 100644 index 0000000..6323c54 --- /dev/null +++ b/MainForm.Designer.cs @@ -0,0 +1,344 @@ +namespace megadem +{ + partial class MainForm + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором форм Windows + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + 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; + } +} + diff --git a/MainForm.cs b/MainForm.cs new file mode 100644 index 0000000..4ad6fff --- /dev/null +++ b/MainForm.cs @@ -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(); + } + } +} diff --git a/MainForm.resx b/MainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MaterialForm.Designer.cs b/MaterialForm.Designer.cs new file mode 100644 index 0000000..533a326 --- /dev/null +++ b/MaterialForm.Designer.cs @@ -0,0 +1,98 @@ +namespace megadem +{ + partial class MaterialForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + 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; + } +} \ No newline at end of file diff --git a/MaterialForm.cs b/MaterialForm.cs new file mode 100644 index 0000000..8111213 --- /dev/null +++ b/MaterialForm.cs @@ -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(); + } + } + +} diff --git a/MaterialForm.resx b/MaterialForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MaterialForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..c1f6d7d --- /dev/null +++ b/Program.cs @@ -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 + { + /// + /// Главная точка входа для приложения. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..eb4dc4a --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -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")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..6b86c14 --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace megadem.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("megadem.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap decor { + get { + object obj = ResourceManager.GetObject("decor", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..cf13725 --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\Наш декор.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6a4afa7 --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +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; + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Resources/Наш декор.png b/Resources/Наш декор.png new file mode 100644 index 0000000..7e8c945 Binary files /dev/null and b/Resources/Наш декор.png differ diff --git a/megadem.csproj b/megadem.csproj new file mode 100644 index 0000000..2178b04 --- /dev/null +++ b/megadem.csproj @@ -0,0 +1,165 @@ + + + + + Debug + AnyCPU + {D95767EB-B12C-4BFC-9A75-3C15E0CAA10D} + WinExe + megadem + megadem + v4.8 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + packages\BouncyCastle.Cryptography.2.6.2\lib\net461\BouncyCastle.Cryptography.dll + + + packages\Google.Protobuf.3.32.0\lib\net45\Google.Protobuf.dll + + + packages\K4os.Compression.LZ4.1.3.8\lib\net462\K4os.Compression.LZ4.dll + + + packages\K4os.Compression.LZ4.Streams.1.3.8\lib\net462\K4os.Compression.LZ4.Streams.dll + + + packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll + + + packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + + + packages\MySql.Data.9.5.0\lib\net48\MySql.Data.dll + + + + packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + packages\System.Configuration.ConfigurationManager.8.0.0\lib\net462\System.Configuration.ConfigurationManager.dll + + + + packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll + + + + packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + + packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + + + + + + + + + + + packages\ZstdSharp.Port.0.8.6\lib\net462\ZstdSharp.dll + + + + + Form + + + AddProductForm.cs + + + + Form + + + EditProductForm.cs + + + Form + + + MainForm.cs + + + Form + + + MaterialForm.cs + + + + + AddProductForm.cs + + + EditProductForm.cs + + + MainForm.cs + + + MaterialForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + \ No newline at end of file diff --git a/megadem.sln b/megadem.sln new file mode 100644 index 0000000..80abda5 --- /dev/null +++ b/megadem.sln @@ -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 diff --git a/packages.config b/packages.config new file mode 100644 index 0000000..58c7848 --- /dev/null +++ b/packages.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file