private void BindData() { long num = _Convert.StrToLong(Utility.GetRequest("id"), -1L); if (num < 0L) { PF.GoError(1, "您访问的数据不存在,可能是参数错误或内容已经被删除!", base.GetType().BaseType.FullName); } else { DataTable table; table = table = new Tables.T_SiteAffiches().Open("", "ID=" + num.ToString(), ""); if (table == null) { PF.GoError(1, "数据库繁忙,请重试", base.GetType().BaseType.FullName); } else if (table.Rows.Count < 0) { PF.GoError(1, "您访问的数据不存在,可能是参数错误或内容已经被删除!", base.GetType().BaseType.FullName); } else { DataRow row = table.Rows[0]; this.lbTitle.Text = row["Title"].ToString(); this.lbDateTime.Text = _Convert.StrToDateTime(row["DateTime"].ToString(), DateTime.Now.ToString()).ToString("yyyy-MM-dd hh:mm:ss"); this.lbContent.Text = row["Content"].ToString(); } } }
private void BindData() { long SiteAfficheID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("id"), -1); if (SiteAfficheID < 0) { PF.GoError(ErrorNumber.Unknow, "参数错误", "Admin_SiteAffichesEdit"); return; } tbID.Text = SiteAfficheID.ToString(); DataTable dt = new DAL.Tables.T_SiteAffiches().Open("", "SiteID = " + _Site.ID.ToString() + " and [ID] = " + SiteAfficheID.ToString(), ""); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SiteAffichesEdit"); return; } tbDateTime.Text = dt.Rows[0]["DateTime"].ToString(); cbisShow.Checked = Shove._Convert.StrToBool(dt.Rows[0]["isShow"].ToString(), true); cbisCommend.Checked = Shove._Convert.StrToBool(dt.Rows[0]["isCommend"].ToString(), true); tbTitle.Text = dt.Rows[0]["Title"].ToString(); if (tbTitle.Text.IndexOf("<font class=red12>") > -1) { cbTitleRed.Checked = true; tbTitle.Text = tbTitle.Text.Replace("<font class=red12>", "").Replace("</font>",""); } else { cbTitleRed.Checked = false; } string UC = dt.Rows[0]["Content"].ToString(); Regex regex = new Regex(@"^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$", RegexOptions.IgnoreCase | RegexOptions.Compiled); Match m = regex.Match(UC); if (m.Success) { trContent.Visible = false; trUrl.Visible = true; tbUrl.Text = UC; rblType.SelectedValue = "1"; } else { trUrl.Visible = false; trContent.Visible = true; tbContent.Value = UC; rblType.SelectedValue = "2"; } }
private void BindData() { DataTable dt = new DAL.Tables.T_SiteAffiches().Open("", "SiteID = " + _Site.ID.ToString(), "[DateTime] desc"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SiteAffiches"); return; } PF.DataGridBindData(g, dt, gPager); }
private DataTable GetSiteAffiches() { string key = "Default_GetSiteAffiches"; DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { cacheAsDataTable = new Tables.T_SiteAffiches().Open("top 10 Title,Content", "isShow = 1", " DateTime desc"); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); return null; } if (cacheAsDataTable.Rows.Count > 0) { Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0xe10); } } return cacheAsDataTable; }
private void BindSiteAffiches() { StringBuilder sb = new StringBuilder(); string Key = "Default_GetSiteAffiches"; DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(Key); if (dt == null) { dt = new DAL.Tables.T_SiteAffiches().Open("top 5 Title, ID, DateTime, Content", "isShow = 1", " DateTime desc"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } if (dt.Rows.Count > 0) { Shove._Web.Cache.SetCache(Key, dt, 1200); } } foreach (DataRow dr in dt.Rows) { Regex regex = new Regex(@"^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$", RegexOptions.IgnoreCase | RegexOptions.Compiled); Match m = regex.Match(dr["Content"].ToString()); if (m.Success) { sb.Append("<li><a href=\"" + dr["Content"].ToString() + "\" target=\"_blank\">"); } else { sb.Append("<li><a href=\"Home/Web/ShowAffiches.aspx?ID=" + dr["ID"].ToString() + "\" target=\"_blank\">"); } sb.Append(Shove._String.Cut(dr["Title"].ToString(), 22)); sb.AppendLine("</a></li>"); } lbSiteAffiches = sb.ToString(); }
private void BindData() { long id = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("id"), -1); if (id < 0) { PF.GoError(ErrorNumber.Unknow, "您访问的数据不存在,可能是参数错误或内容已经被删除!", this.GetType().BaseType.FullName); return; } DataTable dt = dt = new DAL.Tables.T_SiteAffiches().Open("", "ID=" + id.ToString() + "", ""); if (dt == null) { PF.GoError(ErrorNumber.Unknow, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } if (dt.Rows.Count < 0) { PF.GoError(ErrorNumber.Unknow, "您访问的数据不存在,可能是参数错误或内容已经被删除!", this.GetType().BaseType.FullName); return; } DataRow dr = dt.Rows[0]; lbTitle.Text = dr["Title"].ToString().Replace("<p>","").Replace("</p>",""); lbDateTime.Text = dr["DateTime"].ToString(); lbContent.Text = dr["Content"].ToString().Replace("<p>","").Replace("</p>",""); }
private void BindData() { DataTable dt = new Tables.T_SiteAffiches().Open("", "SiteID = " + base._Site.ID.ToString(), "[DateTime] desc"); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_SiteAffiches"); } else { PF.DataGridBindData(this.g, dt, this.gPager); } }
private void BindData() { long SiteAfficheID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("id"), -1); if (SiteAfficheID < 0) { PF.GoError(ErrorNumber.Unknow, "参数错误", "Admin_SiteAffichesEdit"); return; } tbID.Text = SiteAfficheID.ToString(); DataTable dt = new DAL.Tables.T_SiteAffiches().Open("", "SiteID = " + _Site.ID.ToString() + " and [ID] = " + SiteAfficheID.ToString(), ""); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SiteAffichesEdit"); return; } tbDateTime.Text = dt.Rows[0]["DateTime"].ToString(); cbisShow.Checked = Shove._Convert.StrToBool(dt.Rows[0]["isShow"].ToString(), true); cbisCommend.Checked = Shove._Convert.StrToBool(dt.Rows[0]["isCommend"].ToString(), true); tbTitle.Text = dt.Rows[0]["Title"].ToString(); if (tbTitle.Text.IndexOf("<font class=red12>") > -1) { cbTitleRed.Checked = true; tbTitle.Text = tbTitle.Text.Replace("<font class=red12>", "").Replace("</font>",""); } else { cbTitleRed.Checked = false; } tbContent.Text = dt.Rows[0]["Content"].ToString(); }