Setup and forms

This commit is contained in:
redtea committed 2024-06-04 21:09:56 +03:00
1 parent aed55f44f9
commit eee7548fc8
47 files changed
+2837 -8138

No files matched your search

+98
View File
@@ -0,0 +1,98 @@
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)
{
}
}
}