Beispiel #1
0
 public void setPlayersGamesNum(PlayerGames[] playersGames)
 {
     this.queryObjects = playersGames;
     string[] titles   = { "Name", "NumberOfGames" };
     string[] types    = { "char", "int" };
     bool[]   readOnly = { true, true };
     bool[]   nullable = { false, false };
     ctrl = new QueryControl(queryObjects, titles, types, readOnly, nullable);
     tableElementHost.Child = ctrl;
     ctrl.setSelectionType(cbDelType.SelectedIndex == 1);
 }
Beispiel #2
0
 public void setCitiesChampionshipsNum(CityChampionships[] citiesChmps)
 {
     this.queryObjects = citiesChmps;
     string[] titles   = { "City", "NumberOfChampionships" };
     string[] types    = { "char", "int" };
     bool[]   readOnly = { true, true };
     bool[]   nullable = { false, false };
     ctrl = new QueryControl(queryObjects, titles, types, readOnly, nullable);
     tableElementHost.Child = ctrl;
     ctrl.setSelectionType(cbDelType.SelectedIndex == 1);
 }
Beispiel #3
0
 public void setChampionshipsQuery(ChampionshipData[] chmps)
 {
     this.queryObjects = chmps;
     string[] titles   = { "Id", "City", "StartDate", "EndDate", "Picture" };
     string[] types    = { "int", "char", "datetime", "datetime", "image" };
     bool[]   readOnly = { true, false, false, false, false };
     bool[]   nullable = { false, false, false, true, true };
     ctrl = new QueryControl(queryObjects, titles, types, readOnly, nullable);
     tableElementHost.Child = ctrl;
     ctrl.setSelectionType(cbDelType.SelectedIndex == 1);
 }
Beispiel #4
0
 public void setGamesQuery(GameData[] games)
 {
     this.queryObjects = games;
     string[] titles   = { "Id", "Player1_Name", "Player2_Name", "Winner_Name", "BoardSize", "StartTime", "EndTime" };
     string[] types    = { "int", "char", "char", "char", "int", "datetime", "datetime" };
     bool[]   readOnly = { true, false, false, false, true, false, false };
     bool[]   nullable = { false, false, false, true, false, false, false };
     ctrl = new QueryControl(queryObjects, titles, types, readOnly, nullable);
     tableElementHost.Child = ctrl;
     ctrl.setSelectionType(cbDelType.SelectedIndex == 1);
 }
Beispiel #5
0
 public void setGameAdvisorsQuery(PlayerData[] advisors)
 {
     this.queryObjects = advisors;
     string[] titles   = { "Id", "FirstName", "LastName", "City", "Country", "Phone", "AdviseTo_Name" };
     string[] types    = { "int", "char", "char", "char", "char", "phone", "int" };
     bool[]   readOnly = { true, false, false, false, false, false, false };
     bool[]   nullable = { false, false, true, true, true, true, true };
     ctrl = new QueryControl(queryObjects, titles, types, readOnly, nullable);
     tableElementHost.Child = ctrl;
     ctrl.setSelectionType(cbDelType.SelectedIndex == 1);
 }
Beispiel #6
0
        private void cbSubQuery_SelectedIndexChanged(object sender, EventArgs e)
        {
            ctrl = null;
            tableElementHost.Child = null;

            switch (cbQuery.SelectedIndex)
            {
            case 3:
                if (subQueryObjects != null && subQueryObjects is PlayerData[] && cbSubQuery.SelectedIndex >= 0 && cbSubQuery.SelectedIndex < subQueryObjects.Length)
                {
                    enableComponents(true, false);
                    int id = ((PlayerData)subQueryObjects[cbSubQuery.SelectedIndex]).Id;
                    mainForm.getClient().getAllGames(true, id, "Q", cbDelay.Checked);
                }
                break;

            case 4:
                if (subQueryObjects != null && subQueryObjects is PlayerData[] && cbSubQuery.SelectedIndex >= 0 && cbSubQuery.SelectedIndex < subQueryObjects.Length)
                {
                    enableComponents(true, true);
                    int id = ((PlayerData)subQueryObjects[cbSubQuery.SelectedIndex]).Id;
                    mainForm.getClient().getAllChampionships(id, "Q", cbDelay.Checked);
                }
                break;

            case 5:
                if (subQueryObjects != null && subQueryObjects is GameData[] && cbSubQuery.SelectedIndex >= 0 && cbSubQuery.SelectedIndex < subQueryObjects.Length)
                {
                    enableComponents(true, true);
                    mainForm.getClient().getGamePlayers((GameData)subQueryObjects[cbSubQuery.SelectedIndex], cbDelay.Checked);
                }
                break;

            case 6:
                if (subQueryObjects != null && subQueryObjects is GameData[] && cbSubQuery.SelectedIndex >= 0 && cbSubQuery.SelectedIndex < subQueryObjects.Length)
                {
                    enableComponents(true, true);
                    mainForm.getClient().getGameAdvisors((GameData)subQueryObjects[cbSubQuery.SelectedIndex], cbDelay.Checked);
                }
                break;

            case 7:
                if (subQueryObjects != null && subQueryObjects is ChampionshipData[] && cbSubQuery.SelectedIndex >= 0 && cbSubQuery.SelectedIndex < subQueryObjects.Length)
                {
                    enableComponents(true, true);
                    mainForm.getClient().getChampionshipPlayers((ChampionshipData)subQueryObjects[cbSubQuery.SelectedIndex], cbDelay.Checked);
                }
                break;
            }
        }
Beispiel #7
0
        private void cbQuery_SelectedIndexChanged(object sender, EventArgs e)
        {
            ctrl = null;
            tableElementHost.Child = null;

            switch (cbQuery.SelectedIndex)
            {
            case 0:
                enableComponents(false, true);
                mainForm.getClient().getAllUsers("Q", cbDelay.Checked);
                break;

            case 1:
                enableComponents(false, false);
                mainForm.getClient().getAllGames(true, -1, "Q", cbDelay.Checked);
                break;

            case 2:
                enableComponents(false, true);
                mainForm.getClient().getAllChampionships(-1, "Q", cbDelay.Checked);
                break;

            case 3:
            case 4:
                mainForm.getClient().getAllUsers("SQ", false);
                break;

            case 5:
            case 6:
                mainForm.getClient().getAllGames(false, -1, "SQ", false);
                break;

            case 7:
                mainForm.getClient().getAllChampionships(-1, "SQ", false);
                break;

            case 8:
                enableComponents(false, false);
                mainForm.getClient().getPlayersGamesNum(cbDelay.Checked);
                break;

            case 9:
                enableComponents(false, false);
                mainForm.getClient().getCitiesChampionshipsNum(cbDelay.Checked);
                break;
            }
        }