Esempio n. 1
0
        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;
                }
                }
            }
        }