コード例 #1
0
        public DataTable GetRandomTour()
        {
            string guid;

            dbName          = "WWTTours";
            oSqlConnections = new SqlConnections();
            SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
            SqlCommand    c  = new SqlCommand("spGetActiveTourGUIDs", sc);

            c.CommandType = CommandType.StoredProcedure;

            DataSet ds = new DataSet();
            int     rnd;

            using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
            {
                dataAdapter.SelectCommand = (SqlCommand)c;
                dataAdapter.Fill(ds);
                System.Random RandNum = new System.Random();
                rnd = RandNum.Next(0, ds.Tables[0].Rows.Count);
            }


            guid = (string)ds.Tables[0].Rows[rnd].ItemArray[0].ToString();
            return(GetFeaturedTour(guid));
        }
コード例 #2
0
ファイル: SForT.cs プロジェクト: faorg/wwt-website
		public DataTable FindTours(string sTKeyword, int NumReturn)
		{
			try
			{
				dbName = "WWTTours";
				oSqlConnections = new SqlConnections();
				SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
				SqlCommand c = new SqlCommand("spSearchTours", sc);
				c.CommandType = CommandType.StoredProcedure;
				c.Parameters.Add("@pSearchString", SqlDbType.NVarChar).Value = sTKeyword;
				c.Parameters.Add("@pNumReturnedTours", SqlDbType.Int).Value = NumReturn;

				DataTable dt = new DataTable();
				using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
				{
					dataAdapter.SelectCommand = (SqlCommand)c;
					dataAdapter.Fill(dt);
					return dt;
				}
			}
			catch
			{
				throw;
			}
		}
