private void OkClick_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("", "Are You Sure", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { int n, count = 0; bool isNumeric = int.TryParse(Hscore.Text, out n); // check if value input of highest score is int data type if (isNumeric == true) { if (Convert.ToInt32(Hscore.Text) >= 0) { DataTable ldUpdateinfo1 = clsDbConnection.SProcTable("updateinfo1", new Dictionary <string, object> { ["prUserName"] = playername.Text, ["scoreNew"] = Hscore.Text }); count = count + 1; } else { MessageBox.Show("Pls enter correct Score Info"); } } //check if value input is null else if (Hscore.Text == "") { } else { MessageBox.Show("Pls enter correct Score Info"); } //check if pass will be changed if (ps.Text != "") { DataTable ldUpdateinfo2 = clsDbConnection.SProcTable("updateinfo2", new Dictionary <string, object> { ["prUserName"] = playername.Text, ["psNew"] = ps.Text }); count = count + 1; } //check if any changes to user, then will return admin screen. if (count > 0) { MessageBox.Show("You updated player'info"); admin ad = new admin(); ad.Show(); this.Hide(); } } else if (dialogResult == DialogResult.No) { } }
private void resetSigninFailure_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("", "Are You Sure", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { DataTable dtResetAttempt = clsDbConnection.SProcTable("resetSigninAttempt", new Dictionary <string, object> { ["prUserName"] = playername.Text }); MessageBox.Show("You reseted the number of attempts for this player"); this.Hide(); admin ad = new admin(); ad.Show(); } else if (dialogResult == DialogResult.No) { } }
private void Go_Click(object sender, EventArgs e) { if (wus.Text == "" || wps.Text == "") { MessageBox.Show("Pls enter information"); } else { int lcResult = Convert.ToInt32(clsDbConnection.DbFunction("checksignin", new Dictionary <string, object> { ["us"] = wus.Text, ["ps"] = wps.Text })); admin ad = new admin(); signin sg = new signin(); member mem = new member(wus.Text); switch (lcResult) { case 0: { MessageBox.Show("You enntered incorrect info"); sg.Show(); this.Hide(); int lcattempt = Convert.ToInt32(clsDbConnection.DbFunction("attemptincrease", new Dictionary <string, object> { ["prUserName"] = wus.Text })); break; } case 1: { DataTable dtResetAttempt = clsDbConnection.SProcTable("resetSigninAttempt", new Dictionary <string, object> { ["prUserName"] = wus.Text }); MessageBox.Show("You logged in"); this.Hide(); mem.Show(); break; } case 2: { MessageBox.Show("You registered successfully"); mem.Show(); this.Hide(); break; } case 3: { ad.Show(); this.Hide(); break; } case 4: { MessageBox.Show("You have failed so many times!!! Contact admin"); sg.Show(); this.Hide(); break; } case 5: { MessageBox.Show("You already sign in!!"); sg.Show(); this.Hide(); break; } } } }