- •Аннотация.
- •Оглавление
- •Введение.
- •Цель курсовой работы.
- •Задание на выполнение курсовой работы.
- •Концептуальная модель данных.
- •Логическая структура данных.
- •Этапы реализации системы.
- •6.1. Запросы.
- •6.2. Индексы.
- •6.3. Роли.
- •6.4. Процедуры.
- •6.5. Триггеры.
- •Руководство пользователя-клиента.
- •Руководство инструктора.
- •Руководство администратора.
- •Список литературы
- •Листинг программ. Интерфейс для пользователя hikingtrips. Файл Form2.Cs
- •Файл Form1.Cs
- •Файл Form4.Cs
- •Файл Form3.Cs
- •Файл Form5.Cs
- •Файл Form6.Cs
- •Листинг программ. Интерфейс для инструктора hikingtripsinstructors. Файл Form1.Cs
- •Файл Form2.Cs
Список литературы
Форум программистов и сисадминов Киберфорум www.cyberforum.ru
Официальный сайт Microsoft https://learn.microsoft.com/ru-ru/
Stack Overflow — система вопросов и ответов о программировании https://stackoverflow.com/
YouTube – Денвер правильная установка и настройка https://www.youtube.com/watch?v=l3K7fQ9H6ok&ysclid=m4u9l4nlkn472376464
Документация по C# — управляемый язык .NET https://learn.microsoft.com/ru-ru/dotnet/csharp/
MySQL Documentation https://dev.mysql.com/doc/
Интерактивный тренажер по SQL https://stepik.org/course/63054/syllabus?auth=login
SQL Academy – SQL Simulator Tasks Interactive SQL Simulator — SQL Academy
Документация по библиотеке iTextSharp iText pdf library API documentation for Java and .Net
Документация по библиотеке MySql.Data MySql.Data/README.md at master · CsharpDatabase/MySql.Data · GitHub
Документация по библиотеке System.Drawing.Common System.Drawing Пространство имен | Microsoft Learn
ПРИЛОЖЕНИЕ 1.
Листинг программ. Интерфейс для пользователя hikingtrips. Файл Form2.Cs
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 hikingtrips
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Form1 frm2 = new Form1();
frm2.Show();
this.Hide();
}
private void button2_Click(object sender, EventArgs e)
{
Form4 frm3 = new Form4();
frm3.Show();
this.Hide();
}
}
}
Файл Form1.Cs
using MySql.Data.MySqlClient;
using System;
using System.Security.Policy;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
namespace hikingtrips
{
public partial class Form1 : Form
{
private const string connectionString = "server=localhost;database=hikingtrips;uid=root;password=Fuckingpassword2;";
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string username = textBox1.Text;
string password = textBox2.Text;
AuthenticateUser(username, password);
}
private void AuthenticateUser(string username, string password)
{
int user_ind;
using (MySqlConnection connection = new MySqlConnection(connectionString))
{
connection.Open();
string checkUserQuery = "SELECT * FROM login_password WHERE login = @Username";
using (MySqlCommand checkUserCommand = new MySqlCommand(checkUserQuery, connection))
{
checkUserCommand.Parameters.AddWithValue("@Username", username);
int userCount = Convert.ToInt32(checkUserCommand.ExecuteScalar());
if (userCount > 0)
{
string passwordQuery = "SELECT password, user FROM login_password WHERE login = @Username";
using (MySqlCommand passwordCommand = new MySqlCommand(passwordQuery, connection))
{
passwordCommand.Parameters.AddWithValue("@Username", username);
MySqlDataReader reader2 = passwordCommand.ExecuteReader();
if (reader2.Read())
{
string storedPassword = reader2["password"].ToString();
if (storedPassword == password)
{
user_ind = Convert.ToInt32(reader2["user"]);
MessageBox.Show("The login was completed successfully!", "Congratulations!", MessageBoxButtons.OK, MessageBoxIcon.Information);
Form5 frm3 = new Form5(user_ind);
frm3.Show();
this.Close();
}
else
{
MessageBox.Show("The password is incorrect.", "Sorry.", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
reader2.Close();
}
}
} else
{
MessageBox.Show("The user with this username was not found.", "Sorry.", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
}
}