コード例 #3
0
        public DataTable FindTours(string sTKeyword, int NumReturn)
        {
            try
            {
                dbName          = "WWTTours";
                oSqlConnections = new SqlConnections();
                SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
                SqlCommand    c  = new SqlCommand("spSearchTours", sc);
                c.CommandType = CommandType.StoredProcedure;
                c.Parameters.Add("@pSearchString", SqlDbType.NVarChar).Value = sTKeyword;
                c.Parameters.Add("@pNumReturnedTours", SqlDbType.Int).Value  = NumReturn;

                DataTable dt = new DataTable();
                using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
                {
                    dataAdapter.SelectCommand = (SqlCommand)c;
                    dataAdapter.Fill(dt);
                    return(dt);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #4
0
ファイル: SForO.cs プロジェクト: faorg/wwt-website
        public SqlDataReader GetConstellationList()
        {
            try
            {
                dbName = "AstroObjects";
                oSqlConnections = new SqlConnections();

                return SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetConstellationList");
            }
            catch
            {
                throw;
            }
        }
コード例 #5
0
        public SqlDataReader GetConstellationList()
        {
            try
            {
                dbName          = "AstroObjects";
                oSqlConnections = new SqlConnections();

                return(SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetConstellationList"));
            }
            catch
            {
                throw;
            }
        }
コード例 #6
0
ファイル: SForT.cs プロジェクト: faorg/wwt-website
		public SqlDataReader GetTourCategories()
		{
			try
			{
				dbName = "WWTTours";
				oSqlConnections = new SqlConnections();

				return SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetCategories");
			}
			catch
			{
				throw;
			}
		}
コード例 #7
0
        public SqlDataReader GetTourCategories()
        {
            try
            {
                dbName          = "WWTTours";
                oSqlConnections = new SqlConnections();

                return(SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetCategories"));
            }
            catch
            {
                throw;
            }
        }
コード例 #8
0
        public SqlDataReader GetRecentWWTTours()
        {
            try
            {
                dbName          = "WWTTours";
                oSqlConnections = new SqlConnections();

                return(SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetMostRecentWWTTours", 4, "approved"));
            }
            catch
            {
                throw;
            }
        }
コード例 #9
0
ファイル: ObjectDetails.cs プロジェクト: faorg/wwt-website
        public SqlDataReader GetObjectDetails(int id)
        {
            try
            {
                dbName = "AstroObjects";
                oSqlConnections = new SqlConnections();

                return SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetAstroObjectDetails", id);
            }
            catch
            {
                throw;
            }
        }
コード例 #10
0
        public SqlDataReader GetObjectDetails(int id)
        {
            try
            {
                dbName          = "AstroObjects";
                oSqlConnections = new SqlConnections();

                return(SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetAstroObjectDetails", id));
            }
            catch
            {
                throw;
            }
        }
コード例 #11
0
ファイル: RecentWWTTours.cs プロジェクト: faorg/wwt-website
        public SqlDataReader GetRecentWWTTours()
        {
            try
            {
                dbName = "WWTTours";
                oSqlConnections = new SqlConnections();

                return SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetMostRecentWWTTours", 4, "approved");
            }
            catch
            {
                throw;
            }
        }
コード例 #12
0
        public int GetRelatedToursCount(string guid)
        {
            dbName          = "WWTTours";
            oSqlConnections = new SqlConnections();
            SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
            SqlCommand    c  = new SqlCommand("spGetRelatedTours", sc);

            c.CommandType = CommandType.StoredProcedure;
            c.Parameters.Add("@pTourGUID", SqlDbType.VarChar).Value = guid;

            DataSet ds = new DataSet();

            SqlDataAdapter dataAdapter = new SqlDataAdapter();

            dataAdapter.SelectCommand = (SqlCommand)c;
            dataAdapter.Fill(ds);
            return(ds.Tables[0].Rows.Count);
        }
コード例 #13
0
        public DataTable FindRelatedTours(string guid)
        {
            dbName          = "WWTTours";
            oSqlConnections = new SqlConnections();
            SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
            SqlCommand    c  = new SqlCommand("spRelatedTourSearch", sc);

            c.CommandType = CommandType.StoredProcedure;
            c.Parameters.Add("@Guid", SqlDbType.VarChar).Value = guid;

            DataSet ds = new DataSet();

            using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
            {
                dataAdapter.SelectCommand = (SqlCommand)c;
                dataAdapter.Fill(ds);
                return(ds.Tables[0]);
            }
        }
コード例 #14
0
ファイル: SForO.cs プロジェクト: faorg/wwt-website
        public SqlDataReader GetAstroObjects
        (
            string pSearchString,
            string pRa,
            string pDec,
            string pPlusMinusArcSecs,
            string pVMagThreshold,
            int pConstellationID, 
            int pObjectTypeUIListID
        )
        {    
            try
            {
                dbName = "AstroObjects";
                oSqlConnections = new SqlConnections();

                return SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetAstroObjectsForWeb", pSearchString, pRa, pDec, pPlusMinusArcSecs, pVMagThreshold, pConstellationID, pObjectTypeUIListID);
            }
            catch 
            {
                throw;
            }
        }
コード例 #15
0
        public SqlDataReader GetAstroObjects
        (
            string pSearchString,
            string pRa,
            string pDec,
            string pPlusMinusArcSecs,
            string pVMagThreshold,
            int pConstellationID,
            int pObjectTypeUIListID
        )
        {
            try
            {
                dbName          = "AstroObjects";
                oSqlConnections = new SqlConnections();

                return(SqlHelper.ExecuteReader(oSqlConnections.GetSqlConnection(dbName), "spGetAstroObjectsForWeb", pSearchString, pRa, pDec, pPlusMinusArcSecs, pVMagThreshold, pConstellationID, pObjectTypeUIListID));
            }
            catch
            {
                throw;
            }
        }
コード例 #16
0
ファイル: SForT.cs プロジェクト: faorg/wwt-website
		public DataTable GetRandomTour()
		{
			string guid;
			dbName = "WWTTours";
			oSqlConnections = new SqlConnections();
			SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
			SqlCommand c = new SqlCommand("spGetActiveTourGUIDs", sc);
			c.CommandType = CommandType.StoredProcedure;

			DataSet ds = new DataSet();
			int rnd;
			using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
			{

				dataAdapter.SelectCommand = (SqlCommand)c;
				dataAdapter.Fill(ds);
				System.Random RandNum = new System.Random();
				rnd = RandNum.Next(0, ds.Tables[0].Rows.Count);
			}


			guid = (string)ds.Tables[0].Rows[rnd].ItemArray[0].ToString();
			return GetFeaturedTour(guid);
		}
コード例 #17
0
        public DataTable GetToursByCategory(int categoryId)
        {
            try
            {
                dbName          = "WWTTours";
                oSqlConnections = new SqlConnections();
                SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
                SqlCommand    c  = new SqlCommand("spGetTourDetailsByCategoryId", sc);
                c.CommandType = CommandType.StoredProcedure;
                c.Parameters.Add("@CatId", SqlDbType.Int).Value = categoryId;

                DataTable dt = new DataTable();
                using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
                {
                    dataAdapter.SelectCommand = (SqlCommand)c;
                    dataAdapter.Fill(dt);
                    return(dt);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #18
0
ファイル: SForT.cs プロジェクト: faorg/wwt-website
		public DataTable GetToursByCategory(int categoryId)
		{
			try
			{
				dbName = "WWTTours";
				oSqlConnections = new SqlConnections();
				SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
				SqlCommand c = new SqlCommand("spGetTourDetailsByCategoryId", sc);
				c.CommandType = CommandType.StoredProcedure;
				c.Parameters.Add("@CatId", SqlDbType.Int).Value = categoryId;

				DataTable dt = new DataTable();
				using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
				{
					dataAdapter.SelectCommand = (SqlCommand)c;
					dataAdapter.Fill(dt);
					return dt;
				}
			}
			catch
			{
				throw;
			}
		}
コード例 #19
0
ファイル: SForT.cs プロジェクト: faorg/wwt-website
		public int GetRelatedToursCount(string guid)
		{
			dbName = "WWTTours";
			oSqlConnections = new SqlConnections();
			SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
			SqlCommand c = new SqlCommand("spGetRelatedTours", sc);
			c.CommandType = CommandType.StoredProcedure;
			c.Parameters.Add("@pTourGUID", SqlDbType.VarChar).Value = guid;

			DataSet ds = new DataSet();

			SqlDataAdapter dataAdapter = new SqlDataAdapter();

			dataAdapter.SelectCommand = (SqlCommand)c;
			dataAdapter.Fill(ds);
			return ds.Tables[0].Rows.Count;

		}
コード例 #20
0
ファイル: SForT.cs プロジェクト: faorg/wwt-website
		public DataTable FindRelatedTours(string guid)
		{
			dbName = "WWTTours";
			oSqlConnections = new SqlConnections();
			SqlConnection sc = new SqlConnection(oSqlConnections.GetSqlConnection(dbName));
			SqlCommand c = new SqlCommand("spRelatedTourSearch", sc);
			c.CommandType = CommandType.StoredProcedure;
			c.Parameters.Add("@Guid", SqlDbType.VarChar).Value = guid;

			DataSet ds = new DataSet();
			using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
			{

				dataAdapter.SelectCommand = (SqlCommand)c;
				dataAdapter.Fill(ds);
				return ds.Tables[0];
			}
		}