123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Data.OleDb;
- namespace Услуги_салона_красоты_Тураев
- {
- public partial class Авторизация : Form
- {
- public Авторизация()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (MessageBox.Show("Вы точно хотите выйти?", "Сообщение", MessageBoxButtons.YesNo, MessageBoxIcon.Question)==DialogResult.Yes)
- {
- Environment.Exit(0);
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- OleDbConnection a = new OleDbConnection(@"Provider = Microsoft.Jet.OLEDB.4.0; Data Source = Login_Parol.mdb");
- OleDbDataAdapter b = new OleDbDataAdapter("Select Count(*) From Логин_Пароль where Логин = '" + textBox1.Text + "' and Пароль = '" + textBox2.Text + "'", a);
- DataTable c = new DataTable();
- b.Fill(c);
- if (c.Rows[0][0].ToString() == "1")
- {
- Hide();
- MessageBox.Show("Здравствуйте, " + textBox1.Text, "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
- Главное_меню f = new Главное_меню();
- f.Show();
- }
- else
- {
- MessageBox.Show("Неверный логин или пароль!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- }
- }
|