コード例 #1
0
 public List<BannerNewsSite> GetBannerNewsSiteName(BannerNewsSite bs)
 {
     try
     {
         return _BannerDao.GetBannerNewsSiteName(bs);
     }
     catch (Exception ex)
     {
         throw new Exception("BannerNewsSiteMgr-->GetBannerNewsSiteName-->" + ex.Message, ex);
     }
 }
コード例 #2
0
        /// <summary>
        /// 獲得站台名
        /// </summary>
        /// <param name="bs"></param>
        /// <returns></returns>
        public List<BannerNewsSite> GetBannerNewsSiteName(BannerNewsSite bs)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine(@"SELECT news_site_id,news_site_name ");
            sql.AppendLine(@" FROM	banner_news_site where 1=1 ");
            if (bs.news_site_id != 0)
            {
                sql.AppendFormat(@" AND news_site_id='{0}' ", bs.news_site_id);
            }
            try
            {
                return _access.getDataTableForObj<BannerNewsSite>(sql.ToString());
            }
            catch (Exception ex)
            {
                throw new Exception("BannerNewsSiteDao-->GetBannerNewsSiteName" + ex.Message + sql.ToString(), ex);
            }

        }
コード例 #3
0
 public ActionResult BannerNewsList()
 {
     ViewBag.sid = Request.Params["sid"];
     List<BannerNewsSite> store = new List<BannerNewsSite>();
     BannerNewsSite bns = new BannerNewsSite();
     _bnsMgr = new BannerNewsSiteMgr(mySqlConnectionString);
     if (!string.IsNullOrEmpty(Request.Params["sid"]))
     {
         bns.news_site_id = uint.Parse(Request.Params["sid"]);
     }
     store = _bnsMgr.GetBannerNewsSiteName(bns);
     if (store.Count > 0)
     {
         ViewBag.sname = store[0].news_site_name;
     }
     else
     {
         ViewBag.sname = "";
     }
     if (!string.IsNullOrEmpty(Request.Params["history"]))
     {
         ViewBag.history = Request.Params["history"];
     }
     else
     {
         ViewBag.history = "0";
     }
     return View();
 }