private void buttonRegister_Click(object sender, EventArgs e) { if (textBoxPublicKeyRegister.BackColor == Color.Honeydew && textBoxPrivateKeyRegister.BackColor == Color.Honeydew && textBoxPasswordRegister.BackColor == Color.Honeydew) { VotingsUser.ClearUserData(); VotingsUser.Register(textBoxPublicKeyRegister.Text, textBoxPrivateKeyRegister.Text, textBoxPasswordRegister.Text); VotingsUser.GetKeysFromConfig(); if (VotingsUser.Login(textBoxPasswordRegister.Text)) { SuccsessLogin?.Invoke(this, new EventArgs()); Hide(); } } }
public RegisterLoginForm() { InitializeComponent(); MaterialSkinManager.Instance.AddFormToManage(this); panelFixer.BackColor = MaterialSkinManager.Instance.ColorScheme.PrimaryColor; this.Text = Properties.Resources.loginIntoNet; labelPassLogin.Text = Properties.Resources.pass; labelPasswordRegister.Text = Properties.Resources.pass; labelPasswordRegister2.Text = Properties.Resources.passRepeat; labelPrivateKeyRegister.Text = Properties.Resources.privateKey; labelPublicKeyLogin.Text = Properties.Resources.userHash; labelPublicKeyRegister.Text = Properties.Resources.userHash; buttonLogin.Text = Properties.Resources.toLogin; buttonRegister.Text = Properties.Resources.register; tabPageLogin.Text = Properties.Resources.login; tabPageRegister.Text = Properties.Resources.registration; if (VotingsUser.CheckUserExists()) { VotingsUser.GetKeysFromConfig(); tabControl1.SelectTab("tabPageLogin"); textBoxPublicKeyLogin.Text = VotingsUser.PublicKey; CommonHelpers.ChangeTheme(VotingsUser.Theme); } else { tabControl1.SelectTab("tabPageRegister"); var tab = tabControl1.TabPages["tabPageLogin"]; tabControl1.TabPages.Remove(tab); } Icon = Properties.Resources.votingIcon; }