first
This commit is contained in:
commit
0d4f925d45
BIN
.gitignore
vendored
Normal file
BIN
.gitignore
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.vs/Neshina13/v17/.suo
Normal file
BIN
.vs/Neshina13/v17/.suo
Normal file
Binary file not shown.
BIN
.vs/Neshina13/v17/.wsuo
Normal file
BIN
.vs/Neshina13/v17/.wsuo
Normal file
Binary file not shown.
8
.vs/VSWorkspaceState.json
Normal file
8
.vs/VSWorkspaceState.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
"",
|
||||
"\\Neshina13"
|
||||
],
|
||||
"SelectedNode": "\\Neshina13\\Edit.Designer.cs",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
||||
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
25
Neshina13.sln
Normal file
25
Neshina13.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34511.84
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neshina13", "Neshina13\Neshina13.csproj", "{D090A003-F1CB-4B85-BA5D-D60A7D63876C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D090A003-F1CB-4B85-BA5D-D60A7D63876C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D090A003-F1CB-4B85-BA5D-D60A7D63876C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D090A003-F1CB-4B85-BA5D-D60A7D63876C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D090A003-F1CB-4B85-BA5D-D60A7D63876C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CFFE3195-F7D4-47FF-B17C-409BAB70E854}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
176
Neshina13/Add.Designer.cs
generated
Normal file
176
Neshina13/Add.Designer.cs
generated
Normal file
@ -0,0 +1,176 @@
|
||||
namespace Neshina13
|
||||
{
|
||||
partial class Add
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox2 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox3 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox4 = new System.Windows.Forms.ComboBox();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
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.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(98, 415);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(152, 23);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "Добавить";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label1.Location = new System.Drawing.Point(70, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(228, 39);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Добавление";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(52, 123);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(261, 21);
|
||||
this.comboBox1.TabIndex = 2;
|
||||
//
|
||||
// comboBox2
|
||||
//
|
||||
this.comboBox2.FormattingEnabled = true;
|
||||
this.comboBox2.Location = new System.Drawing.Point(52, 180);
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.Size = new System.Drawing.Size(261, 21);
|
||||
this.comboBox2.TabIndex = 3;
|
||||
//
|
||||
// comboBox3
|
||||
//
|
||||
this.comboBox3.FormattingEnabled = true;
|
||||
this.comboBox3.Location = new System.Drawing.Point(52, 236);
|
||||
this.comboBox3.Name = "comboBox3";
|
||||
this.comboBox3.Size = new System.Drawing.Size(261, 21);
|
||||
this.comboBox3.TabIndex = 4;
|
||||
//
|
||||
// comboBox4
|
||||
//
|
||||
this.comboBox4.FormattingEnabled = true;
|
||||
this.comboBox4.Location = new System.Drawing.Point(52, 296);
|
||||
this.comboBox4.Name = "comboBox4";
|
||||
this.comboBox4.Size = new System.Drawing.Size(261, 21);
|
||||
this.comboBox4.TabIndex = 5;
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(52, 351);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(261, 20);
|
||||
this.dateTimePicker1.TabIndex = 6;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(49, 107);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(52, 13);
|
||||
this.label2.TabIndex = 7;
|
||||
this.label2.Text = "Предмет";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(52, 161);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(42, 13);
|
||||
this.label3.TabIndex = 8;
|
||||
this.label3.Text = "Группа";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(49, 280);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(60, 13);
|
||||
this.label4.TabIndex = 9;
|
||||
this.label4.Text = "Менеджер";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(52, 217);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(49, 13);
|
||||
this.label5.TabIndex = 10;
|
||||
this.label5.Text = "Учитель";
|
||||
//
|
||||
// Add
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(370, 450);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.comboBox4);
|
||||
this.Controls.Add(this.comboBox3);
|
||||
this.Controls.Add(this.comboBox2);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Name = "Add";
|
||||
this.Text = "Add";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.ComboBox comboBox2;
|
||||
private System.Windows.Forms.ComboBox comboBox3;
|
||||
private System.Windows.Forms.ComboBox comboBox4;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
}
|
||||
}
|
||||
121
Neshina13/Add.cs
Normal file
121
Neshina13/Add.cs
Normal file
@ -0,0 +1,121 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using NeshinaPolina07_11;
|
||||
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;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
public partial class Add : Form
|
||||
{
|
||||
public Add()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadComboBoxes();
|
||||
|
||||
}
|
||||
|
||||
private void LoadComboBoxes()
|
||||
{
|
||||
// Загрузка предметов
|
||||
string subjQuery = "SELECT StudySubject_Id, StudySubject_name FROM StudySubjects";
|
||||
FillComboBox(comboBox1, subjQuery, "StudySubject_name", "StudySubject_Id");
|
||||
|
||||
// Загрузка групп
|
||||
string groupQuery = "SELECT Group_Id, CONCAT(GroupNum, ' - ', Group_Special) AS GroupInfo FROM `Group`";
|
||||
FillComboBox(comboBox2, groupQuery, "GroupInfo", "Group_Id");
|
||||
|
||||
// Загрузка преподавателей
|
||||
string teacherQuery = "SELECT Teacher_Id, CONCAT(Teacher_FirstName, ' ', Teacher_LastName, ' ', Teacher_MiddleName) AS TeacherName FROM Teacher";
|
||||
FillComboBox(comboBox3, teacherQuery, "TeacherName", "Teacher_Id");
|
||||
|
||||
// Загрузка ответственных (менеджеров)
|
||||
string managerQuery = "SELECT Manger_Id, CONCAT(Manager_FirstName, ' ', Manager_LastName, ' ', Manager_MiddleName) AS ManagerName FROM Mangers";
|
||||
FillComboBox(comboBox4, managerQuery, "ManagerName", "Manger_Id");
|
||||
}
|
||||
|
||||
private void FillComboBox(ComboBox comboBox, string query, string displayMember, string valueMember)
|
||||
{
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
using (var adapter = new MySqlDataAdapter(query, conn))
|
||||
{
|
||||
var table = new DataTable();
|
||||
adapter.Fill(table);
|
||||
comboBox.DataSource = table;
|
||||
comboBox.DisplayMember = displayMember;
|
||||
comboBox.ValueMember = valueMember;
|
||||
comboBox.SelectedIndex = -1; // Ничего не выбрано по умолчанию
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка загрузки данных: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
// Проверка, что все обязательные поля выбраны
|
||||
if (comboBox1.SelectedValue == null ||
|
||||
comboBox2.SelectedValue == null ||
|
||||
comboBox3.SelectedValue == null ||
|
||||
comboBox4.SelectedValue == null)
|
||||
{
|
||||
MessageBox.Show("Пожалуйста, заполните все поля.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
|
||||
string insertQuery = @"
|
||||
INSERT INTO Schedule (
|
||||
Schedule_StudySubject_Id,
|
||||
Schedule_Group_Id,
|
||||
Schedule_Teacher_Id,
|
||||
Schedule_ResponsiblMmanager,
|
||||
Schedule_Date
|
||||
) VALUES (
|
||||
@subjectId,
|
||||
@groupId,
|
||||
@teacherId,
|
||||
@managerId,
|
||||
@date
|
||||
);";
|
||||
|
||||
using (var cmd = new MySqlCommand(insertQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@subjectId", comboBox1.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@groupId", comboBox2.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@teacherId", comboBox3.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@managerId", comboBox4.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@date", dateTimePicker1.Value.Date);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
MessageBox.Show("Запись успешно добавлена!");
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка при добавлении записи: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
120
Neshina13/Add.resx
Normal file
120
Neshina13/Add.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
6
Neshina13/App.config
Normal file
6
Neshina13/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
</configuration>
|
||||
36
Neshina13/DB.cs
Normal file
36
Neshina13/DB.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace NeshinaPolina07_11
|
||||
{
|
||||
internal class DB
|
||||
{
|
||||
private static DB instance;
|
||||
private MySqlConnection connection;
|
||||
|
||||
private readonly string connectionString =
|
||||
"server=192.168.201.207;port=3306;username=ISP41_Neshina;password=ISP41_Neshina;database=ISP41_Neshina_13;SslMode=none;Charset=utf8mb4";
|
||||
|
||||
private DB()
|
||||
{
|
||||
connection = new MySqlConnection(connectionString);
|
||||
OpenConnection();
|
||||
}
|
||||
|
||||
public static DB GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
instance = new DB();
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void OpenConnection()
|
||||
{
|
||||
if (connection.State == ConnectionState.Closed)
|
||||
connection.Open();
|
||||
}
|
||||
|
||||
public MySqlConnection GetConnection() => connection;
|
||||
}
|
||||
}
|
||||
176
Neshina13/Edit.Designer.cs
generated
Normal file
176
Neshina13/Edit.Designer.cs
generated
Normal file
@ -0,0 +1,176 @@
|
||||
namespace Neshina13
|
||||
{
|
||||
partial class Edit
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox2 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox3 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox4 = new System.Windows.Forms.ComboBox();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label1.Location = new System.Drawing.Point(47, 29);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(279, 39);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Редактрование";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(54, 129);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(272, 21);
|
||||
this.comboBox1.TabIndex = 1;
|
||||
//
|
||||
// comboBox2
|
||||
//
|
||||
this.comboBox2.FormattingEnabled = true;
|
||||
this.comboBox2.Location = new System.Drawing.Point(54, 183);
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.Size = new System.Drawing.Size(272, 21);
|
||||
this.comboBox2.TabIndex = 2;
|
||||
//
|
||||
// comboBox3
|
||||
//
|
||||
this.comboBox3.FormattingEnabled = true;
|
||||
this.comboBox3.Location = new System.Drawing.Point(54, 235);
|
||||
this.comboBox3.Name = "comboBox3";
|
||||
this.comboBox3.Size = new System.Drawing.Size(272, 21);
|
||||
this.comboBox3.TabIndex = 3;
|
||||
//
|
||||
// comboBox4
|
||||
//
|
||||
this.comboBox4.FormattingEnabled = true;
|
||||
this.comboBox4.Location = new System.Drawing.Point(54, 286);
|
||||
this.comboBox4.Name = "comboBox4";
|
||||
this.comboBox4.Size = new System.Drawing.Size(272, 21);
|
||||
this.comboBox4.TabIndex = 4;
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(54, 342);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(272, 20);
|
||||
this.dateTimePicker1.TabIndex = 5;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(114, 397);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(156, 23);
|
||||
this.button1.TabIndex = 6;
|
||||
this.button1.Text = "Сохранить";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(51, 113);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(52, 13);
|
||||
this.label2.TabIndex = 8;
|
||||
this.label2.Text = "Предмет";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(51, 167);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(42, 13);
|
||||
this.label3.TabIndex = 9;
|
||||
this.label3.Text = "Группа";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(51, 219);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(49, 13);
|
||||
this.label5.TabIndex = 11;
|
||||
this.label5.Text = "Учитель";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(51, 270);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(60, 13);
|
||||
this.label4.TabIndex = 12;
|
||||
this.label4.Text = "Менеджер";
|
||||
//
|
||||
// Edit
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(393, 450);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.comboBox4);
|
||||
this.Controls.Add(this.comboBox3);
|
||||
this.Controls.Add(this.comboBox2);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "Edit";
|
||||
this.Text = "Edit";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.ComboBox comboBox2;
|
||||
private System.Windows.Forms.ComboBox comboBox3;
|
||||
private System.Windows.Forms.ComboBox comboBox4;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
||||
152
Neshina13/Edit.cs
Normal file
152
Neshina13/Edit.cs
Normal file
@ -0,0 +1,152 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using NeshinaPolina07_11;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
public partial class Edit : Form
|
||||
{
|
||||
private int scheduleId; // ID записи для редактирования
|
||||
|
||||
public Edit(int id)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.scheduleId = id;
|
||||
LoadComboBoxes();
|
||||
LoadData();
|
||||
}
|
||||
|
||||
private void LoadComboBoxes()
|
||||
{
|
||||
// Загрузка предметов
|
||||
string subjQuery = "SELECT StudySubject_Id, StudySubject_name FROM StudySubjects";
|
||||
FillComboBox(comboBox1, subjQuery, "StudySubject_name", "StudySubject_Id");
|
||||
|
||||
// Загрузка групп
|
||||
string groupQuery = "SELECT Group_Id, CONCAT(GroupNum, ' - ', Group_Special) AS GroupInfo FROM `Group`";
|
||||
FillComboBox(comboBox2, groupQuery, "GroupInfo", "Group_Id");
|
||||
|
||||
// Загрузка преподавателей
|
||||
string teacherQuery = "SELECT Teacher_Id, CONCAT(Teacher_FirstName, ' ', Teacher_LastName, ' ', Teacher_MiddleName) AS TeacherName FROM Teacher";
|
||||
FillComboBox(comboBox3, teacherQuery, "TeacherName", "Teacher_Id");
|
||||
|
||||
// Загрузка ответственных (менеджеров)
|
||||
string managerQuery = "SELECT Manger_Id, CONCAT(Manager_FirstName, ' ', Manager_LastName, ' ', Manager_MiddleName) AS ManagerName FROM Mangers";
|
||||
FillComboBox(comboBox4, managerQuery, "ManagerName", "Manger_Id");
|
||||
}
|
||||
|
||||
private void FillComboBox(ComboBox comboBox, string query, string displayMember, string valueMember)
|
||||
{
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
using (var adapter = new MySqlDataAdapter(query, conn))
|
||||
{
|
||||
var table = new DataTable();
|
||||
adapter.Fill(table);
|
||||
comboBox.DataSource = table;
|
||||
comboBox.DisplayMember = displayMember;
|
||||
comboBox.ValueMember = valueMember;
|
||||
comboBox.SelectedIndex = -1;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка загрузки данных: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
string query = @"
|
||||
SELECT
|
||||
Schedule_StudySubject_Id,
|
||||
Schedule_Group_Id,
|
||||
Schedule_Teacher_Id,
|
||||
Schedule_ResponsiblMmanager,
|
||||
Schedule_Date
|
||||
FROM Schedule
|
||||
WHERE Schedule_Id = @id";
|
||||
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
using (var cmd = new MySqlCommand(query, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@id", scheduleId);
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
// Устанавливаем значения в комбобоксы и дату
|
||||
comboBox1.SelectedValue = reader["Schedule_StudySubject_Id"];
|
||||
comboBox2.SelectedValue = reader["Schedule_Group_Id"];
|
||||
comboBox3.SelectedValue = reader["Schedule_Teacher_Id"];
|
||||
comboBox4.SelectedValue = reader["Schedule_ResponsiblMmanager"];
|
||||
dateTimePicker1.Value = Convert.ToDateTime(reader["Schedule_Date"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Запись не найдена.");
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка загрузки данных для редактирования: " + ex.Message);
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
string updateQuery = @"
|
||||
UPDATE Schedule SET
|
||||
Schedule_StudySubject_Id = @subjectId,
|
||||
Schedule_Group_Id = @groupId,
|
||||
Schedule_Teacher_Id = @teacherId,
|
||||
Schedule_ResponsiblMmanager = @managerId,
|
||||
Schedule_Date = @date
|
||||
WHERE Schedule_Id = @scheduleId";
|
||||
|
||||
using (var cmd = new MySqlCommand(updateQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@subjectId", comboBox1.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@groupId", comboBox2.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@teacherId", comboBox3.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@managerId", comboBox4.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@date", dateTimePicker1.Value.Date);
|
||||
cmd.Parameters.AddWithValue("@scheduleId", scheduleId);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
MessageBox.Show("Запись успешно обновлена!");
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка при сохранении изменений: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Neshina13/Edit.resx
Normal file
120
Neshina13/Edit.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
131
Neshina13/Form1.Designer.cs
generated
Normal file
131
Neshina13/Form1.Designer.cs
generated
Normal file
@ -0,0 +1,131 @@
|
||||
namespace Neshina13
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Обязательная переменная конструктора.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Освободить все используемые ресурсы.
|
||||
/// </summary>
|
||||
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Код, автоматически созданный конструктором форм Windows
|
||||
|
||||
/// <summary>
|
||||
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||
/// содержимое этого метода с помощью редактора кода.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label1.Location = new System.Drawing.Point(75, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(240, 39);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Авторизация";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(46, 112);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(38, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Логин";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(46, 174);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(45, 13);
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Text = "Пароль";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(49, 128);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(266, 20);
|
||||
this.textBox1.TabIndex = 3;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(49, 191);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(266, 20);
|
||||
this.textBox2.TabIndex = 4;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(143, 270);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 5;
|
||||
this.button1.Text = "Войти";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(305, 317);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(51, 13);
|
||||
this.label4.TabIndex = 6;
|
||||
this.label4.Text = "13 билет";
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(368, 339);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
||||
|
||||
62
Neshina13/Form1.cs
Normal file
62
Neshina13/Form1.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using NeshinaPolina07_11;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
string login = textBox1.Text;
|
||||
string password = textBox2.Text;
|
||||
try
|
||||
{
|
||||
var db = DB.GetInstance();
|
||||
var connection = db.GetConnection();
|
||||
string query = "select count(*) from Mangers where Manager_Login = @login AND Manager_Password = @password";
|
||||
using (var cmd = new MySqlCommand(query, connection))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@login", login);
|
||||
cmd.Parameters.AddWithValue("@password", password);
|
||||
|
||||
var result = cmd.ExecuteScalar();
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
MessageBox.Show("Вход выполнен!");
|
||||
Form2 form2 = new Form2();
|
||||
form2.Show();
|
||||
this.Hide(); // или Close(), если хотите закрыть форму
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Неверный логин или пароль");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка: " + ex.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Neshina13/Form1.resx
Normal file
120
Neshina13/Form1.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
142
Neshina13/Form2.Designer.cs
generated
Normal file
142
Neshina13/Form2.Designer.cs
generated
Normal file
@ -0,0 +1,142 @@
|
||||
namespace Neshina13
|
||||
{
|
||||
partial class Form2
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
this.comboBoxSort = new System.Windows.Forms.ComboBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(24, 36);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(468, 278);
|
||||
this.dataGridView1.TabIndex = 0;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(509, 36);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 1;
|
||||
this.button1.Text = "Добавить";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(509, 66);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(151, 23);
|
||||
this.button2.TabIndex = 2;
|
||||
this.button2.Text = "Редактировать";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(509, 96);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(75, 23);
|
||||
this.button3.TabIndex = 3;
|
||||
this.button3.Text = "Удалить";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// button4
|
||||
//
|
||||
this.button4.Location = new System.Drawing.Point(24, 415);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(75, 23);
|
||||
this.button4.TabIndex = 4;
|
||||
this.button4.Text = "Назад";
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||
//
|
||||
// comboBoxSort
|
||||
//
|
||||
this.comboBoxSort.FormattingEnabled = true;
|
||||
this.comboBoxSort.Location = new System.Drawing.Point(509, 171);
|
||||
this.comboBoxSort.Name = "comboBoxSort";
|
||||
this.comboBoxSort.Size = new System.Drawing.Size(259, 21);
|
||||
this.comboBoxSort.TabIndex = 5;
|
||||
this.comboBoxSort.SelectedIndexChanged += new System.EventHandler(this.comboBoxSort_SelectedIndexChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(509, 152);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(67, 13);
|
||||
this.label1.TabIndex = 6;
|
||||
this.label1.Text = "Сортировка";
|
||||
//
|
||||
// Form2
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.comboBoxSort);
|
||||
this.Controls.Add(this.button4);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Name = "Form2";
|
||||
this.Text = "Form2";
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button4;
|
||||
private System.Windows.Forms.ComboBox comboBoxSort;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
184
Neshina13/Form2.cs
Normal file
184
Neshina13/Form2.cs
Normal file
@ -0,0 +1,184 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using NeshinaPolina07_11;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Runtime.Remoting.Metadata;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
public partial class Form2 : Form
|
||||
{
|
||||
public Form2()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadSchedule();
|
||||
// Заполняем ComboBox вариантами сортировки
|
||||
comboBoxSort.Items.Clear();
|
||||
comboBoxSort.Items.Add("По дате (новые сверху)");
|
||||
comboBoxSort.Items.Add("По дате (старые сверху)");
|
||||
comboBoxSort.Items.Add("По алфавиту (предмет)");
|
||||
comboBoxSort.SelectedIndex = 0; // По умолчанию — новые сверху
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SortOption
|
||||
{
|
||||
public string DisplayName { get; }
|
||||
public string OrderByColumn { get; }
|
||||
|
||||
public SortOption(string displayName, string orderByColumn)
|
||||
{
|
||||
DisplayName = displayName;
|
||||
OrderByColumn = orderByColumn;
|
||||
}
|
||||
}
|
||||
private void LoadSchedule(string orderByClause = "s.Schedule_Date DESC")
|
||||
{
|
||||
string query = $@"
|
||||
SELECT
|
||||
s.Schedule_Id,
|
||||
subj.StudySubject_name AS Предмет,
|
||||
g.GroupNum AS Группа,
|
||||
t.Teacher_LastName AS Преподаватель,
|
||||
m.Manager_LastName AS Ответственный,
|
||||
s.Schedule_Date AS Дата
|
||||
FROM Schedule s
|
||||
JOIN StudySubjects subj ON s.Schedule_StudySubject_Id = subj.StudySubject_Id
|
||||
JOIN `Group` g ON s.Schedule_Group_Id = g.Group_Id
|
||||
JOIN Teacher t ON s.Schedule_Teacher_Id = t.Teacher_Id
|
||||
JOIN Mangers m ON s.Schedule_ResponsiblMmanager = m.Manger_Id
|
||||
ORDER BY {orderByClause}";
|
||||
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
using (var adapter = new MySqlDataAdapter(query, conn))
|
||||
{
|
||||
var table = new DataTable();
|
||||
adapter.Fill(table);
|
||||
dataGridView1.DataSource = table;
|
||||
|
||||
// Скрыть ID, если нужно
|
||||
if (dataGridView1.Columns.Contains("Schedule_Id"))
|
||||
dataGridView1.Columns["Schedule_Id"].Visible = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка загрузки расписания: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
var addForm = new Add();
|
||||
if (addForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
// Обновляем таблицу только если запись успешно добавлена
|
||||
LoadSchedule();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
{
|
||||
Form1 form1 = new Form1();
|
||||
form1.Show();
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView1.SelectedRows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Выберите строку для редактирования.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Получаем ID из первой колонки (предполагается, что Schedule_Id — первый столбец)
|
||||
var selectedRow = dataGridView1.SelectedRows[0];
|
||||
int scheduleId = Convert.ToInt32(selectedRow.Cells[0].Value); // если Schedule_Id — 0-й столбец
|
||||
|
||||
var editForm = new Edit(scheduleId);
|
||||
if (editForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
LoadSchedule(); // Обновляем таблицу после успешного редактирования
|
||||
}
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView1.SelectedRows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Пожалуйста, выберите строку для удаления.", "Удаление", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var selectedRow = dataGridView1.SelectedRows[0];
|
||||
if (!int.TryParse(selectedRow.Cells[0].Value?.ToString(), out int scheduleId))
|
||||
{
|
||||
MessageBox.Show("Не удалось определить ID записи.");
|
||||
return;
|
||||
}
|
||||
var confirmResult = MessageBox.Show(
|
||||
"Вы уверены, что хотите удалить эту запись?",
|
||||
"Подтверждение удаления",
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Question
|
||||
);
|
||||
if (confirmResult != DialogResult.Yes)
|
||||
return;
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
string deleteQuery = "DELETE FROM Schedule WHERE Schedule_Id = @id";
|
||||
using (var cmd = new MySqlCommand(deleteQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@id", scheduleId);
|
||||
int rowsAffected = cmd.ExecuteNonQuery();
|
||||
if (rowsAffected > 0)
|
||||
{
|
||||
MessageBox.Show("Запись успешно удалена.", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
LoadSchedule(); // Обновляем таблицу
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Запись не найдена или уже удалена.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка при удалении записи: " + ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBoxSort_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string orderBy = "s.Schedule_Date DESC";
|
||||
|
||||
switch (comboBoxSort.SelectedItem?.ToString())
|
||||
{
|
||||
case "По дате (новые сверху)":
|
||||
orderBy = "s.Schedule_Date DESC";
|
||||
break;
|
||||
case "По дате (старые сверху)":
|
||||
orderBy = "s.Schedule_Date ASC";
|
||||
break;
|
||||
case "По алфавиту (предмет)":
|
||||
orderBy = "subj.StudySubject_name ASC";
|
||||
break;
|
||||
}
|
||||
|
||||
LoadSchedule(orderBy);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Neshina13/Form2.resx
Normal file
120
Neshina13/Form2.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
114
Neshina13/Neshina13.csproj
Normal file
114
Neshina13/Neshina13.csproj
Normal file
@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D090A003-F1CB-4B85-BA5D-D60A7D63876C}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Neshina13</RootNamespace>
|
||||
<AssemblyName>Neshina13</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\..\..\..\..\Desktop\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Add.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Add.Designer.cs">
|
||||
<DependentUpon>Add.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DB.cs" />
|
||||
<Compile Include="Edit.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Edit.Designer.cs">
|
||||
<DependentUpon>Edit.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Form2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form2.Designer.cs">
|
||||
<DependentUpon>Form2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Add.resx">
|
||||
<DependentUpon>Add.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Edit.resx">
|
||||
<DependentUpon>Edit.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form2.resx">
|
||||
<DependentUpon>Form2.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
25
Neshina13/Neshina13.sln
Normal file
25
Neshina13/Neshina13.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34511.84
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neshina13", "Neshina13\Neshina13.csproj", "{D090A003-F1CB-4B85-BA5D-D60A7D63876C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D090A003-F1CB-4B85-BA5D-D60A7D63876C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D090A003-F1CB-4B85-BA5D-D60A7D63876C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D090A003-F1CB-4B85-BA5D-D60A7D63876C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D090A003-F1CB-4B85-BA5D-D60A7D63876C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CFFE3195-F7D4-47FF-B17C-409BAB70E854}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
128
Neshina13/Neshina13/Add.Designer.cs
generated
Normal file
128
Neshina13/Neshina13/Add.Designer.cs
generated
Normal file
@ -0,0 +1,128 @@
|
||||
namespace Neshina13
|
||||
{
|
||||
partial class Add
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox2 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox3 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox4 = new System.Windows.Forms.ComboBox();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(98, 415);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(152, 23);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "Добавить";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label1.Location = new System.Drawing.Point(70, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(228, 39);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Добавление";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(52, 123);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(261, 21);
|
||||
this.comboBox1.TabIndex = 2;
|
||||
//
|
||||
// comboBox2
|
||||
//
|
||||
this.comboBox2.FormattingEnabled = true;
|
||||
this.comboBox2.Location = new System.Drawing.Point(52, 180);
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.Size = new System.Drawing.Size(261, 21);
|
||||
this.comboBox2.TabIndex = 3;
|
||||
//
|
||||
// comboBox3
|
||||
//
|
||||
this.comboBox3.FormattingEnabled = true;
|
||||
this.comboBox3.Location = new System.Drawing.Point(52, 236);
|
||||
this.comboBox3.Name = "comboBox3";
|
||||
this.comboBox3.Size = new System.Drawing.Size(261, 21);
|
||||
this.comboBox3.TabIndex = 4;
|
||||
//
|
||||
// comboBox4
|
||||
//
|
||||
this.comboBox4.FormattingEnabled = true;
|
||||
this.comboBox4.Location = new System.Drawing.Point(52, 296);
|
||||
this.comboBox4.Name = "comboBox4";
|
||||
this.comboBox4.Size = new System.Drawing.Size(261, 21);
|
||||
this.comboBox4.TabIndex = 5;
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(52, 351);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(261, 20);
|
||||
this.dateTimePicker1.TabIndex = 6;
|
||||
//
|
||||
// Add
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(370, 450);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.comboBox4);
|
||||
this.Controls.Add(this.comboBox3);
|
||||
this.Controls.Add(this.comboBox2);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Name = "Add";
|
||||
this.Text = "Add";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.ComboBox comboBox2;
|
||||
private System.Windows.Forms.ComboBox comboBox3;
|
||||
private System.Windows.Forms.ComboBox comboBox4;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
}
|
||||
}
|
||||
121
Neshina13/Neshina13/Add.cs
Normal file
121
Neshina13/Neshina13/Add.cs
Normal file
@ -0,0 +1,121 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using NeshinaPolina07_11;
|
||||
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;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
public partial class Add : Form
|
||||
{
|
||||
public Add()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadComboBoxes();
|
||||
|
||||
}
|
||||
|
||||
private void LoadComboBoxes()
|
||||
{
|
||||
// Загрузка предметов
|
||||
string subjQuery = "SELECT StudySubject_Id, StudySubject_name FROM StudySubjects";
|
||||
FillComboBox(comboBox1, subjQuery, "StudySubject_name", "StudySubject_Id");
|
||||
|
||||
// Загрузка групп
|
||||
string groupQuery = "SELECT Group_Id, CONCAT(GroupNum, ' - ', Group_Special) AS GroupInfo FROM `Group`";
|
||||
FillComboBox(comboBox2, groupQuery, "GroupInfo", "Group_Id");
|
||||
|
||||
// Загрузка преподавателей
|
||||
string teacherQuery = "SELECT Teacher_Id, CONCAT(Teacher_FirstName, ' ', Teacher_LastName, ' ', Teacher_MiddleName) AS TeacherName FROM Teacher";
|
||||
FillComboBox(comboBox3, teacherQuery, "TeacherName", "Teacher_Id");
|
||||
|
||||
// Загрузка ответственных (менеджеров)
|
||||
string managerQuery = "SELECT Manger_Id, CONCAT(Manager_FirstName, ' ', Manager_LastName, ' ', Manager_MiddleName) AS ManagerName FROM Mangers";
|
||||
FillComboBox(comboBox4, managerQuery, "ManagerName", "Manger_Id");
|
||||
}
|
||||
|
||||
private void FillComboBox(ComboBox comboBox, string query, string displayMember, string valueMember)
|
||||
{
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
using (var adapter = new MySqlDataAdapter(query, conn))
|
||||
{
|
||||
var table = new DataTable();
|
||||
adapter.Fill(table);
|
||||
comboBox.DataSource = table;
|
||||
comboBox.DisplayMember = displayMember;
|
||||
comboBox.ValueMember = valueMember;
|
||||
comboBox.SelectedIndex = -1; // Ничего не выбрано по умолчанию
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка загрузки данных: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
// Проверка, что все обязательные поля выбраны
|
||||
if (comboBox1.SelectedValue == null ||
|
||||
comboBox2.SelectedValue == null ||
|
||||
comboBox3.SelectedValue == null ||
|
||||
comboBox4.SelectedValue == null)
|
||||
{
|
||||
MessageBox.Show("Пожалуйста, заполните все поля.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
|
||||
string insertQuery = @"
|
||||
INSERT INTO Schedule (
|
||||
Schedule_StudySubject_Id,
|
||||
Schedule_Group_Id,
|
||||
Schedule_Teacher_Id,
|
||||
Schedule_ResponsiblMmanager,
|
||||
Schedule_Date
|
||||
) VALUES (
|
||||
@subjectId,
|
||||
@groupId,
|
||||
@teacherId,
|
||||
@managerId,
|
||||
@date
|
||||
);";
|
||||
|
||||
using (var cmd = new MySqlCommand(insertQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@subjectId", comboBox1.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@groupId", comboBox2.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@teacherId", comboBox3.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@managerId", comboBox4.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@date", dateTimePicker1.Value.Date);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
MessageBox.Show("Запись успешно добавлена!");
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка при добавлении записи: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
120
Neshina13/Neshina13/Add.resx
Normal file
120
Neshina13/Neshina13/Add.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
6
Neshina13/Neshina13/App.config
Normal file
6
Neshina13/Neshina13/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
</configuration>
|
||||
36
Neshina13/Neshina13/DB.cs
Normal file
36
Neshina13/Neshina13/DB.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace NeshinaPolina07_11
|
||||
{
|
||||
internal class DB
|
||||
{
|
||||
private static DB instance;
|
||||
private MySqlConnection connection;
|
||||
|
||||
private readonly string connectionString =
|
||||
"server=192.168.201.207;port=3306;username=ISP41_Neshina;password=ISP41_Neshina;database=ISP41_Neshina_13;SslMode=none;Charset=utf8mb4";
|
||||
|
||||
private DB()
|
||||
{
|
||||
connection = new MySqlConnection(connectionString);
|
||||
OpenConnection();
|
||||
}
|
||||
|
||||
public static DB GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
instance = new DB();
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void OpenConnection()
|
||||
{
|
||||
if (connection.State == ConnectionState.Closed)
|
||||
connection.Open();
|
||||
}
|
||||
|
||||
public MySqlConnection GetConnection() => connection;
|
||||
}
|
||||
}
|
||||
128
Neshina13/Neshina13/Edit.Designer.cs
generated
Normal file
128
Neshina13/Neshina13/Edit.Designer.cs
generated
Normal file
@ -0,0 +1,128 @@
|
||||
namespace Neshina13
|
||||
{
|
||||
partial class Edit
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox2 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox3 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox4 = new System.Windows.Forms.ComboBox();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label1.Location = new System.Drawing.Point(47, 29);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(279, 39);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Редактрование";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(54, 129);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(272, 21);
|
||||
this.comboBox1.TabIndex = 1;
|
||||
//
|
||||
// comboBox2
|
||||
//
|
||||
this.comboBox2.FormattingEnabled = true;
|
||||
this.comboBox2.Location = new System.Drawing.Point(54, 183);
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.Size = new System.Drawing.Size(272, 21);
|
||||
this.comboBox2.TabIndex = 2;
|
||||
//
|
||||
// comboBox3
|
||||
//
|
||||
this.comboBox3.FormattingEnabled = true;
|
||||
this.comboBox3.Location = new System.Drawing.Point(54, 235);
|
||||
this.comboBox3.Name = "comboBox3";
|
||||
this.comboBox3.Size = new System.Drawing.Size(272, 21);
|
||||
this.comboBox3.TabIndex = 3;
|
||||
//
|
||||
// comboBox4
|
||||
//
|
||||
this.comboBox4.FormattingEnabled = true;
|
||||
this.comboBox4.Location = new System.Drawing.Point(54, 286);
|
||||
this.comboBox4.Name = "comboBox4";
|
||||
this.comboBox4.Size = new System.Drawing.Size(272, 21);
|
||||
this.comboBox4.TabIndex = 4;
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(54, 342);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(272, 20);
|
||||
this.dateTimePicker1.TabIndex = 5;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(114, 397);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(156, 23);
|
||||
this.button1.TabIndex = 6;
|
||||
this.button1.Text = "Сохранить";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// Edit
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(393, 450);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.comboBox4);
|
||||
this.Controls.Add(this.comboBox3);
|
||||
this.Controls.Add(this.comboBox2);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "Edit";
|
||||
this.Text = "Edit";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.ComboBox comboBox2;
|
||||
private System.Windows.Forms.ComboBox comboBox3;
|
||||
private System.Windows.Forms.ComboBox comboBox4;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
}
|
||||
152
Neshina13/Neshina13/Edit.cs
Normal file
152
Neshina13/Neshina13/Edit.cs
Normal file
@ -0,0 +1,152 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using NeshinaPolina07_11;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
public partial class Edit : Form
|
||||
{
|
||||
private int scheduleId; // ID записи для редактирования
|
||||
|
||||
public Edit(int id)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.scheduleId = id;
|
||||
LoadComboBoxes();
|
||||
LoadData();
|
||||
}
|
||||
|
||||
private void LoadComboBoxes()
|
||||
{
|
||||
// Загрузка предметов
|
||||
string subjQuery = "SELECT StudySubject_Id, StudySubject_name FROM StudySubjects";
|
||||
FillComboBox(comboBox1, subjQuery, "StudySubject_name", "StudySubject_Id");
|
||||
|
||||
// Загрузка групп
|
||||
string groupQuery = "SELECT Group_Id, CONCAT(GroupNum, ' - ', Group_Special) AS GroupInfo FROM `Group`";
|
||||
FillComboBox(comboBox2, groupQuery, "GroupInfo", "Group_Id");
|
||||
|
||||
// Загрузка преподавателей
|
||||
string teacherQuery = "SELECT Teacher_Id, CONCAT(Teacher_FirstName, ' ', Teacher_LastName, ' ', Teacher_MiddleName) AS TeacherName FROM Teacher";
|
||||
FillComboBox(comboBox3, teacherQuery, "TeacherName", "Teacher_Id");
|
||||
|
||||
// Загрузка ответственных (менеджеров)
|
||||
string managerQuery = "SELECT Manger_Id, CONCAT(Manager_FirstName, ' ', Manager_LastName, ' ', Manager_MiddleName) AS ManagerName FROM Mangers";
|
||||
FillComboBox(comboBox4, managerQuery, "ManagerName", "Manger_Id");
|
||||
}
|
||||
|
||||
private void FillComboBox(ComboBox comboBox, string query, string displayMember, string valueMember)
|
||||
{
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
using (var adapter = new MySqlDataAdapter(query, conn))
|
||||
{
|
||||
var table = new DataTable();
|
||||
adapter.Fill(table);
|
||||
comboBox.DataSource = table;
|
||||
comboBox.DisplayMember = displayMember;
|
||||
comboBox.ValueMember = valueMember;
|
||||
comboBox.SelectedIndex = -1;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка загрузки данных: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
string query = @"
|
||||
SELECT
|
||||
Schedule_StudySubject_Id,
|
||||
Schedule_Group_Id,
|
||||
Schedule_Teacher_Id,
|
||||
Schedule_ResponsiblMmanager,
|
||||
Schedule_Date
|
||||
FROM Schedule
|
||||
WHERE Schedule_Id = @id";
|
||||
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
using (var cmd = new MySqlCommand(query, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@id", scheduleId);
|
||||
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
// Устанавливаем значения в комбобоксы и дату
|
||||
comboBox1.SelectedValue = reader["Schedule_StudySubject_Id"];
|
||||
comboBox2.SelectedValue = reader["Schedule_Group_Id"];
|
||||
comboBox3.SelectedValue = reader["Schedule_Teacher_Id"];
|
||||
comboBox4.SelectedValue = reader["Schedule_ResponsiblMmanager"];
|
||||
dateTimePicker1.Value = Convert.ToDateTime(reader["Schedule_Date"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Запись не найдена.");
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка загрузки данных для редактирования: " + ex.Message);
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
string updateQuery = @"
|
||||
UPDATE Schedule SET
|
||||
Schedule_StudySubject_Id = @subjectId,
|
||||
Schedule_Group_Id = @groupId,
|
||||
Schedule_Teacher_Id = @teacherId,
|
||||
Schedule_ResponsiblMmanager = @managerId,
|
||||
Schedule_Date = @date
|
||||
WHERE Schedule_Id = @scheduleId";
|
||||
|
||||
using (var cmd = new MySqlCommand(updateQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@subjectId", comboBox1.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@groupId", comboBox2.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@teacherId", comboBox3.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@managerId", comboBox4.SelectedValue);
|
||||
cmd.Parameters.AddWithValue("@date", dateTimePicker1.Value.Date);
|
||||
cmd.Parameters.AddWithValue("@scheduleId", scheduleId);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
MessageBox.Show("Запись успешно обновлена!");
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка при сохранении изменений: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Neshina13/Neshina13/Edit.resx
Normal file
120
Neshina13/Neshina13/Edit.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
131
Neshina13/Neshina13/Form1.Designer.cs
generated
Normal file
131
Neshina13/Neshina13/Form1.Designer.cs
generated
Normal file
@ -0,0 +1,131 @@
|
||||
namespace Neshina13
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Обязательная переменная конструктора.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Освободить все используемые ресурсы.
|
||||
/// </summary>
|
||||
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Код, автоматически созданный конструктором форм Windows
|
||||
|
||||
/// <summary>
|
||||
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||
/// содержимое этого метода с помощью редактора кода.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.label1.Location = new System.Drawing.Point(75, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(240, 39);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Авторизация";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(46, 112);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(38, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Логин";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(46, 174);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(45, 13);
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Text = "Пароль";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(49, 128);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(266, 20);
|
||||
this.textBox1.TabIndex = 3;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(49, 191);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(266, 20);
|
||||
this.textBox2.TabIndex = 4;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(143, 270);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 5;
|
||||
this.button1.Text = "Войти";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(305, 317);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(51, 13);
|
||||
this.label4.TabIndex = 6;
|
||||
this.label4.Text = "13 билет";
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(368, 339);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
||||
|
||||
62
Neshina13/Neshina13/Form1.cs
Normal file
62
Neshina13/Neshina13/Form1.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using NeshinaPolina07_11;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
string login = textBox1.Text;
|
||||
string password = textBox2.Text;
|
||||
try
|
||||
{
|
||||
var db = DB.GetInstance();
|
||||
var connection = db.GetConnection();
|
||||
string query = "select count(*) from Mangers where Manager_Login = @login AND Manager_Password = @password";
|
||||
using (var cmd = new MySqlCommand(query, connection))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@login", login);
|
||||
cmd.Parameters.AddWithValue("@password", password);
|
||||
|
||||
var result = cmd.ExecuteScalar();
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
MessageBox.Show("Вход выполнен!");
|
||||
Form2 form2 = new Form2();
|
||||
form2.Show();
|
||||
this.Hide(); // или Close(), если хотите закрыть форму
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Неверный логин или пароль");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка: " + ex.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Neshina13/Neshina13/Form1.resx
Normal file
120
Neshina13/Neshina13/Form1.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
129
Neshina13/Neshina13/Form2.Designer.cs
generated
Normal file
129
Neshina13/Neshina13/Form2.Designer.cs
generated
Normal file
@ -0,0 +1,129 @@
|
||||
namespace Neshina13
|
||||
{
|
||||
partial class Form2
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
this.comboBoxSort = new System.Windows.Forms.ComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(24, 36);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(468, 278);
|
||||
this.dataGridView1.TabIndex = 0;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(509, 36);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 1;
|
||||
this.button1.Text = "Добавить";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(509, 66);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(151, 23);
|
||||
this.button2.TabIndex = 2;
|
||||
this.button2.Text = "Редактировать";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(509, 96);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(75, 23);
|
||||
this.button3.TabIndex = 3;
|
||||
this.button3.Text = "Удалить";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// button4
|
||||
//
|
||||
this.button4.Location = new System.Drawing.Point(24, 415);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(75, 23);
|
||||
this.button4.TabIndex = 4;
|
||||
this.button4.Text = "Назад";
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||
//
|
||||
// comboBoxSort
|
||||
//
|
||||
this.comboBoxSort.FormattingEnabled = true;
|
||||
this.comboBoxSort.Location = new System.Drawing.Point(509, 171);
|
||||
this.comboBoxSort.Name = "comboBoxSort";
|
||||
this.comboBoxSort.Size = new System.Drawing.Size(259, 21);
|
||||
this.comboBoxSort.TabIndex = 5;
|
||||
this.comboBoxSort.SelectedIndexChanged += new System.EventHandler(this.comboBoxSort_SelectedIndexChanged);
|
||||
//
|
||||
// Form2
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.comboBoxSort);
|
||||
this.Controls.Add(this.button4);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Name = "Form2";
|
||||
this.Text = "Form2";
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button4;
|
||||
private System.Windows.Forms.ComboBox comboBoxSort;
|
||||
}
|
||||
}
|
||||
184
Neshina13/Neshina13/Form2.cs
Normal file
184
Neshina13/Neshina13/Form2.cs
Normal file
@ -0,0 +1,184 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
using NeshinaPolina07_11;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Runtime.Remoting.Metadata;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
public partial class Form2 : Form
|
||||
{
|
||||
public Form2()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadSchedule();
|
||||
// Заполняем ComboBox вариантами сортировки
|
||||
comboBoxSort.Items.Clear();
|
||||
comboBoxSort.Items.Add("По дате (новые сверху)");
|
||||
comboBoxSort.Items.Add("По дате (старые сверху)");
|
||||
comboBoxSort.Items.Add("По алфавиту (предмет)");
|
||||
comboBoxSort.SelectedIndex = 0; // По умолчанию — новые сверху
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SortOption
|
||||
{
|
||||
public string DisplayName { get; }
|
||||
public string OrderByColumn { get; }
|
||||
|
||||
public SortOption(string displayName, string orderByColumn)
|
||||
{
|
||||
DisplayName = displayName;
|
||||
OrderByColumn = orderByColumn;
|
||||
}
|
||||
}
|
||||
private void LoadSchedule(string orderByClause = "s.Schedule_Date DESC")
|
||||
{
|
||||
string query = $@"
|
||||
SELECT
|
||||
s.Schedule_Id,
|
||||
subj.StudySubject_name AS Предмет,
|
||||
g.GroupNum AS Группа,
|
||||
t.Teacher_LastName AS Преподаватель,
|
||||
m.Manager_LastName AS Ответственный,
|
||||
s.Schedule_Date AS Дата
|
||||
FROM Schedule s
|
||||
JOIN StudySubjects subj ON s.Schedule_StudySubject_Id = subj.StudySubject_Id
|
||||
JOIN `Group` g ON s.Schedule_Group_Id = g.Group_Id
|
||||
JOIN Teacher t ON s.Schedule_Teacher_Id = t.Teacher_Id
|
||||
JOIN Mangers m ON s.Schedule_ResponsiblMmanager = m.Manger_Id
|
||||
ORDER BY {orderByClause}";
|
||||
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
using (var adapter = new MySqlDataAdapter(query, conn))
|
||||
{
|
||||
var table = new DataTable();
|
||||
adapter.Fill(table);
|
||||
dataGridView1.DataSource = table;
|
||||
|
||||
// Скрыть ID, если нужно
|
||||
if (dataGridView1.Columns.Contains("Schedule_Id"))
|
||||
dataGridView1.Columns["Schedule_Id"].Visible = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка загрузки расписания: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
var addForm = new Add();
|
||||
if (addForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
// Обновляем таблицу только если запись успешно добавлена
|
||||
LoadSchedule();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
{
|
||||
Form1 form1 = new Form1();
|
||||
form1.Show();
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView1.SelectedRows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Выберите строку для редактирования.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Получаем ID из первой колонки (предполагается, что Schedule_Id — первый столбец)
|
||||
var selectedRow = dataGridView1.SelectedRows[0];
|
||||
int scheduleId = Convert.ToInt32(selectedRow.Cells[0].Value); // если Schedule_Id — 0-й столбец
|
||||
|
||||
var editForm = new Edit(scheduleId);
|
||||
if (editForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
LoadSchedule(); // Обновляем таблицу после успешного редактирования
|
||||
}
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView1.SelectedRows.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Пожалуйста, выберите строку для удаления.", "Удаление", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var selectedRow = dataGridView1.SelectedRows[0];
|
||||
if (!int.TryParse(selectedRow.Cells[0].Value?.ToString(), out int scheduleId))
|
||||
{
|
||||
MessageBox.Show("Не удалось определить ID записи.");
|
||||
return;
|
||||
}
|
||||
var confirmResult = MessageBox.Show(
|
||||
"Вы уверены, что хотите удалить эту запись?",
|
||||
"Подтверждение удаления",
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Question
|
||||
);
|
||||
if (confirmResult != DialogResult.Yes)
|
||||
return;
|
||||
try
|
||||
{
|
||||
var conn = DB.GetInstance().GetConnection();
|
||||
string deleteQuery = "DELETE FROM Schedule WHERE Schedule_Id = @id";
|
||||
using (var cmd = new MySqlCommand(deleteQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@id", scheduleId);
|
||||
int rowsAffected = cmd.ExecuteNonQuery();
|
||||
if (rowsAffected > 0)
|
||||
{
|
||||
MessageBox.Show("Запись успешно удалена.", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
LoadSchedule(); // Обновляем таблицу
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Запись не найдена или уже удалена.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Ошибка при удалении записи: " + ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBoxSort_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string orderBy = "s.Schedule_Date DESC";
|
||||
|
||||
switch (comboBoxSort.SelectedItem?.ToString())
|
||||
{
|
||||
case "По дате (новые сверху)":
|
||||
orderBy = "s.Schedule_Date DESC";
|
||||
break;
|
||||
case "По дате (старые сверху)":
|
||||
orderBy = "s.Schedule_Date ASC";
|
||||
break;
|
||||
case "По алфавиту (предмет)":
|
||||
orderBy = "subj.StudySubject_name ASC";
|
||||
break;
|
||||
}
|
||||
|
||||
LoadSchedule(orderBy);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Neshina13/Neshina13/Form2.resx
Normal file
120
Neshina13/Neshina13/Form2.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
114
Neshina13/Neshina13/Neshina13.csproj
Normal file
114
Neshina13/Neshina13/Neshina13.csproj
Normal file
@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D090A003-F1CB-4B85-BA5D-D60A7D63876C}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Neshina13</RootNamespace>
|
||||
<AssemblyName>Neshina13</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\..\..\..\..\Desktop\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Add.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Add.Designer.cs">
|
||||
<DependentUpon>Add.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DB.cs" />
|
||||
<Compile Include="Edit.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Edit.Designer.cs">
|
||||
<DependentUpon>Edit.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Form2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form2.Designer.cs">
|
||||
<DependentUpon>Form2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Add.resx">
|
||||
<DependentUpon>Add.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Edit.resx">
|
||||
<DependentUpon>Edit.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form2.resx">
|
||||
<DependentUpon>Form2.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
22
Neshina13/Neshina13/Program.cs
Normal file
22
Neshina13/Neshina13/Program.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Главная точка входа для приложения.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Neshina13/Neshina13/Properties/AssemblyInfo.cs
Normal file
36
Neshina13/Neshina13/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Общие сведения об этой сборке предоставляются следующим набором
|
||||
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
|
||||
// связанных со сборкой.
|
||||
[assembly: AssemblyTitle("Neshina13")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Neshina13")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
|
||||
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
|
||||
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
[assembly: Guid("d090a003-f1cb-4b85-ba5d-d60a7d63876c")]
|
||||
|
||||
// Сведения о версии сборки состоят из указанных ниже четырех значений:
|
||||
//
|
||||
// Основной номер версии
|
||||
// Дополнительный номер версии
|
||||
// Номер сборки
|
||||
// Редакция
|
||||
//
|
||||
// Можно задать все значения или принять номера сборки и редакции по умолчанию
|
||||
// используя "*", как показано ниже:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
71
Neshina13/Neshina13/Properties/Resources.Designer.cs
generated
Normal file
71
Neshina13/Neshina13/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программным средством.
|
||||
// Версия среды выполнения: 4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
|
||||
// код создан повторно.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Neshina13.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
|
||||
/// </summary>
|
||||
// Этот класс был автоматически создан при помощи 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()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
|
||||
/// </summary>
|
||||
[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("Neshina13.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Переопределяет свойство CurrentUICulture текущего потока для всех
|
||||
/// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
Neshina13/Neshina13/Properties/Resources.resx
Normal file
117
Neshina13/Neshina13/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
30
Neshina13/Neshina13/Properties/Settings.Designer.cs
generated
Normal file
30
Neshina13/Neshina13/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Neshina13.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Neshina13/Neshina13/Properties/Settings.settings
Normal file
7
Neshina13/Neshina13/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
BIN
Neshina13/Neshina13/bin/Debug/MySql.Data.dll
Normal file
BIN
Neshina13/Neshina13/bin/Debug/MySql.Data.dll
Normal file
Binary file not shown.
BIN
Neshina13/Neshina13/bin/Debug/Neshina13.exe
Normal file
BIN
Neshina13/Neshina13/bin/Debug/Neshina13.exe
Normal file
Binary file not shown.
6
Neshina13/Neshina13/bin/Debug/Neshina13.exe.config
Normal file
6
Neshina13/Neshina13/bin/Debug/Neshina13.exe.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
</configuration>
|
||||
BIN
Neshina13/Neshina13/bin/Debug/Neshina13.pdb
Normal file
BIN
Neshina13/Neshina13/bin/Debug/Neshina13.pdb
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
Binary file not shown.
Binary file not shown.
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.Add.resources
Normal file
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.Add.resources
Normal file
Binary file not shown.
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.Edit.resources
Normal file
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.Edit.resources
Normal file
Binary file not shown.
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.Form1.resources
Normal file
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.Form1.resources
Normal file
Binary file not shown.
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.Form2.resources
Normal file
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.Form2.resources
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
b1d45ed09e2efc90fed125c224599f4c0e56b591db85a23e5d675c13190460ec
|
||||
@ -0,0 +1,15 @@
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\bin\Debug\Neshina13.exe.config
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\bin\Debug\Neshina13.exe
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\bin\Debug\Neshina13.pdb
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\bin\Debug\MySql.Data.dll
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.AssemblyReference.cache
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Form1.resources
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Properties.Resources.resources
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.GenerateResource.cache
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.CopyComplete
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.exe
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.pdb
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Add.resources
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Form2.resources
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Edit.resources
|
||||
Binary file not shown.
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.exe
Normal file
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.exe
Normal file
Binary file not shown.
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.pdb
Normal file
BIN
Neshina13/Neshina13/obj/Debug/Neshina13.pdb
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
Binary file not shown.
22
Neshina13/Program.cs
Normal file
22
Neshina13/Program.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Neshina13
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Главная точка входа для приложения.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Neshina13/Properties/AssemblyInfo.cs
Normal file
36
Neshina13/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Общие сведения об этой сборке предоставляются следующим набором
|
||||
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
|
||||
// связанных со сборкой.
|
||||
[assembly: AssemblyTitle("Neshina13")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Neshina13")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
|
||||
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
|
||||
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
[assembly: Guid("d090a003-f1cb-4b85-ba5d-d60a7d63876c")]
|
||||
|
||||
// Сведения о версии сборки состоят из указанных ниже четырех значений:
|
||||
//
|
||||
// Основной номер версии
|
||||
// Дополнительный номер версии
|
||||
// Номер сборки
|
||||
// Редакция
|
||||
//
|
||||
// Можно задать все значения или принять номера сборки и редакции по умолчанию
|
||||
// используя "*", как показано ниже:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
71
Neshina13/Properties/Resources.Designer.cs
generated
Normal file
71
Neshina13/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программным средством.
|
||||
// Версия среды выполнения: 4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
|
||||
// код создан повторно.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Neshina13.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
|
||||
/// </summary>
|
||||
// Этот класс был автоматически создан при помощи 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()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
|
||||
/// </summary>
|
||||
[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("Neshina13.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Переопределяет свойство CurrentUICulture текущего потока для всех
|
||||
/// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
Neshina13/Properties/Resources.resx
Normal file
117
Neshina13/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
30
Neshina13/Properties/Settings.Designer.cs
generated
Normal file
30
Neshina13/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Neshina13.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Neshina13/Properties/Settings.settings
Normal file
7
Neshina13/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
BIN
Neshina13/bin/Debug/MySql.Data.dll
Normal file
BIN
Neshina13/bin/Debug/MySql.Data.dll
Normal file
Binary file not shown.
BIN
Neshina13/bin/Debug/Neshina13.exe
Normal file
BIN
Neshina13/bin/Debug/Neshina13.exe
Normal file
Binary file not shown.
6
Neshina13/bin/Debug/Neshina13.exe.config
Normal file
6
Neshina13/bin/Debug/Neshina13.exe.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
</configuration>
|
||||
BIN
Neshina13/bin/Debug/Neshina13.pdb
Normal file
BIN
Neshina13/bin/Debug/Neshina13.pdb
Normal file
Binary file not shown.
2
Neshina13/desktop.ini
Normal file
2
Neshina13/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
LocalizedResourceName=@Neshina13,0
|
||||
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
BIN
Neshina13/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Normal file
BIN
Neshina13/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Normal file
Binary file not shown.
Binary file not shown.
BIN
Neshina13/obj/Debug/Neshina13.Add.resources
Normal file
BIN
Neshina13/obj/Debug/Neshina13.Add.resources
Normal file
Binary file not shown.
BIN
Neshina13/obj/Debug/Neshina13.Edit.resources
Normal file
BIN
Neshina13/obj/Debug/Neshina13.Edit.resources
Normal file
Binary file not shown.
BIN
Neshina13/obj/Debug/Neshina13.Form1.resources
Normal file
BIN
Neshina13/obj/Debug/Neshina13.Form1.resources
Normal file
Binary file not shown.
BIN
Neshina13/obj/Debug/Neshina13.Form2.resources
Normal file
BIN
Neshina13/obj/Debug/Neshina13.Form2.resources
Normal file
Binary file not shown.
BIN
Neshina13/obj/Debug/Neshina13.Properties.Resources.resources
Normal file
BIN
Neshina13/obj/Debug/Neshina13.Properties.Resources.resources
Normal file
Binary file not shown.
BIN
Neshina13/obj/Debug/Neshina13.csproj.AssemblyReference.cache
Normal file
BIN
Neshina13/obj/Debug/Neshina13.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
0
Neshina13/obj/Debug/Neshina13.csproj.CopyComplete
Normal file
0
Neshina13/obj/Debug/Neshina13.csproj.CopyComplete
Normal file
@ -0,0 +1 @@
|
||||
c880676d3611bee1e3fe5e4e4e07216d68c9e12cc4e0073868a6145a5b1adb4b
|
||||
29
Neshina13/obj/Debug/Neshina13.csproj.FileListAbsolute.txt
Normal file
29
Neshina13/obj/Debug/Neshina13.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,29 @@
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\bin\Debug\Neshina13.exe.config
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\bin\Debug\Neshina13.exe
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\bin\Debug\Neshina13.pdb
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\bin\Debug\MySql.Data.dll
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.AssemblyReference.cache
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Form1.resources
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Properties.Resources.resources
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.GenerateResource.cache
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.CopyComplete
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.exe
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.pdb
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Add.resources
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Form2.resources
|
||||
C:\Users\Student\Downloads\Модуль\АвтоМастер\Neshina13\Neshina13\obj\Debug\Neshina13.Edit.resources
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\bin\Debug\Neshina13.exe.config
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\bin\Debug\Neshina13.exe
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\bin\Debug\Neshina13.pdb
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.AssemblyReference.cache
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.Add.resources
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.Edit.resources
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.Form1.resources
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.Form2.resources
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.Properties.Resources.resources
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.GenerateResource.cache
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.csproj.CopyComplete
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.exe
|
||||
C:\Users\Student\Desktop\Neshina13\Neshina13\obj\Debug\Neshina13.pdb
|
||||
BIN
Neshina13/obj/Debug/Neshina13.csproj.GenerateResource.cache
Normal file
BIN
Neshina13/obj/Debug/Neshina13.csproj.GenerateResource.cache
Normal file
Binary file not shown.
BIN
Neshina13/obj/Debug/Neshina13.exe
Normal file
BIN
Neshina13/obj/Debug/Neshina13.exe
Normal file
Binary file not shown.
BIN
Neshina13/obj/Debug/Neshina13.pdb
Normal file
BIN
Neshina13/obj/Debug/Neshina13.pdb
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
BIN
Neshina13/obj/Release/Neshina13.csproj.AssemblyReference.cache
Normal file
BIN
Neshina13/obj/Release/Neshina13.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
2
desktop.ini
Normal file
2
desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
LocalizedResourceName=@Neshina13,0
|
||||
Loading…
Reference in New Issue
Block a user