2022-05-17 21:40:01 +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
|
|
|
|
|
{
|
2022-05-22 07:19:14 +03:00
|
|
|
|
public partial class AuthorizationForm : Form
|
2022-05-17 21:40:01 +03:00
|
|
|
|
{
|
2022-05-22 07:19:14 +03:00
|
|
|
|
public AuthorizationForm()
|
2022-05-17 21:40:01 +03:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
2022-05-18 00:29:58 +03:00
|
|
|
|
|
2022-05-22 07:56:31 +03:00
|
|
|
|
private void loginButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2022-05-24 13:49:52 +03:00
|
|
|
|
if (string.IsNullOrEmpty(entryLogin.Text) || string.IsNullOrEmpty(entryPassword.Text))
|
|
|
|
|
{
|
2022-05-24 15:37:05 +03:00
|
|
|
|
MessageBox.Show("Введите логин и пароль", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
2022-05-24 13:49:52 +03:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-22 07:56:31 +03:00
|
|
|
|
Globals.currentUser = Authorization.Login(entryLogin.Text, entryPassword.Text);
|
2022-05-22 10:00:00 +03:00
|
|
|
|
Logs.Log(Globals.currentUser, Logs.Action.Login, new Dictionary<string, object>());
|
2022-05-22 07:56:31 +03:00
|
|
|
|
|
2022-05-22 09:04:08 +03:00
|
|
|
|
var mainForm = FormManager.Current.CreateForm<MainForm>();
|
|
|
|
|
FormManager.Current.Navigate(this, mainForm);
|
2022-05-22 07:56:31 +03:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2022-05-24 15:37:05 +03:00
|
|
|
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
2022-05-22 07:56:31 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-22 08:18:54 +03:00
|
|
|
|
|
2022-05-22 08:14:59 +03:00
|
|
|
|
private void registerButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-05-22 09:04:08 +03:00
|
|
|
|
var form = FormManager.Current.CreateForm<RegistrationForm>();
|
|
|
|
|
FormManager.Current.Navigate(this, form);
|
2022-05-22 08:14:59 +03:00
|
|
|
|
}
|
2022-05-17 21:40:01 +03:00
|
|
|
|
}
|
|
|
|
|
}
|