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.SqlClient; using MySql.Data.MySqlClient; namespace PaymentLogs { public partial class RegisterForm : Form { public RegisterForm() { InitializeComponent(); } private void Form2_Load(object sender, EventArgs e) { pictureBox1.Visible = false; } private void pictureBox5_Click(object sender, EventArgs e) { textBoxLog1.Text = ""; textBoxPass2.Text = ""; } private void buttonCreate_Click(object sender, EventArgs e) { if (adminKeyTextBox.Text != "pass") { label4.Text = "Неверный ключ администратора"; return; } var login = textBoxLog1.Text; var password = textBoxPass2.Text; if (Program.UserRepository.HasUser(login)) { label4.Text = "Пользователь уже сущесвует"; } else { Program.UserRepository.RegisterUser(login, password); label4.Text = "Пользователь зарегистрирован"; Program.UserRepository.Load(); } } private void pictureBox1_Click(object sender, EventArgs e) { textBoxPass2.UseSystemPasswordChar = !textBoxPass2.UseSystemPasswordChar; pictureBox1.Visible = false; pictureBox2.Visible = true; } private void pictureBox2_Click(object sender, EventArgs e) { textBoxPass2.UseSystemPasswordChar = !textBoxPass2.UseSystemPasswordChar; pictureBox1.Visible = true; pictureBox2.Visible = false; } private void label3_Click(object sender, EventArgs e) { } private void label4_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { this.Hide(); (new LoginForm()).Show(); } private void label5_Click(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } } }