private void Login(int ID) { string hashedPass = Football_Scouting_System.Form1.ComputeSha256Hash(passTxtBox.Text); string id = userNameTxtbox.Text; //Check FAs if (objcontroller.LogInFA(ID, hashedPass) == 1) { try { FA.FAHomeScreen f = new FA.FAHomeScreen(this, ID); f.Show(); this.Hide(); } catch { MessageBox.Show("An unexpected error has occured"); } } //Check Clubs else if (objcontroller.LogInClub(ID, hashedPass) == 1) { try { Club.ClubHomeScreen C = new Club.ClubHomeScreen(this, ID); C.Show(); this.Hide(); } catch { MessageBox.Show("An unexpected error has occured"); } } //Check Scouts else if (objcontroller.LogInScout(ID, hashedPass) == 1) { try { Scout.ScoutHomeScreen s = new Scout.ScoutHomeScreen(this, ID); s.Show(); this.Hide(); } catch { MessageBox.Show("An unexpected error has occured"); } } //Check journalist else if (objcontroller.LogInJournalist(ID, hashedPass) == 1) { try { Journalist.Journalist j = new Journalist.Journalist(this, ID); j.Show(); this.Hide(); } catch { MessageBox.Show("An unexpected error has occured"); } } //else invalid else { MessageBox.Show("Invalid ID or Password! Please re-enter a valid one or enter as guest!"); } }
private void NewsForm_FormClosed(object sender, FormClosedEventArgs e) { ParentForm_.Show(); }