From 595c54a854efe0d20b8dc33006ac5690ddb1daf0 Mon Sep 17 00:00:00 2001 From: adik Date: Mon, 17 Nov 2025 16:26:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D1=8C=D1=82?= =?UTF-8?q?=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 63 +++++ .gitignore | 363 +++++++++++++++++++++++++++ App.config | 18 ++ DB.cs | 29 +++ LoginForm.Designer.cs | 82 +++++++ LoginForm.cs | 65 +++++ LoginForm.resx | 120 +++++++++ MainForm.Designer.cs | 407 +++++++++++++++++++++++++++++++ MainForm.cs | 226 +++++++++++++++++ MainForm.resx | 120 +++++++++ Program.cs | 22 ++ Properties/AssemblyInfo.cs | 36 +++ Properties/Resources.Designer.cs | 71 ++++++ Properties/Resources.resx | 117 +++++++++ Properties/Settings.Designer.cs | 30 +++ Properties/Settings.settings | 7 + packages.config | 22 ++ zadanie4.csproj | 155 ++++++++++++ zadanie4.sln | 25 ++ 19 files changed, 1978 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 App.config create mode 100644 DB.cs create mode 100644 LoginForm.Designer.cs create mode 100644 LoginForm.cs create mode 100644 LoginForm.resx create mode 100644 MainForm.Designer.cs create mode 100644 MainForm.cs create mode 100644 MainForm.resx create mode 100644 Program.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 Properties/Resources.Designer.cs create mode 100644 Properties/Resources.resx create mode 100644 Properties/Settings.Designer.cs create mode 100644 Properties/Settings.settings create mode 100644 packages.config create mode 100644 zadanie4.csproj create mode 100644 zadanie4.sln 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/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..2a9f5a9 --- /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 zadanie4 +{ + internal class DB + { + MySqlConnection connection = new MySqlConnection("server=cfif31.ru;port=3306;username=ISPr25-21_MalykhinID;password=ISPr25-21_MalykhinID;database=ISPr25-21_MalykhinID_zadanie4"); + + 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/LoginForm.Designer.cs b/LoginForm.Designer.cs new file mode 100644 index 0000000..082e874 --- /dev/null +++ b/LoginForm.Designer.cs @@ -0,0 +1,82 @@ +namespace zadanie4 +{ + partial class LoginForm + { + /// + /// Обязательная переменная конструктора. + /// + 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.button1 = new System.Windows.Forms.Button(); + this.loginField = new System.Windows.Forms.TextBox(); + this.passField = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(142, 269); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Войти"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // loginField + // + this.loginField.Location = new System.Drawing.Point(130, 119); + this.loginField.Name = "loginField"; + this.loginField.Size = new System.Drawing.Size(100, 20); + this.loginField.TabIndex = 1; + // + // passField + // + this.passField.Location = new System.Drawing.Point(130, 186); + this.passField.Name = "passField"; + this.passField.Size = new System.Drawing.Size(100, 20); + this.passField.TabIndex = 2; + // + // LoginForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(347, 458); + this.Controls.Add(this.passField); + this.Controls.Add(this.loginField); + this.Controls.Add(this.button1); + this.Name = "LoginForm"; + this.Text = "Form1"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox loginField; + private System.Windows.Forms.TextBox passField; + } +} + diff --git a/LoginForm.cs b/LoginForm.cs new file mode 100644 index 0000000..ddcd5e7 --- /dev/null +++ b/LoginForm.cs @@ -0,0 +1,65 @@ +using MySqlX.XDevAPI; +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 MySql.Data.MySqlClient; + +namespace zadanie4 +{ + public partial class LoginForm : Form + { + public LoginForm() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + string loginUser = loginField.Text; + string passUser = passField.Text; + + if (string.IsNullOrWhiteSpace(loginField.Text)) + { + MessageBox.Show("Введите логин.", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + + if (string.IsNullOrWhiteSpace(passField.Text)) + { + MessageBox.Show("Введите логин.", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + + DB db = new DB(); + + DataTable table = new DataTable(); + + MySqlDataAdapter adapter = new MySqlDataAdapter(); + + MySqlCommand commandAd = new MySqlCommand("SELECT * FROM `Librarians` WHERE `Librarian_Login` = @log AND `Librarian_Password` = @pass", db.getConnection()); + commandAd.Parameters.Add("@log", MySqlDbType.VarChar).Value = loginUser; + commandAd.Parameters.Add("@pass", MySqlDbType.VarChar).Value = passUser; + + adapter.SelectCommand = commandAd; + adapter.Fill(table); + + if (table.Rows.Count == 1) + { + + MessageBox.Show("Авторизация успешна."); + this.Hide(); + MainForm main = new MainForm(); + main.Show(); + } + + + + } + } +} diff --git a/LoginForm.resx b/LoginForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/LoginForm.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..550461c --- /dev/null +++ b/MainForm.Designer.cs @@ -0,0 +1,407 @@ +namespace zadanie4 +{ + partial class MainForm + { + /// + /// 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.dataGridViewProd = new System.Windows.Forms.DataGridView(); + this.textBoxSurname = new System.Windows.Forms.TextBox(); + this.textBoxName = new System.Windows.Forms.TextBox(); + this.textBoxPatronymic = new System.Windows.Forms.TextBox(); + this.textBoxGroup = new System.Windows.Forms.TextBox(); + this.textBoxSpecial = new System.Windows.Forms.TextBox(); + this.textBoxPhone = new System.Windows.Forms.TextBox(); + this.PhoneEdit = new System.Windows.Forms.TextBox(); + this.SpecialEdit = new System.Windows.Forms.TextBox(); + this.GroupEdit = new System.Windows.Forms.TextBox(); + this.PatronymicEdit = new System.Windows.Forms.TextBox(); + this.NameEdit = new System.Windows.Forms.TextBox(); + this.SurnameEdit = new System.Windows.Forms.TextBox(); + this.btnAdd = new System.Windows.Forms.Button(); + this.btnEdit = new System.Windows.Forms.Button(); + 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.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.comboBoxSort = new System.Windows.Forms.ComboBox(); + this.label14 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewProd)).BeginInit(); + this.SuspendLayout(); + // + // dataGridViewProd + // + this.dataGridViewProd.AllowUserToAddRows = false; + this.dataGridViewProd.AllowUserToDeleteRows = false; + this.dataGridViewProd.AllowUserToResizeColumns = false; + this.dataGridViewProd.AllowUserToResizeRows = false; + this.dataGridViewProd.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridViewProd.Location = new System.Drawing.Point(36, 57); + this.dataGridViewProd.Name = "dataGridViewProd"; + this.dataGridViewProd.ReadOnly = true; + this.dataGridViewProd.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridViewProd.Size = new System.Drawing.Size(723, 257); + this.dataGridViewProd.TabIndex = 0; + this.dataGridViewProd.Click += new System.EventHandler(this.dataGridViewProd_Click); + // + // textBoxSurname + // + this.textBoxSurname.Location = new System.Drawing.Point(124, 332); + this.textBoxSurname.Name = "textBoxSurname"; + this.textBoxSurname.Size = new System.Drawing.Size(235, 20); + this.textBoxSurname.TabIndex = 1; + // + // textBoxName + // + this.textBoxName.Location = new System.Drawing.Point(124, 358); + this.textBoxName.Name = "textBoxName"; + this.textBoxName.Size = new System.Drawing.Size(235, 20); + this.textBoxName.TabIndex = 2; + // + // textBoxPatronymic + // + this.textBoxPatronymic.Location = new System.Drawing.Point(124, 384); + this.textBoxPatronymic.Name = "textBoxPatronymic"; + this.textBoxPatronymic.Size = new System.Drawing.Size(235, 20); + this.textBoxPatronymic.TabIndex = 3; + // + // textBoxGroup + // + this.textBoxGroup.Location = new System.Drawing.Point(124, 410); + this.textBoxGroup.Name = "textBoxGroup"; + this.textBoxGroup.Size = new System.Drawing.Size(235, 20); + this.textBoxGroup.TabIndex = 4; + // + // textBoxSpecial + // + this.textBoxSpecial.Location = new System.Drawing.Point(124, 436); + this.textBoxSpecial.Name = "textBoxSpecial"; + this.textBoxSpecial.Size = new System.Drawing.Size(235, 20); + this.textBoxSpecial.TabIndex = 5; + // + // textBoxPhone + // + this.textBoxPhone.Location = new System.Drawing.Point(124, 462); + this.textBoxPhone.Name = "textBoxPhone"; + this.textBoxPhone.Size = new System.Drawing.Size(235, 20); + this.textBoxPhone.TabIndex = 6; + // + // PhoneEdit + // + this.PhoneEdit.Location = new System.Drawing.Point(487, 462); + this.PhoneEdit.Name = "PhoneEdit"; + this.PhoneEdit.Size = new System.Drawing.Size(233, 20); + this.PhoneEdit.TabIndex = 12; + // + // SpecialEdit + // + this.SpecialEdit.Location = new System.Drawing.Point(487, 436); + this.SpecialEdit.Name = "SpecialEdit"; + this.SpecialEdit.Size = new System.Drawing.Size(233, 20); + this.SpecialEdit.TabIndex = 11; + // + // GroupEdit + // + this.GroupEdit.Location = new System.Drawing.Point(487, 410); + this.GroupEdit.Name = "GroupEdit"; + this.GroupEdit.Size = new System.Drawing.Size(233, 20); + this.GroupEdit.TabIndex = 10; + // + // PatronymicEdit + // + this.PatronymicEdit.Location = new System.Drawing.Point(487, 384); + this.PatronymicEdit.Name = "PatronymicEdit"; + this.PatronymicEdit.Size = new System.Drawing.Size(233, 20); + this.PatronymicEdit.TabIndex = 9; + // + // NameEdit + // + this.NameEdit.Location = new System.Drawing.Point(487, 358); + this.NameEdit.Name = "NameEdit"; + this.NameEdit.Size = new System.Drawing.Size(233, 20); + this.NameEdit.TabIndex = 8; + // + // SurnameEdit + // + this.SurnameEdit.Location = new System.Drawing.Point(487, 332); + this.SurnameEdit.Name = "SurnameEdit"; + this.SurnameEdit.Size = new System.Drawing.Size(233, 20); + this.SurnameEdit.TabIndex = 7; + // + // btnAdd + // + this.btnAdd.Location = new System.Drawing.Point(195, 504); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.Size = new System.Drawing.Size(75, 23); + this.btnAdd.TabIndex = 13; + this.btnAdd.Text = "Добавить"; + this.btnAdd.UseVisualStyleBackColor = true; + this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); + // + // btnEdit + // + this.btnEdit.Location = new System.Drawing.Point(557, 504); + this.btnEdit.Name = "btnEdit"; + this.btnEdit.Size = new System.Drawing.Size(96, 23); + this.btnEdit.TabIndex = 14; + this.btnEdit.Text = "Редактировать"; + this.btnEdit.UseVisualStyleBackColor = true; + this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(62, 335); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(56, 13); + this.label1.TabIndex = 15; + this.label1.Text = "Фамилия"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(33, 361); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(0, 13); + this.label2.TabIndex = 16; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(64, 387); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(54, 13); + this.label3.TabIndex = 17; + this.label3.Text = "Отчество"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(28, 413); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(90, 13); + this.label4.TabIndex = 18; + this.label4.Text = "Группа студента"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(33, 439); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(85, 13); + this.label5.TabIndex = 19; + this.label5.Text = "Специальность"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(25, 465); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(93, 13); + this.label6.TabIndex = 20; + this.label6.Text = "Номер телефона"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(89, 361); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(29, 13); + this.label7.TabIndex = 21; + this.label7.Text = "Имя"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(452, 365); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(29, 13); + this.label8.TabIndex = 27; + this.label8.Text = "Имя"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(388, 469); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(93, 13); + this.label9.TabIndex = 26; + this.label9.Text = "Номер телефона"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(396, 443); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(85, 13); + this.label10.TabIndex = 25; + this.label10.Text = "Специальность"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(391, 417); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(90, 13); + this.label11.TabIndex = 24; + this.label11.Text = "Группа студента"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(427, 391); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(54, 13); + this.label12.TabIndex = 23; + this.label12.Text = "Отчество"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(425, 339); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(56, 13); + this.label13.TabIndex = 22; + this.label13.Text = "Фамилия"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(372, 504); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 28; + this.button1.Text = "Удалить"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // comboBoxSort + // + this.comboBoxSort.FormattingEnabled = true; + this.comboBoxSort.Location = new System.Drawing.Point(311, 30); + this.comboBoxSort.Name = "comboBoxSort"; + this.comboBoxSort.Size = new System.Drawing.Size(184, 21); + this.comboBoxSort.TabIndex = 29; + this.comboBoxSort.SelectedIndexChanged += new System.EventHandler(this.comboBoxSort_SelectedIndexChanged); + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(238, 33); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(67, 13); + this.label14.TabIndex = 30; + this.label14.Text = "Сортировка"; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(792, 560); + this.Controls.Add(this.label14); + this.Controls.Add(this.comboBoxSort); + this.Controls.Add(this.button1); + this.Controls.Add(this.label8); + this.Controls.Add(this.label9); + this.Controls.Add(this.label10); + this.Controls.Add(this.label11); + this.Controls.Add(this.label12); + this.Controls.Add(this.label13); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + 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.btnEdit); + this.Controls.Add(this.btnAdd); + this.Controls.Add(this.PhoneEdit); + this.Controls.Add(this.SpecialEdit); + this.Controls.Add(this.GroupEdit); + this.Controls.Add(this.PatronymicEdit); + this.Controls.Add(this.NameEdit); + this.Controls.Add(this.SurnameEdit); + this.Controls.Add(this.textBoxPhone); + this.Controls.Add(this.textBoxSpecial); + this.Controls.Add(this.textBoxGroup); + this.Controls.Add(this.textBoxPatronymic); + this.Controls.Add(this.textBoxName); + this.Controls.Add(this.textBoxSurname); + this.Controls.Add(this.dataGridViewProd); + this.Name = "MainForm"; + this.Text = "MainForm"; + this.Load += new System.EventHandler(this.MainForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewProd)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridViewProd; + private System.Windows.Forms.TextBox textBoxSurname; + private System.Windows.Forms.TextBox textBoxName; + private System.Windows.Forms.TextBox textBoxPatronymic; + private System.Windows.Forms.TextBox textBoxGroup; + private System.Windows.Forms.TextBox textBoxSpecial; + private System.Windows.Forms.TextBox textBoxPhone; + private System.Windows.Forms.TextBox PhoneEdit; + private System.Windows.Forms.TextBox SpecialEdit; + private System.Windows.Forms.TextBox GroupEdit; + private System.Windows.Forms.TextBox PatronymicEdit; + private System.Windows.Forms.TextBox NameEdit; + private System.Windows.Forms.TextBox SurnameEdit; + private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.Button btnEdit; + 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.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.ComboBox comboBoxSort; + private System.Windows.Forms.Label label14; + } +} \ No newline at end of file diff --git a/MainForm.cs b/MainForm.cs new file mode 100644 index 0000000..eb95737 --- /dev/null +++ b/MainForm.cs @@ -0,0 +1,226 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Data.Common; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using MySql.Data.MySqlClient; + +namespace zadanie4 +{ + public partial class MainForm : Form + { + private MySqlDataAdapter dataAdapter; + private DataTable prodTable; + private BindingSource bindingSource = new BindingSource(); + public MainForm() + { + InitializeComponent(); + LoadProdData(); + LoadSortOptions(); + } + private void LoadProdData() // загрузка данных в дгв + { + try + { + DB db = new DB(); + using (MySqlConnection connection = db.getConnection()) + { + connection.Open(); + string query = "SELECT * FROM Student"; + + dataAdapter = new MySqlDataAdapter(query, connection); + prodTable = new DataTable(); + dataAdapter.Fill(prodTable); + dataGridViewProd.RowTemplate.Height = 60; + bindingSource.DataSource = prodTable; + dataGridViewProd.DataSource = bindingSource; + dataGridViewProd.AllowUserToAddRows = false; + dataGridViewProd.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells; + dataGridViewProd.ReadOnly = true; // настройки дгв + + } + } + catch (MySqlException ex) + { + MessageBox.Show("Ошибка при подключении к базе данных или выполнении запроса: " + ex.Message); + } + catch (Exception ex) + { + MessageBox.Show("Произошла общая ошибка: " + ex.Message); + } + + } + + private void MainForm_Load(object sender, EventArgs e) + { + + } + + private async void btnAdd_Click(object sender, EventArgs e) + { + DB db = new DB(); + + DataTable table = new DataTable(); + + MySqlDataAdapter adapter = new MySqlDataAdapter(); + + db.openConnection(); + + MySqlCommand commandAdd = new MySqlCommand("INSERT INTO Student (Student_FirstName, Student_LastName, Student_MiddleName, Student_GroupNum, Student_Special, Student_Phone)" + "VALUES (@Surname, @Name, @Patronymic, @Group, @Special, @Phone);", db.getConnection()); + commandAdd.Parameters.AddWithValue("@Surname", textBoxSurname.Text); + commandAdd.Parameters.AddWithValue("@Name", textBoxName.Text); + commandAdd.Parameters.AddWithValue("@Patronymic", textBoxPatronymic.Text); + commandAdd.Parameters.AddWithValue("@Group", textBoxGroup.Text); + commandAdd.Parameters.AddWithValue("@Special", textBoxSpecial.Text); + commandAdd.Parameters.AddWithValue("@Phone", textBoxPhone.Text); + + int rowsAffected = await commandAdd.ExecuteNonQueryAsync(); + + if (rowsAffected > 0) + { + MessageBox.Show("Запись о студенте добавлена."); + LoadProdData(); + + textBoxSurname.Text = ""; + textBoxName.Text = ""; + textBoxPatronymic.Text = ""; + textBoxGroup.Text = ""; + textBoxSpecial.Text = ""; + textBoxPhone.Text = ""; + + } + else + { + MessageBox.Show("Ошибка при добавлении студента"); + db.closeConnection(); + } + } + + private void dataGridViewProd_Click(object sender, EventArgs e) + { + SurnameEdit.Text = dataGridViewProd.CurrentRow.Cells[1].Value.ToString(); + NameEdit.Text = dataGridViewProd.CurrentRow.Cells[2].Value.ToString(); + PatronymicEdit.Text = dataGridViewProd.CurrentRow.Cells[3].Value.ToString(); + GroupEdit.Text = dataGridViewProd.CurrentRow.Cells[4].Value.ToString(); + SpecialEdit.Text = dataGridViewProd.CurrentRow.Cells[5].Value.ToString(); + PhoneEdit.Text = dataGridViewProd.CurrentRow.Cells[6].Value.ToString(); + } + + private void btnEdit_Click(object sender, EventArgs e) + { + DB db = new DB(); + + DataTable table = new DataTable(); + + MySqlDataAdapter adapter = new MySqlDataAdapter(); + + db.openConnection(); + + MySqlCommand commandEdit = new MySqlCommand(" UPDATE Student SET Student_FirstName = @Surname, Student_LastName = @Name, Student_MiddleName = @Patronymic, Student_GroupNum = @Group, Student_Special = @Special, Student_Phone = @Phone WHERE Student_Id = @id;", db.getConnection()); + commandEdit.Parameters.AddWithValue("@id", Convert.ToInt32(dataGridViewProd.CurrentRow.Cells[0].Value)); + commandEdit.Parameters.AddWithValue("@Surname", SurnameEdit.Text); + commandEdit.Parameters.AddWithValue("@Name", NameEdit.Text); + commandEdit.Parameters.AddWithValue("@Patronymic", PatronymicEdit.Text); + commandEdit.Parameters.AddWithValue("@Group", GroupEdit.Text); + commandEdit.Parameters.AddWithValue("@Special", SpecialEdit.Text); + commandEdit.Parameters.AddWithValue("@Phone", PhoneEdit.Text); + + int rowsAffected = commandEdit.ExecuteNonQuery(); + + if (rowsAffected > 0) + { + MessageBox.Show("Запись о студенте отредактирована."); + LoadProdData(); + + textBoxSurname.Text = ""; + textBoxName.Text = ""; + textBoxPatronymic.Text = ""; + textBoxGroup.Text = ""; + textBoxSpecial.Text = ""; + textBoxPhone.Text = ""; + + } + else + { + MessageBox.Show("Ошибка при добавлении студента"); + db.closeConnection(); + } + } + + private void button1_Click(object sender, EventArgs e) + { + DB db = new DB(); + + DataTable table = new DataTable(); + + MySqlDataAdapter adapter = new MySqlDataAdapter(); + + db.openConnection(); + + MySqlCommand commandDelete = new MySqlCommand(" Delete FROM Student WHERE Student_Id = @id;", db.getConnection()); + commandDelete.Parameters.AddWithValue("@id", Convert.ToInt32(dataGridViewProd.CurrentRow.Cells[0].Value)); + + + int rowsAffected = commandDelete.ExecuteNonQuery(); + + if (rowsAffected > 0) + { + MessageBox.Show("Запись о студенте удалена."); + LoadProdData(); + } + else + { + MessageBox.Show("Ошибка при добавлении студента"); + db.closeConnection(); + } + } + + private void LoadSortOptions() + { + comboBoxSort.Items.Add("По умолчанию"); + comboBoxSort.Items.Add("Студенты (А-Я)"); + comboBoxSort.Items.Add("Cтуденты (Я-А)"); + comboBoxSort.Items.Add("Специальность (А-Я)"); + comboBoxSort.Items.Add("Специальность (Я-А)"); + comboBoxSort.Items.Add("Группа (А-Я)"); + comboBoxSort.Items.Add("Группа (Я-А)"); + + comboBoxSort.SelectedIndex = 0; + } + + private void comboBoxSort_SelectedIndexChanged(object sender, EventArgs e) + { + string sortOption = comboBoxSort.SelectedItem.ToString(); + + switch (sortOption) + { + case "По умолчанию": + bindingSource.Sort = ""; + break; + case "Студенты (А-Я)": + bindingSource.Sort = "Student_FirstName ASC"; + break; + case "Студенты (Я-А)": + bindingSource.Sort = "Student_FirstName DESC"; + break; + case "Специальность (А-Я)": + bindingSource.Sort = "Student_Special ASC"; + break; + case "Специальность (Я-А)": + bindingSource.Sort = "Student_Special DESC"; + break; + case "Группа (А-Я)": + bindingSource.Sort = "Student_GroupNum ASC"; + break; + case "Группа (Я-А)": + bindingSource.Sort = "Student_GroupNum DESC"; + break; + } + } + } +} 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/Program.cs b/Program.cs new file mode 100644 index 0000000..1b10976 --- /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 zadanie4 +{ + internal static class Program + { + /// + /// Главная точка входа для приложения. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new LoginForm()); + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9d8b2d4 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанных со сборкой. +[assembly: AssemblyTitle("zadanie4")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("zadanie4")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, следует установить атрибут ComVisible в TRUE для этого типа. +[assembly: ComVisible(false)] + +// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +[assembly: Guid("cf10ee43-6f2e-4950-be63-a61f91d3b64c")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +// Можно задать все значения или принять номера сборки и редакции по умолчанию +// используя "*", как показано ниже: +// [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..87fce5b --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программным средством. +// Версия среды выполнения: 4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если +// код создан повторно. +// +//------------------------------------------------------------------------------ + +namespace zadanie4.Properties +{ + + + /// + /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. + /// + // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder + // класс с помощью таких средств, как ResGen или Visual Studio. + // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen + // с параметром /str или заново постройте свой VS-проект. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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 ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("zadanie4.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; + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..f6a6713 --- /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 zadanie4.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/packages.config b/packages.config new file mode 100644 index 0000000..ee44474 --- /dev/null +++ b/packages.config @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zadanie4.csproj b/zadanie4.csproj new file mode 100644 index 0000000..d26518c --- /dev/null +++ b/zadanie4.csproj @@ -0,0 +1,155 @@ + + + + + Debug + AnyCPU + {CF10EE43-6F2E-4950-BE63-A61F91D3B64C} + WinExe + zadanie4 + zadanie4 + 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.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + + packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + packages\Microsoft.Extensions.Logging.Abstractions.8.0.2\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll + + + packages\MySql.Data.9.5.0\lib\net48\MySql.Data.dll + + + packages\MySqlConnector.2.5.0\lib\net48\MySqlConnector.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.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.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 + + + LoginForm.cs + + + Form + + + MainForm.cs + + + + + LoginForm.cs + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/zadanie4.sln b/zadanie4.sln new file mode 100644 index 0000000..3ebe636 --- /dev/null +++ b/zadanie4.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}") = "zadanie4", "zadanie4.csproj", "{CF10EE43-6F2E-4950-BE63-A61F91D3B64C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CF10EE43-6F2E-4950-BE63-A61F91D3B64C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CF10EE43-6F2E-4950-BE63-A61F91D3B64C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF10EE43-6F2E-4950-BE63-A61F91D3B64C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CF10EE43-6F2E-4950-BE63-A61F91D3B64C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3880E73D-8D11-4403-A377-E75127C5E4E0} + EndGlobalSection +EndGlobal