Exemple #1
0
        private void PictureBox1_Click(object sender, EventArgs e)
        {
            LoginHelperService.LogOutUser();
            var result = MessageBox.Show("Do you want to log out?", "Logging out", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                Authorisation auth = new Authorisation();
                this.Hide();
                auth.Show();
            }
        }
Exemple #2
0
        private void RegisterBtn_Click(object sender, EventArgs e)
        {
            _service.RegisterNewUser(new Account()
            {
                Username = UsernameInp.Text,
                Password = PasswordInp.Text,
                ImageUrl = ImageUrl.Text,
                User     = new User()
                {
                    Name    = NameInp.Text,
                    Surname = SurnameInp.Text,
                    Age     = Convert.ToInt32(AgeInp.Text),
                    Email   = EmailInp.Text
                }
            });

            MessageBox.Show($"User {UsernameInp.Text} {SurnameInp.Text} successfully registered!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);

            //open new Dialog
            this.Hide();
            Authorisation mainView = new Authorisation();

            mainView.ShowDialog();
        }