示例#1
0
        public NhlStatsSet.scheduleDataTable GetScheduleForTeams(String teamA, String teamB, int seasonId, int gameCount)
        {
            string startDateString = DateTime.Now.ToString("s", System.Globalization.CultureInfo.InvariantCulture);

            NhlStatsSet.scheduleDataTable table = new NhlStatsSet.scheduleDataTable();
            SQLiteCommand command = new SQLiteCommand();

            command.Connection  = connection;
            command.CommandText = String.Format(
                "SELECT * FROM schedule WHERE Season_ID = {0} AND ((HomeTeam = '{1}' AND AwayTeam = '{2}') OR (HomeTeam = '{2}' AND AwayTeam = '{1}'))" +
                "AND datetime(Date) >= datetime('{3}') LIMIT {4}",
                seasonId, teamA, teamB, startDateString, gameCount);

            SQLiteDataAdapter adapter = new SQLiteDataAdapter(command);

            adapter.Fill(table);

            return(table);
        }
示例#2
0
        public NhlStatsSet.scheduleDataTable GetScheduleByDate(int seasonId, DateTime startDate, DateTime endDate)
        {
            string startDateString = startDate.ToString("s", System.Globalization.CultureInfo.InvariantCulture);
            string endDateString   = endDate.ToString("s", System.Globalization.CultureInfo.InvariantCulture);

            NhlStatsSet.scheduleDataTable table = new NhlStatsSet.scheduleDataTable();
            SQLiteCommand command = new SQLiteCommand();

            command.Connection  = connection;
            command.CommandText = String.Format(
                "SELECT * FROM schedule WHERE Season_ID = {0} " +
                "AND datetime(Date) >= datetime('{1}') AND datetime(Date) <= datetime('{2}')",
                seasonId, startDateString, endDateString);

            SQLiteDataAdapter adapter = new SQLiteDataAdapter(command);

            adapter.Fill(table);

            return(table);
        }
 public virtual NhlStatsSet.scheduleDataTable GetScheduleByTeam(global::System.Nullable<decimal> Season_ID, string Team) {
     this.Adapter.SelectCommand = this.CommandCollection[9];
     if ((Season_ID.HasValue == true)) {
         this.Adapter.SelectCommand.Parameters[0].Value = ((decimal)(Season_ID.Value));
     }
     else {
         this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     }
     if ((Team == null)) {
         this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
     }
     else {
         this.Adapter.SelectCommand.Parameters[1].Value = ((string)(Team));
     }
     NhlStatsSet.scheduleDataTable dataTable = new NhlStatsSet.scheduleDataTable();
     this.Adapter.Fill(dataTable);
     return dataTable;
 }
 public virtual NhlStatsSet.scheduleDataTable GetGamesForTeams() {
     this.Adapter.SelectCommand = this.CommandCollection[3];
     NhlStatsSet.scheduleDataTable dataTable = new NhlStatsSet.scheduleDataTable();
     this.Adapter.Fill(dataTable);
     return dataTable;
 }