/// <summary> /// 判断是否登录,显示登录框 /// </summary> public void IsLogin() { try { //判断是否登录 if (LoginModel.IsLoginAll()) { //隐藏登录注册框 index_Dvlogin.Visible = false; index_mNotice.Style.Add("height", "240px"); index_mNotice.Style.Add("padding-top", "10px;"); } else { index_mNotice.Attributes.Remove("style"); } //公告 List <Hi.Model.SYS_NewsNotice> ListNes = new Hi.BLL.SYS_NewsNotice().GetList(" top 6 ID,NewsTitle,CreateDate ", " dr=0 and NewsType=2 and IsEnabled=1 ", " createdate desc "); Rpt_News.DataSource = ListNes; Rpt_News.DataBind(); //行业新闻 List <Hi.Model.SYS_NewsNotice> ListNes1 = new Hi.BLL.SYS_NewsNotice().GetList(" top 6 ID,NewsTitle,CreateDate ", " dr=0 and NewsType in(1,3) and IsEnabled=1 ", " createdate desc "); Rpt_News1.DataSource = ListNes1; Rpt_News1.DataBind(); } catch (Exception) { Session.Clear(); Session.Abandon(); Response.Redirect(ConfigurationManager.AppSettings["WebDomainName"].ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dt = News_sel(); Rpt_News.DataSource = dt; Rpt_News.DataBind(); } }
public void BindNewsList() { int pageCount = 0; int Counts = 0; List <Hi.Model.SYS_NewsNotice> NewLsit = new Hi.BLL.SYS_NewsNotice().GetList(Pager_List.PageSize, Pager_List.CurrentPageIndex, "CreateDate", true, " and isnull(dr,0)=0 " + SqlWhrere() + " ", out pageCount, out Counts); Rpt_News.DataSource = NewLsit; Rpt_News.DataBind(); Pager_List.RecordCount = Counts; Pager_List.TextBeforePageIndexBox = "<i class='tf2'>共" + Pager_List.PageCount + "页</i> <span class='tf2'>到第:</span>"; page = Pager_List.CurrentPageIndex.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if ((Request.QueryString["id"] != null) && (Request.QueryString["id"].ToString() != "")) { id.Value = Request.QueryString["id"]; DataTable dt = News_sel(id.Value); Title_.InnerText = dt.Rows[0]["Title"].ToString(); Rpt_News.DataSource = dt; Rpt_News.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //新聞 DataTable dt = News_sel(); Rpt_News.DataSource = dt; Rpt_News.DataBind(); //遊艇大圖+文字 DataTable dt_w = Shipw_sel(); Rpt_shipw.DataSource = dt_w; Rpt_shipw.DataBind(); //遊艇小圖 Rpt_ships.DataSource = dt_w; Rpt_ships.DataBind(); } }
/// <summary> /// 判断是否登录,显示登录框 /// </summary> public void IsLogin() { try { //判断是否登录 if (LoginModel.IsLoginAll()) { //隐藏登录注册框 index_Dvlogin.Visible = false; index_mNotice.Style.Add("height", "240px"); index_mNotice.Style.Add("padding-top", "10px;"); } else { index_mNotice.Attributes.Remove("style"); } //绑定最新入驻的企业 string sqlcomp = string.Format(@"select top 10 CompName,ShortName from BD_Company where BD_Company.dr='0' and BD_Company.AuditState=2 and BD_Company.IsEnabled=1 order by ID desc "); DataTable ListComp = new Hi.BLL.BD_Goods().GoodsAttr(sqlcomp);//数据源 Rpt_comps.DataSource = ListComp; Rpt_comps.DataBind(); //公告 List <Hi.Model.SYS_NewsNotice> ListNes = new Hi.BLL.SYS_NewsNotice().GetList(" top 6 ID,NewsTitle,CreateDate ", " dr=0 and NewsType=2 and IsEnabled=1 ", " createdate desc "); Rpt_News.DataSource = ListNes; Rpt_News.DataBind(); } catch (Exception) { Session.Clear(); Session.Abandon(); Response.Redirect(ConfigurationManager.AppSettings["WebDomainName"].ToString()); } }