This repository has been archived on 2022-08-31. You can view files and clone it, but cannot push or open issues or pull requests.
awesome-email-extractor/RegistrationForm.cs

53 lines
1.4 KiB
C#
Raw Normal View History

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();
}
private void registerButton_Click(object sender, EventArgs e)
{
if (!string.Equals(entryPassword.Text, entryRePassword.Text))
{
MessageBox.Show("Пароли не совпадают!");
return;
}
try
{
Globals.currentUser = Authorization.Register(entryLogin.Text, entryPassword.Text);
var form = FormManager.Current.CreateForm<MainForm>();
FormManager.Current.Navigate(this, form);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void loginButton_Click(object sender, EventArgs e)
{
AuthorizationForm form = FormManager.Current.CreateForm<AuthorizationForm>();
FormManager.Current.Navigate(this, form);
}
private void RegistrationForm_FormClosed(object sender, FormClosedEventArgs e)
{
}
}
}