Beispiel #1
0
        public static DateTime GetMaxGameDate(string ConnectionString, string LeagueName, string TableName, DateTime DefaultDate)
        {
            string   strSql   = $"Select IsNull( Max(GameDate), '{DefaultDate}') AS GameDate From {TableName}  Where LeagueName = '{LeagueName}'";
            DateTime GameDate = (DateTime)DALfunctions.ExecuteSqlQueryReturnSingleParm(ConnectionString, strSql, "GameDate");

            return(GameDate);
        }
Beispiel #2
0
        public static string TeamLookupTeamNameByTeamNameInDatabase(DateTime StartDate, string LeagueName, string TeamSource, string TeamNameInDatabase)
        {
            List <string> SqlParmNames  = new List <string>();
            List <object> SqlParmValues = new List <object>();

            SqlParmNames.Add("@StartDate");
            SqlParmValues.Add(StartDate);

            SqlParmNames.Add("@LeagueName");
            SqlParmValues.Add(LeagueName);

            SqlParmNames.Add("@TeamSource");
            SqlParmValues.Add(TeamSource);

            SqlParmNames.Add("@TeamNameInDatabase");
            SqlParmValues.Add(TeamNameInDatabase);

            string StoredProcedureName = "TeamLookupTeamNameByTeamNameInDatabase";
            string ConnectionString    = GetConnectionString(
                );

            string s = DALfunctions.ExecuteStoredProcedureQueryReturnSingleParm(ConnectionString, StoredProcedureName, SqlParmNames, SqlParmValues);

            if (String.IsNullOrEmpty(s))
            {
                throw new Exception($"TeamLoop Exception - {StartDate} - {LeagueName} - TeamSource: {TeamSource} - Team: {TeamNameInDatabase}");
            }

            return(s);
        }
Beispiel #3
0
        public static string TeamLookupSourceToSource(DateTime StartDate, string LeagueName, string TeamSourceFrom, string TeamSourceTo, string TeamName)
        {
            List <string> SqlParmNames  = new List <string>();
            List <object> SqlParmValues = new List <object>();

            SqlParmNames.Add("@StartDate");
            SqlParmValues.Add(StartDate);

            SqlParmNames.Add("@LeagueName");
            SqlParmValues.Add(LeagueName);

            SqlParmNames.Add("@TeamSourceFrom");
            SqlParmValues.Add(TeamSourceFrom);

            SqlParmNames.Add("@TeamSourceTo");
            SqlParmValues.Add(TeamSourceTo);

            SqlParmNames.Add("@TeamName");
            SqlParmValues.Add(TeamName);

            string StoredProcedureName = "TeamLookupSourceToSource";
            string ConnectionString    = GetConnectionString();

            string s = DALfunctions.ExecuteStoredProcedureQueryReturnSingleParm(ConnectionString, StoredProcedureName, SqlParmNames, SqlParmValues);

            return(s);
        }