public RequestSigningForm(Form _parentForm, ScoutHomeScreen _homeScreen, int _CID, string _cName) { InitializeComponent(); controllerobj = new Controller(); parentForm_ = _parentForm; homeScreen = _homeScreen; CID = _CID; cName = _cName; }
private void FavoriteBtn_Click(object sender, EventArgs e) { try { int id = Convert.ToInt32(PlayerDataGridView.SelectedRows[0].Cells[0].Value.ToString()); ScoutHomeScreen f = (ScoutHomeScreen)ParentForm_; //Casting the parent form if (!f.favs.Contains(id)) { f.favs.Add(id); MessageBox.Show("Player added to favorites"); } else { f.favs.Remove(id); MessageBox.Show("Player removed from favorites"); } } catch { MessageBox.Show("Please select a valid player !"); } }
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!"); } }
public ScoutSigningsForm(ScoutHomeScreen _ParentForm) { InitializeComponent(); ParentForm_ = _ParentForm; controllerobj = new Controller(); }