public void UpdateMenuFormForRole() { string role = ConnectVariables.GetRoleViewAs(); if (role == "Observer") { btnCharCreate.Enabled = false; btnParCreate.Enabled = false; btnCharBrowse.Enabled = true; btnViewParty.Enabled = true; } else if (role == "Player") { btnCharCreate.Enabled = true; btnParCreate.Enabled = false; btnCharBrowse.Enabled = true; btnViewParty.Enabled = true; } else if (role == "Dungeon Master") { btnCharCreate.Enabled = false; btnParCreate.Enabled = true; btnCharBrowse.Enabled = true; btnViewParty.Enabled = true; } }
private void btnViewParty_Click(object sender, EventArgs e) { selectedParty = dbListPartiesList.CurrentRow.Index; Console.WriteLine("\nPARTY LIST FORM: Selected Party for Party View: " + selectedParty); string partyID = "", partyCreatorID = ""; try { partyID = dbListPartiesList.Rows[selectedParty].Cells[2].Value.ToString(); partyCreatorID = dbListPartiesList.Rows[selectedParty].Cells[3].Value.ToString(); ConnectVariables.SetPartyOwnerIDDP(partyCreatorID); } catch (Exception x) { Console.WriteLine(x.Message); } Console.WriteLine("\nPARTY LIST FORM: PartyID for Party View: " + partyID); ConnectVariables.SetPartyIDDP(partyID); ConnectDataBases.GetParty(selectedParty, 'P', Int32.Parse(partyID)); FormClass.parMakeF.Update('D'); FormClass.parMakeF.Update('R'); FormClass.parMakeF.Update('G'); FormClass.partyLF.Hide(); FormClass.parMakeF.Show(); }
private void passwordManagerToolStripMenuItem_Click(object sender, EventArgs e) { bool loggedIn = true; string form = "menuF"; Console.WriteLine("\n\nForm: " + form); ConnectVariables.SetPasswordRecoverViewAs(loggedIn); ConnectVariables.SetLasetLoggedFormAs(form);; FormClass.pwreF.Visible = true; FormClass.menuF.Hide(); FormClass.pwreF.UpdatePWRecoverForm(); }
private void linkPWReset_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.Visible = false; bool loggedIn = false; string form = "loginF"; Console.WriteLine("\n\nForm: " + form); ConnectVariables.SetPasswordRecoverViewAs(loggedIn); ConnectVariables.SetLasetLoggedFormAs(form); FormClass.pwreF.Visible = true; FormClass.pwreF.UpdatePWRecoverForm(); }
public void UpdatePWRecoverForm() { System.Console.WriteLine("ENTERING PW RECOVER LOADING"); bool viewAsLoggedIn; viewAsLoggedIn = ConnectVariables.GetPasswordRecoverViewAs(); if (viewAsLoggedIn == false) { gbxChangePW.Hide(); } else { gbxChangePW.Show(); } gbxRecoverPW.Show(); }
private void btnViewParty_Click(object sender, EventArgs e) { FormClass.menuF.Hide(); if (ConnectVariables.GetRoleViewAs() == "Observer") { FormClass.partyLF.Update('A'); FormClass.parMakeF.Update('V'); FormClass.partyLF.Update('C'); FormClass.menuF.Hide(); FormClass.partyLF.Show(); } else { FormClass.pSEF.Show(); } }
private void btnReturn_Click(object sender, EventArgs e) { string lastForm = ""; lastForm = ConnectVariables.GetLasetLoggedFormAs(); FormClass.pwreF.Hide(); if (lastForm == "loginF") { FormClass.sf.Show(); } else if (lastForm == "menuF") { FormClass.menuF.Show(); FormClass.menuF.UpdateMenuFormForRole(); } }
private void btnAdd2Pt_Click(object sender, EventArgs e) { bool found = ConnectDataBases.SearchForUser(txtbxSearch.Text); bool copy = false; if (found) { for (int i = 0; i < dbListPartyList.Rows.Count; i++) { Console.WriteLine("\nPARTY MAKER FORM: i : " + i); if (dbListPartyList.Rows.Count > 0) { Console.WriteLine("\nPARTY MAKER FORM: " + dbListPartyList.Rows[i].Cells[0].Value.ToString()); if (dbListPartyList.Rows[i].Cells[0].Value.ToString() == txtbxSearch.Text) { copy = true; } else { copy = false; } } else { copy = false; } } if (copy) { MessageBox.Show("A person can only join once!"); } else { rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectVariables.GetUsernameDP(); dbListPartyList.Rows[rowIndex].Cells[1].Value = ConnectVariables.GetUserIDDP(); } } }
public void LoadForm() { txtPartyName.Text = ConnectVariables.GetPartyNameDP(); txtPartyCreatorName.Text = ConnectDataBases.GetUsername(ConnectVariables.GetPartyOwnerIDDP()); ConnectDataBases.GetPartyPlayerAmnt(); ConnectDataBases.GetPartyCharacterAmnt(); int pInt = Int32.Parse(ConnectVariables.GetPlayerAmntDP()), cInt = Int32.Parse(ConnectVariables.GetCharacterAmntDP()), rowIndex = 0; Console.WriteLine("\nPARTY MAKER FORM: pInt Value: " + pInt); Console.WriteLine("\nPARTY MAKER FORM: cInt Value: " + cInt); if (pInt > 0) { switch (pInt) { case 1: { rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer1IDDP()); break; } case 2: { rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer1IDDP()); rowIndex += dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer2IDDP()); break; } case 3: { rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer1IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer2IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer3IDDP()); break; } case 4: { rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer1IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer2IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer3IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer4IDDP()); break; } case 5: { rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer1IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer2IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer3IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer4IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer5IDDP()); break; } case 6: { rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer1IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer2IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer3IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer4IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer5IDDP()); rowIndex = dbListPartyList.Rows.Add(); dbListPartyList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPlayer6IDDP()); break; } } } if (cInt > 0) { switch (cInt) { case 1: { rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar1IDDP()); break; } case 2: { rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar1IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar2IDDP()); break; } case 3: { rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar1IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar2IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar3IDDP()); break; } case 4: { rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar1IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar2IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar3IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar4IDDP()); break; } case 5: { rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar1IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar2IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar3IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar4IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar5IDDP()); break; } case 6: { rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar1IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar2IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar3IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar4IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar5IDDP()); rowIndex = dbListCharList.Rows.Add(); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetUsername(ConnectVariables.GetChar6IDDP()); break; } } } }
public void Update(char VALUE = '0') { //Load all the info from the vairables saved if (VALUE == 'D') { Console.WriteLine("\nPARTY MAKER FORM: Updating Search Text"); Console.WriteLine("\nPARTY MAKER FORM: Value of viewBy: " + viewBy); txtbxSearch.Text = "Search by Username"; txtbxSearch.ForeColor = Color.LightGray; if (viewBy == 'V') { Console.WriteLine("\nPARTY MAKER FORM: Entered as Viewer"); txtPartyName.Enabled = false; btnSave.Visible = false; btnAdd2Pt.Visible = false; btnRemovePt.Visible = false; lblAddUser.Enabled = false; txtbxSearch.Enabled = false; btnDeleteParty.Enabled = false; btnSelectChar.Visible = false; btnLoadParty.Visible = true; } else { if (ConnectVariables.GetRoleViewAs() == "Dungeon Master") { Console.WriteLine("\nPARTY MAKER FORM: Entered as DM"); txtPartyName.Enabled = true; btnSave.Visible = true; btnAdd2Pt.Visible = true; btnRemovePt.Visible = true; lblAddUser.Enabled = true; txtbxSearch.Enabled = true; btnDeleteParty.Enabled = true; btnSelectChar.Visible = false; btnLoadParty.Visible = false; } else if (ConnectVariables.GetRoleViewAs() == "Player") { Console.WriteLine("\nPARTY MAKER FORM: Entered as Player"); txtPartyName.Enabled = false; btnSave.Visible = true; btnAdd2Pt.Visible = false; btnRemovePt.Visible = false; lblAddUser.Enabled = false; txtbxSearch.Enabled = false; btnDeleteParty.Enabled = false; btnSelectChar.Visible = true; btnLoadParty.Visible = true; } } } else if (VALUE == 'V') { viewBy = 'V'; } else if (VALUE == 'N') { viewBy = 'N'; } else if (VALUE == 'L') { dbListCharList.Rows.Clear(); dbListPartyList.Rows.Clear(); txtPartyName.Text = ""; } else if (VALUE == 'P') { ConnectDataBases.UpdatePartyAmount(); } else if (VALUE == 'R') { LoadForm(); } else if (VALUE == 'S') { string role = ConnectVariables.GetRoleViewAs(); string playerID1 = "", playerID2 = "", playerID3 = "", playerID4 = "", playerID5 = "", playerID6 = "", charID1 = "", charID2 = "", charID3 = "", charID4 = "", charID5 = "", charID6 = "", userID = ConnectVariables.GetLoggedInUsernameAs(), partyID = ConnectVariables.GetPartyIDDP(), partyName = txtPartyName.Text; ConnectVariables.SetPartyNameDP(partyName); userID = ConnectDataBases.GetUserId(userID); int pInt = dbListPartyList.Rows.Count, cInt = dbListCharList.Rows.Count; Console.WriteLine("\nPARTY MAKER FORM: pInt Value: " + pInt); Console.WriteLine("\nPARTY MAKER FORM: cInt Value: " + cInt); if (role == "Dungeon Master") { if (txtPartyName.Text == "") { MessageBox.Show("Please fill out all input before saving."); } else { if (pInt > 0) { switch (pInt) { case 1: { playerID1 = ConnectDataBases.GetUserId(dbListPartyList.Rows[0].Cells[0].Value.ToString()); playerID2 = ""; playerID3 = ""; playerID4 = ""; playerID5 = ""; playerID6 = ""; break; } case 2: { playerID1 = ConnectDataBases.GetUserId(dbListPartyList.Rows[0].Cells[0].Value.ToString()); playerID2 = ConnectDataBases.GetUserId(dbListPartyList.Rows[1].Cells[0].Value.ToString()); playerID3 = ""; playerID4 = ""; playerID5 = ""; playerID6 = ""; break; } case 3: { playerID1 = ConnectDataBases.GetUserId(dbListPartyList.Rows[0].Cells[0].Value.ToString()); playerID2 = ConnectDataBases.GetUserId(dbListPartyList.Rows[1].Cells[0].Value.ToString()); playerID3 = ConnectDataBases.GetUserId(dbListPartyList.Rows[2].Cells[0].Value.ToString()); playerID4 = ""; playerID5 = ""; playerID6 = ""; break; } case 4: { playerID1 = ConnectDataBases.GetUserId(dbListPartyList.Rows[0].Cells[0].Value.ToString()); playerID2 = ConnectDataBases.GetUserId(dbListPartyList.Rows[1].Cells[0].Value.ToString()); playerID3 = ConnectDataBases.GetUserId(dbListPartyList.Rows[2].Cells[0].Value.ToString()); playerID4 = ConnectDataBases.GetUserId(dbListPartyList.Rows[3].Cells[0].Value.ToString()); playerID5 = ""; playerID6 = ""; break; } case 5: { playerID1 = ConnectDataBases.GetUserId(dbListPartyList.Rows[0].Cells[0].Value.ToString()); playerID2 = ConnectDataBases.GetUserId(dbListPartyList.Rows[1].Cells[0].Value.ToString()); playerID3 = ConnectDataBases.GetUserId(dbListPartyList.Rows[2].Cells[0].Value.ToString()); playerID4 = ConnectDataBases.GetUserId(dbListPartyList.Rows[3].Cells[0].Value.ToString()); playerID5 = ConnectDataBases.GetUserId(dbListPartyList.Rows[4].Cells[0].Value.ToString()); playerID6 = ""; break; } case 6: { playerID1 = ConnectDataBases.GetUserId(dbListPartyList.Rows[0].Cells[0].Value.ToString()); playerID2 = ConnectDataBases.GetUserId(dbListPartyList.Rows[1].Cells[0].Value.ToString()); playerID3 = ConnectDataBases.GetUserId(dbListPartyList.Rows[2].Cells[0].Value.ToString()); playerID4 = ConnectDataBases.GetUserId(dbListPartyList.Rows[3].Cells[0].Value.ToString()); playerID5 = ConnectDataBases.GetUserId(dbListPartyList.Rows[4].Cells[0].Value.ToString()); playerID6 = ConnectDataBases.GetUserId(dbListPartyList.Rows[5].Cells[0].Value.ToString()); break; } } } if (cInt > 0) { switch (cInt) { case 1: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ""; charID3 = ""; charID4 = ""; charID5 = ""; charID6 = ""; break; } case 2: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ""; charID4 = ""; charID5 = ""; charID6 = ""; break; } case 3: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ConnectDataBases.GetUserId(dbListCharList.Rows[2].Cells[0].Value.ToString()); charID4 = ""; charID5 = ""; charID6 = ""; break; } case 4: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ConnectDataBases.GetUserId(dbListCharList.Rows[2].Cells[0].Value.ToString()); charID4 = ConnectDataBases.GetUserId(dbListCharList.Rows[3].Cells[0].Value.ToString()); charID5 = ""; charID6 = ""; break; } case 5: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ConnectDataBases.GetUserId(dbListCharList.Rows[2].Cells[0].Value.ToString()); charID4 = ConnectDataBases.GetUserId(dbListCharList.Rows[3].Cells[0].Value.ToString()); charID5 = ConnectDataBases.GetUserId(dbListCharList.Rows[4].Cells[0].Value.ToString()); charID6 = ""; break; } case 6: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ConnectDataBases.GetUserId(dbListCharList.Rows[2].Cells[0].Value.ToString()); charID4 = ConnectDataBases.GetUserId(dbListCharList.Rows[3].Cells[0].Value.ToString()); charID5 = ConnectDataBases.GetUserId(dbListCharList.Rows[4].Cells[0].Value.ToString()); charID6 = ConnectDataBases.GetUserId(dbListCharList.Rows[5].Cells[0].Value.ToString()); break; } } } ConnectDataBases.UpdateParty(pInt, cInt, userID, partyID, partyName, playerID1, playerID2, playerID3, playerID4, playerID5, playerID6, charID1, charID2, charID3, charID4, charID5, charID6); ConnectVariables.SetPlayer1IDDP(playerID1); ConnectVariables.SetPlayer2IDDP(playerID2); ConnectVariables.SetPlayer3IDDP(playerID3); ConnectVariables.SetPlayer4IDDP(playerID4); ConnectVariables.SetPlayer5IDDP(playerID5); ConnectVariables.SetPlayer6IDDP(playerID6); ConnectVariables.SetChar1IDDP(charID1); ConnectVariables.SetChar2IDDP(charID2); ConnectVariables.SetChar3IDDP(charID3); ConnectVariables.SetChar4IDDP(charID4); ConnectVariables.SetChar5IDDP(charID5); ConnectVariables.SetChar6IDDP(charID6); } } else if (role == "Player") { if (cInt > 0) { switch (cInt) { case 1: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ""; charID3 = ""; charID4 = ""; charID5 = ""; charID6 = ""; break; } case 2: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ""; charID4 = ""; charID5 = ""; charID6 = ""; break; } case 3: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ConnectDataBases.GetUserId(dbListCharList.Rows[2].Cells[0].Value.ToString()); charID4 = ""; charID5 = ""; charID6 = ""; break; } case 4: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ConnectDataBases.GetUserId(dbListCharList.Rows[2].Cells[0].Value.ToString()); charID4 = ConnectDataBases.GetUserId(dbListCharList.Rows[3].Cells[0].Value.ToString()); charID5 = ""; charID6 = ""; break; } case 5: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ConnectDataBases.GetUserId(dbListCharList.Rows[2].Cells[0].Value.ToString()); charID4 = ConnectDataBases.GetUserId(dbListCharList.Rows[3].Cells[0].Value.ToString()); charID5 = ConnectDataBases.GetUserId(dbListCharList.Rows[4].Cells[0].Value.ToString()); charID6 = ""; break; } case 6: { charID1 = ConnectDataBases.GetUserId(dbListCharList.Rows[0].Cells[0].Value.ToString()); charID2 = ConnectDataBases.GetUserId(dbListCharList.Rows[1].Cells[0].Value.ToString()); charID3 = ConnectDataBases.GetUserId(dbListCharList.Rows[2].Cells[0].Value.ToString()); charID4 = ConnectDataBases.GetUserId(dbListCharList.Rows[3].Cells[0].Value.ToString()); charID5 = ConnectDataBases.GetUserId(dbListCharList.Rows[4].Cells[0].Value.ToString()); charID6 = ConnectDataBases.GetUserId(dbListCharList.Rows[5].Cells[0].Value.ToString()); break; } } } ConnectDataBases.UpdateParty(pInt, cInt, userID, partyID, partyName, playerID1, playerID2, playerID3, playerID4, playerID5, playerID6, charID1, charID2, charID3, charID4, charID5, charID6); ConnectVariables.SetPlayer1IDDP(playerID1); ConnectVariables.SetPlayer2IDDP(playerID2); ConnectVariables.SetPlayer3IDDP(playerID3); ConnectVariables.SetPlayer4IDDP(playerID4); ConnectVariables.SetPlayer5IDDP(playerID5); ConnectVariables.SetPlayer6IDDP(playerID6); ConnectVariables.SetChar1IDDP(charID1); ConnectVariables.SetChar2IDDP(charID2); ConnectVariables.SetChar3IDDP(charID3); ConnectVariables.SetChar4IDDP(charID4); ConnectVariables.SetChar5IDDP(charID5); ConnectVariables.SetChar6IDDP(charID6); } } }
private void btnChangePW_Click(object sender, EventArgs e) { string loggedInUsername = ConnectVariables.GetLoggedInUsernameAs(); ConnectDataBases.ResetPassword(loggedInUsername, txtNewPW.Text, txtConfirmNewPW.Text); }
public void Update(char VALUE = '0', string classText = "0") { Console.WriteLine("VALUE: " + VALUE); if (VALUE == 'M')//update button for creating characters { //FEATURES lblUsernameToPresent.Text = ConnectVariables.GetLoggedInUsernameAs(); txtCharName.Enabled = true; btnRaceOpt.Enabled = true; cmbGender.Enabled = true; btnClassOpt.Enabled = true; cmbElemental.Enabled = true; btnStrMinus.Enabled = true; btnStrPlus.Enabled = true; btnConMinus.Enabled = true; btnConPlus.Enabled = true; btnDexMinus.Enabled = true; btnDexPlus.Enabled = true; btnWisMinus.Enabled = true; btnWisPlus.Enabled = true; btnIntMinus.Enabled = true; btnIntPlus.Enabled = true; btnLukMin.Enabled = true; btnLukPlus.Enabled = true; cmbTalent1.Enabled = true; cmbTalent2.Enabled = true; cmbTalent3.Enabled = true; cmbQuirk1.Enabled = true; cmbQuirk2.Enabled = true; cmbQuirk3.Enabled = true; //CONTROLLS btnClear.Visible = true; btnSave.Visible = false; btnCreate.Visible = true; btnSelect.Visible = false; } else if (VALUE == 'L')//update button for loading characters you own { //FEATURES txtCharName.Enabled = true; btnRaceOpt.Enabled = true; cmbGender.Enabled = true; btnClassOpt.Enabled = true; cmbElemental.Enabled = true; btnStrMinus.Enabled = true; btnStrPlus.Enabled = true; btnConMinus.Enabled = true; btnConPlus.Enabled = true; btnDexMinus.Enabled = true; btnDexPlus.Enabled = true; btnWisMinus.Enabled = true; btnWisPlus.Enabled = true; btnIntMinus.Enabled = true; btnIntPlus.Enabled = true; btnLukMin.Enabled = true; btnLukPlus.Enabled = true; cmbTalent1.Enabled = true; cmbTalent2.Enabled = true; cmbTalent3.Enabled = true; cmbQuirk1.Enabled = true; cmbQuirk2.Enabled = true; cmbQuirk3.Enabled = true; //CONTROLLS btnClear.Visible = true; btnSave.Visible = true; btnCreate.Visible = false; btnSelect.Visible = false; } else if (VALUE == 'O')//update button for loading characters you dont own { //FEATURES txtCharName.Enabled = false; btnRaceOpt.Enabled = false; cmbGender.Enabled = false; btnClassOpt.Enabled = false; cmbElemental.Enabled = false; btnStrMinus.Enabled = false; btnStrPlus.Enabled = false; btnConMinus.Enabled = false; btnConPlus.Enabled = false; btnDexMinus.Enabled = false; btnDexPlus.Enabled = false; btnWisMinus.Enabled = false; btnWisPlus.Enabled = false; btnIntMinus.Enabled = false; btnIntPlus.Enabled = false; btnChaMinus.Enabled = false; btnChaPlus.Enabled = false; btnLukMin.Enabled = false; btnLukPlus.Enabled = false; cmbTalent1.Enabled = false; cmbTalent2.Enabled = false; cmbTalent3.Enabled = false; cmbQuirk1.Enabled = false; cmbQuirk2.Enabled = false; cmbQuirk3.Enabled = false; //CONTROLLS btnClear.Visible = false; btnSave.Visible = false; btnCreate.Visible = false; btnSelect.Visible = false; } else if (VALUE == 'R')//update race { Console.WriteLine("Updated Race"); lblRace.Text = char_Race; } else if (VALUE == 'C') { if (classText == "0") { Console.WriteLine("Updated Class"); Console.WriteLine("Class: " + char_Class); lblClass.Text = char_Class; } if (lblClass.Text == "Brute") { System.Console.WriteLine("Class Setting Image: " + lblClass.Text); Image image1 = Image.FromFile("BruteIcon.jpg"); picClassIcon.BackgroundImage = image1; System.Console.WriteLine("Class Set Image: " + lblClass.Text); } else if (lblClass.Text == "Guardsman") { Image image2 = Image.FromFile("GuardsmanIcon.jpg"); picClassIcon.BackgroundImage = image2; } else if (lblClass.Text == "Oracle") { Image image3 = Image.FromFile("OracleIcon.jpg"); picClassIcon.BackgroundImage = image3; } else if (lblClass.Text == "Archon") { Image image4 = Image.FromFile("ArchonIcon.jpg"); picClassIcon.BackgroundImage = image4; } else if (lblClass.Text == "Huntsman") { Image image5 = Image.FromFile("HuntsmanIcon.jpg"); picClassIcon.BackgroundImage = image5; } else if (lblClass.Text == "Reprobate") { Image image6 = Image.FromFile("ReprobateIcon.jpg"); picClassIcon.BackgroundImage = image6; } else if (lblClass.Text == "Reaper") { Image image7 = Image.FromFile("ReaperIcon.jpg"); picClassIcon.BackgroundImage = image7; } else if (lblClass.Text == "Caster") { Image image8 = Image.FromFile("CasterIcon.jpg"); picClassIcon.BackgroundImage = image8; } else if (lblClass.Text == "Elementalist") { Image image9 = Image.FromFile("ElementalistIcon.jpg"); picClassIcon.BackgroundImage = image9; } }//update class else if (VALUE == 'F')//Load Pre Existing Info For Characters { string c = "updateImage"; lblUsernameToPresent.Text = ConnectVariables.GetUsernameDP(); txtCharName.Text = ConnectVariables.GetCharNameDP(); lblRace.Text = ConnectVariables.GetCharRaceDP(); cmbGender.Text = ConnectVariables.GetCharGenderDP(); lblClass.Text = ConnectVariables.GetCharClassDP(); cmbElemental.Text = ConnectVariables.GetCharElementDP(); lblStr.Text = ConnectVariables.GetCharStrengthDP(); lblCon.Text = ConnectVariables.GetCharConstDP(); lblDex.Text = ConnectVariables.GetCharDexDP(); lblWis.Text = ConnectVariables.GetCharWisDP(); lblInt.Text = ConnectVariables.GetCharIntelDP(); lblCha.Text = ConnectVariables.GetCharCharismaDP(); lblLuk.Text = ConnectVariables.GetCharLuckDP(); lblBrawn.Text = ConnectVariables.GetCharBrawnDP(); lblHealth.Text = ConnectVariables.GetCharHealthDP(); lblNimble.Text = ConnectVariables.GetCharNimDP(); lblMemory.Text = ConnectVariables.GetCharMemDP(); lblClever.Text = ConnectVariables.GetCharCleverDP(); lblCharm.Text = ConnectVariables.GetCharCharmDP(); cmbTalent1.Text = ConnectVariables.GetCharTalDP1(); cmbTalent2.Text = ConnectVariables.GetCharTalDP2(); cmbTalent3.Text = ConnectVariables.GetCharTalDP3(); cmbQuirk1.Text = ConnectVariables.GetCharQuiDP1(); cmbQuirk2.Text = ConnectVariables.GetCharQuiDP2(); cmbQuirk3.Text = ConnectVariables.GetCharQuiDP3(); Update('C', c); } else if (VALUE == 'X') { lblUsernameToPresent.Text = ""; txtCharName.Text = ""; lblRace.Text = ""; cmbGender.Text = ""; lblClass.Text = ""; cmbElemental.Text = ""; lblStr.Text = ""; lblCon.Text = ""; lblDex.Text = ""; lblWis.Text = ""; lblInt.Text = ""; lblCha.Text = ""; lblLuk.Text = ""; lblBrawn.Text = ""; lblHealth.Text = ""; lblNimble.Text = ""; lblMemory.Text = ""; lblClever.Text = ""; lblCharm.Text = ""; cmbTalent1.Text = ""; cmbTalent2.Text = ""; cmbTalent3.Text = ""; cmbQuirk1.Text = ""; cmbQuirk2.Text = ""; cmbQuirk3.Text = ""; } Console.WriteLine("UPDATED CF FORM!"); }
public void Update(char VALUE = '0') { if (VALUE == 'C')//Player Character from character creation/update forms { Update('L'); maxPages = maxCharIndex / 10; rowIndex = 0; // Updates index page if (pages < 0) { currentCharIndex = 0; } else if (pages == maxPages) { currentCharIndex = rowIndex + pages * 10; } else { currentCharIndex = rowIndex + pages * 10; } for (int i = currentCharIndex; i < maxCharIndex && rowIndex <= 9; i++) { rowIndex = dbListCharList.Rows.Add(); ConnectDataBases.GetUsersCharacters(i + 1, searchFor); dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectVariables.GetCharNameDP(); dbListCharList.Rows[rowIndex].Cells[1].Value = ConnectVariables.GetCharGenderDP(); dbListCharList.Rows[rowIndex].Cells[2].Value = ConnectVariables.GetCharClassDP(); dbListCharList.Rows[rowIndex].Cells[3].Value = ConnectVariables.GetCharRaceDP(); dbListCharList.Rows[rowIndex].Cells[4].Value = ConnectVariables.GetUsernameDP(); dbListCharList.Rows[rowIndex].Cells[5].Value = ConnectVariables.GetCharIDDP(); currentCharIndex = i; Console.WriteLine("Current Page Index: " + pages); Console.WriteLine("Max Page Index: " + maxPages); Console.WriteLine("Row Index: " + rowIndex); Console.WriteLine("Current Char Index: " + currentCharIndex); Console.WriteLine("Max Char Index: " + maxCharIndex); } //Button Updates to page Update('O'); } else if (VALUE == 'P')//Last Page { pages -= 1; Update('C'); } else if (VALUE == 'N')//Next Page { pages += 1; Update('C'); } else if (VALUE == 'L') { dbListCharList.Rows.Clear(); } else if (VALUE == 'M')// Return to menu { currentCharIndex = 0; pages = 0; Update('L'); returnValue = 'M'; } else if (VALUE == 'B')// Return to char Create form { currentCharIndex = 0; pages = 0; Update('L'); returnValue = 'B'; } else if (VALUE == 'O')//update buttons { if (pages <= 0) { pages = 0; btnPrevious.Enabled = false; btnNext.Enabled = true; } else if (pages == maxPages) { btnNext.Enabled = false; btnPrevious.Enabled = true; } else { btnPrevious.Enabled = true; btnNext.Enabled = true; } } else if (VALUE == 'A') { maxCharIndex = ConnectDataBases.GetAllCharacters(); searchFor = 'A'; } else if (VALUE == 'Z') { maxCharIndex = ConnectDataBases.GetUsersCharactersAmount(); searchFor = 'Z'; } else if (VALUE == 'S') { partyCharSelet = true; } }
public void Update(char VALUE = '0') { if (VALUE == 'C') { Update('L'); maxPages = maxPartyIndex / 10; rowIndex = 0; // Updates index page if (pages < 0) { currentPartyIndex = 0; } else if (pages == maxPages) { currentPartyIndex = rowIndex + pages * 10; } else { currentPartyIndex = rowIndex + pages * 10; } for (int i = currentPartyIndex; i < maxPartyIndex && rowIndex <= 9; i++) { rowIndex = dbListPartiesList.Rows.Add(); ConnectDataBases.GetParty(i + 1, searchFor); //CREATE CV FOR PARTIES dbListPartiesList.Rows[rowIndex].Cells[0].Value = ConnectDataBases.GetPartyName(ConnectVariables.GetPartyIDDP()); dbListPartiesList.Rows[rowIndex].Cells[1].Value = ConnectDataBases.GetUsername(ConnectVariables.GetPartyOwnerIDDP()); dbListPartiesList.Rows[rowIndex].Cells[2].Value = ConnectVariables.GetPartyIDDP(); dbListPartiesList.Rows[rowIndex].Cells[3].Value = ConnectVariables.GetPartyOwnerIDDP(); currentPartyIndex = i; Console.WriteLine("\n''PARTY LIST FORM: Party Name: " + ConnectDataBases.GetPartyName(ConnectVariables.GetPartyIDDP())); Console.WriteLine(" Party owner Username: "******" Current Page Index: " + pages); Console.WriteLine(" Max Page Index: " + maxPages); Console.WriteLine(" Row Index: " + rowIndex); Console.WriteLine(" Current Party Index: " + currentPartyIndex); Console.WriteLine("''Max Party Index: " + maxPartyIndex); } //Button Updates to page Update('O'); } else if (VALUE == 'L') { dbListPartiesList.Rows.Clear(); dbListPlayersCharactersList.Rows.Clear(); } else if (VALUE == 'O')//update buttons { if (pages <= 0) { pages = 0; btnPrevious.Enabled = false; btnNext.Enabled = true; } else if (pages == maxPages) { btnNext.Enabled = false; btnPrevious.Enabled = true; } else { btnPrevious.Enabled = true; btnNext.Enabled = true; } } else if (VALUE == 'A') { maxPartyIndex = ConnectDataBases.GetAllParties(); searchFor = 'A'; } else if (VALUE == 'Z') { maxPartyIndex = ConnectDataBases.GetUsersPartyAmount(); searchFor = 'Z'; } else if (VALUE == 'P')//Last Page { pages -= 1; Update('C'); } else if (VALUE == 'N')//Next Page { pages += 1; Update('C'); } }