예제 #1
0
        public ObservableCollection <csLeague> LeaguesBySport(int idSport)
        {
            ObservableCollection <csLeague> leagueList = new ObservableCollection <csLeague>();

            try
            {
                parameters.Add("@pIdSport", idSport);
                dataset = csPinnacle.ExecutePA("[dbo].[web_getLeagues]", parameters);
                if (dataset.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow fila in dataset.Tables[0].Rows)
                    {
                        csLeague league = new csLeague(Convert.ToString(fila["leagueID"]),
                                                       Convert.ToString(fila["leagueName"]));
                        leagueList.Add(league);
                    }
                }
                else
                {
                    leagueList = null;
                }
            }
            catch (Exception)
            {
                // MessageBox.Show("Error,   " + ex.Message);
            }
            finally
            {
                parameters.Clear();
            }

            return(leagueList);
        }
예제 #2
0
        public ObservableCollection <csLeague> LeaguesByPlayerBI(string d1, string d2, string player, string sport)
        {
            ObservableCollection <csLeague> leagueList = new ObservableCollection <csLeague>();

            try
            {
                if (sport != "ALL")
                {
                    parameters.Add("@pStartDate", d1);
                    parameters.Add("@pEndDate", d2);
                    parameters.Add("@pPlayer", player);
                    parameters.Add("@pSport", sport);
                    dataset = csG8Apps.ExecutePA("[dbo].[web_LeaguesByPLayer]", parameters);
                    if (dataset.Tables[0].Rows.Count > 0)
                    {
                        leagueList.Add(new csLeague("-1", "ALL"));

                        foreach (DataRow fila in dataset.Tables[0].Rows)
                        {
                            csLeague league = new csLeague(Convert.ToString(fila["IdLeague"]),
                                                           Convert.ToString(fila["League"]));
                            leagueList.Add(league);
                        }
                    }
                    else
                    {
                        leagueList = null;
                    }
                }
                else
                {
                    leagueList.Add(new csLeague("ALL", "ALL"));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error,   " + ex.Message);
            }
            finally
            {
                parameters.Clear();
            }

            return(leagueList);
        }
예제 #3
0
        public ObservableCollection <csLeague> LeaguesBySport(string idSport)
        {
            ObservableCollection <csLeague> leagueList = new ObservableCollection <csLeague>();

            try
            {
                if (idSport != "ALL")
                {
                    parameters.Add("@prmIdSport", idSport);
                    dataset = csConnection.ExecutePA("[dbo].[GetLeaguesBySport]", parameters);
                    if (dataset.Tables[0].Rows.Count > 0)
                    {
                        leagueList.Add(new csLeague("-1", "ALL"));

                        foreach (DataRow fila in dataset.Tables[0].Rows)
                        {
                            csLeague league = new csLeague(Convert.ToString(fila["IdLeague"]),
                                                           Convert.ToString(fila["Description"]));
                            leagueList.Add(league);
                        }
                    }
                    else
                    {
                        leagueList = null;
                    }
                }
                else
                {
                    leagueList.Add(new csLeague("ALL", "ALL"));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error,   " + ex.Message);
            }
            finally
            {
                parameters.Clear();
            }

            return(leagueList);
        }