Esempio n. 1
0
 /// <summary>
 /// 获得前端页面的广告
 /// </summary>
 /// <param name="positionId"></param>
 /// <returns></returns>
 public static ADModuleForSite GetHomeAdByPosition(int positionId)
 {
     try
     {
         DataTable data     = new SqlDBHelper().ExecuteQuery(String.Format(GetSiteAdByPostionSqlCmdTemplate, positionId));
         int       rowCount = data.Rows.Count;
         if (rowCount > 0)
         {
             ADModuleForSite ad = new ADModuleForSite()
             {
                 ADName = data.Rows[0]["ADName"].ToString().Trim(),
                 ADImg  = data.Rows[0]["ADImg"].ToString().Trim(),
                 ADLink = data.Rows[0]["ADLink"].ToString().Trim(),
             };
             return(ad);
         }
         else
         {
             return(null);
         }
     }
     catch
     {
         return(null);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 获得前端页面的广告
 /// </summary>
 /// <param name="positionId"></param>
 /// <returns></returns>
 public static ADModuleForSite GetHomeAdByPosition(int positionId)
 {
     try
     {
         DataTable data = new SqlDBHelper().ExecuteQuery(String.Format(GetSiteAdByPostionSqlCmdTemplate, positionId));
         int rowCount = data.Rows.Count;
         if (rowCount > 0)
         {
             ADModuleForSite ad = new ADModuleForSite()
             {
                 ADName = data.Rows[0]["ADName"].ToString().Trim(),
                 ADImg = data.Rows[0]["ADImg"].ToString().Trim(),
                 ADLink = data.Rows[0]["ADLink"].ToString().Trim(),
             };
             return ad;
         }
         else
         {
             return null;
         }
     }
     catch
     {
         return null;
     }
 }