Example #1
0
        private void btnContinue_Click(object sender, EventArgs e)
        {
            //Hide error text
            lblLoginError.Visible = false;

            //Get input values
            string username = txtUsername.Text,
                   password = txtPassword.Text;

            //Check if user exists
            if (!Validation.CheckIfUserExists(username))
            {
                lblLoginError.Text    = "User does not exists";
                lblLoginError.Visible = true;
                return;
            }

            //Hash password
            string hashedPassword = Hashing.HashPassword(password);

            //Check login credentials
            if (!Validation.CheckLoginCredentials(username, hashedPassword))
            {
                lblLoginError.Text    = "Incorrect password";
                lblLoginError.Visible = true;
                return;
            }
            else
            {
                ProjectSelection projectSetup = new ProjectSelection();
                this.Visible = false;
                Settings.Default.Username = username;
                projectSetup.Show();
            }
        }
Example #2
0
        private void projectSelectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ProjectSelection projectSelection = new ProjectSelection();

            Settings.Default.ProjectID = "";
            projectSelection.Show();
            this.Close();
        }
Example #3
0
 public void ProcessRegistration(string name, string pw1, string pw2, string email)
 {
     if (Networking.Networking.instance.Create_User(Username, Password2))
     {
         Console.WriteLine("Registered");
         IProjectSelection window = new ProjectSelection();
         window.Show();
         window.Close();
         Notification.Notification.instance.showNotification("User " + Username + "has been registered");
     }
     else
     {
         Notification.Notification.instance.showNotification("User could not be registered");
         Console.WriteLine("User could not be created");
     }
 }