2022-05-22 08:14:59 +03:00
|
|
|
|
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 AwesomeEmailExtractor
|
|
|
|
|
{
|
|
|
|
|
public partial class RegistrationForm : Form
|
|
|
|
|
{
|
|
|
|
|
public RegistrationForm()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-22 09:04:08 +03:00
|
|
|
|
private void registerButton_Click(object sender, EventArgs e)
|
2022-05-22 08:14:59 +03:00
|
|
|
|
{
|
2022-05-24 13:49:52 +03:00
|
|
|
|
if (string.IsNullOrEmpty(entryLogin.Text) || string.IsNullOrEmpty(entryPassword.Text))
|
|
|
|
|
{
|
2022-05-24 15:25:44 +03:00
|
|
|
|
MessageBox.Show("Введите логин и пароль!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
2022-05-24 13:49:52 +03:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-22 09:04:08 +03:00
|
|
|
|
if (!string.Equals(entryPassword.Text, entryRePassword.Text))
|
|
|
|
|
{
|
2022-05-24 15:25:44 +03:00
|
|
|
|
MessageBox.Show("Пароли не совпадают!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
2022-05-22 09:04:08 +03:00
|
|
|
|
return;
|
|
|
|
|
}
|
2022-05-22 08:14:59 +03:00
|
|
|
|
|
2022-05-22 09:04:08 +03:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Globals.currentUser = Authorization.Register(entryLogin.Text, entryPassword.Text);
|
2022-05-22 10:00:00 +03:00
|
|
|
|
Logs.Log(Globals.currentUser, Logs.Action.Registration, new Dictionary<string, object>());
|
|
|
|
|
|
2022-05-22 09:04:08 +03:00
|
|
|
|
var form = FormManager.Current.CreateForm<MainForm>();
|
|
|
|
|
FormManager.Current.Navigate(this, form);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2022-05-24 15:37:05 +03:00
|
|
|
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
2022-05-22 09:04:08 +03:00
|
|
|
|
}
|
2022-05-22 08:14:59 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void loginButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-05-22 09:04:08 +03:00
|
|
|
|
AuthorizationForm form = FormManager.Current.CreateForm<AuthorizationForm>();
|
|
|
|
|
FormManager.Current.Navigate(this, form);
|
|
|
|
|
}
|
2022-05-22 08:14:59 +03:00
|
|
|
|
|
2022-05-22 09:04:08 +03:00
|
|
|
|
private void RegistrationForm_FormClosed(object sender, FormClosedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
2022-05-22 08:14:59 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|