соединяет авторизацию с формой
This commit is contained in:
parent
347551cf92
commit
8e69fa569d
4
AuthorizationForm.Designer.cs
generated
4
AuthorizationForm.Designer.cs
generated
@ -45,6 +45,7 @@
|
|||||||
this.loginButton.TabIndex = 0;
|
this.loginButton.TabIndex = 0;
|
||||||
this.loginButton.Text = "Авторизоваться";
|
this.loginButton.Text = "Авторизоваться";
|
||||||
this.loginButton.UseVisualStyleBackColor = true;
|
this.loginButton.UseVisualStyleBackColor = true;
|
||||||
|
this.loginButton.Click += new System.EventHandler(this.loginButton_Click);
|
||||||
//
|
//
|
||||||
// registerButton
|
// registerButton
|
||||||
//
|
//
|
||||||
@ -89,6 +90,7 @@
|
|||||||
this.entryPassword.Name = "entryPassword";
|
this.entryPassword.Name = "entryPassword";
|
||||||
this.entryPassword.Size = new System.Drawing.Size(195, 20);
|
this.entryPassword.Size = new System.Drawing.Size(195, 20);
|
||||||
this.entryPassword.TabIndex = 4;
|
this.entryPassword.TabIndex = 4;
|
||||||
|
this.entryPassword.UseSystemPasswordChar = true;
|
||||||
//
|
//
|
||||||
// AuthorizationForm
|
// AuthorizationForm
|
||||||
//
|
//
|
||||||
@ -101,6 +103,8 @@
|
|||||||
this.Controls.Add(this.entryLogin);
|
this.Controls.Add(this.entryLogin);
|
||||||
this.Controls.Add(this.registerButton);
|
this.Controls.Add(this.registerButton);
|
||||||
this.Controls.Add(this.loginButton);
|
this.Controls.Add(this.loginButton);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MaximizeBox = false;
|
||||||
this.Name = "AuthorizationForm";
|
this.Name = "AuthorizationForm";
|
||||||
this.Text = "Авторизоваться";
|
this.Text = "Авторизоваться";
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
@ -17,5 +17,19 @@ namespace AwesomeEmailExtractor
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loginButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Globals.currentUser = Authorization.Login(entryLogin.Text, entryPassword.Text);
|
||||||
|
this.Close();
|
||||||
|
|
||||||
|
new MainForm().Show();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,8 @@ namespace AwesomeEmailExtractor
|
|||||||
public static SqliteConnection db { get; set; }
|
public static SqliteConnection db { get; set; }
|
||||||
public static SqliteConnection logsDb { get; set; }
|
public static SqliteConnection logsDb { get; set; }
|
||||||
|
|
||||||
|
public static User currentUser { get; set; }
|
||||||
|
|
||||||
public static string getAppDirectory()
|
public static string getAppDirectory()
|
||||||
{
|
{
|
||||||
return Path.Combine(
|
return Path.Combine(
|
||||||
|
@ -18,11 +18,11 @@ namespace AwesomeEmailExtractor
|
|||||||
{
|
{
|
||||||
preMain();
|
preMain();
|
||||||
|
|
||||||
Logs.GetLogs();
|
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new MainForm());
|
|
||||||
|
new AuthorizationForm().Show();
|
||||||
|
Application.Run();
|
||||||
|
|
||||||
postMain();
|
postMain();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user