using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WLaw118.Kernal.Model;
using WLaw118.Kernal.Web;
using FxOpen.Web;
using FxOpen.Web.UI.HtmlControls;
namespace WLaw118.Web.Statute
{
using Statute = WLaw118.Kernal.Web.StatuteBiz;
using WLaw118.Kernal.Web.Page;
using WLaw118.Kernal.SqlDAL;
using WLaw118.Kernal.Utility;
public partial class Show : PageGuest
{
#region 全局参数
public long StatuteId = 0;
public static string FileUrl = string.Empty;
public StatuteInfo statute = null;
/// /// 博客地址 ///
public string BlogSiteUrl = String.Empty;
/// /// 文档所有者的ID ///
public string StatuteUserId = String.Empty;
/// /// 文档所有者的博客文档列表地址 ///
public string StatuteOwnerBlogUrl = String.Empty;
/// /// 文档所有者的博客法规列表地址 ///
public string StatuteOwnerBlogStatutesUrl = String.Empty;
/// /// 文档所有者的博客文章地址 ///
public string StatuteOwnerBlogArticlesUrl = String.Empty;
protected override UserPurviewCode GetPagePurview()
{
return UserPurviewCode.NONE;
}
public string PageType = string.Empty;
public string StatuteSouce = string.Empty;
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (Request.IsLocal && IsAdminUser)
{
sourceFile.Visible = true;
LbStatuteSourceId.Visible = true;
}
try
{
//取得浏览器传递的参数
StatuteId = WebUtility.QueryLong("sid");
PageType = WebUtility.QueryString("PageType").ToLower().Trim();
if (StatuteId <= 0)
{
Response.Redirect("~/error.aspx?url=" + HttpUtility.UrlEncode(Request.Url.AbsoluteUri));
return;
}
statute = Statute.Get(StatuteId);
if (statute == null)
{
Response.Redirect("~/error.aspx?url=" + HttpUtility.UrlEncode(Request.Url.AbsoluteUri));
return;
}
statute.Statistic = StatuteStatisticBiz.Get(StatuteId);
if (PageType != "text")
{
if (statute.Itemed == false)
PageType = "text";
else
PageType = "item";
}
if (PageType == "text")
statute.Content = StatuteBiz.GetContent(StatuteId);
else
statute.Items.AddRange(GetItems());
if (LoginUser != null && LoginUserId > 0)
{
HiddenIsLogin.Value = "True";
this.ViewStatus.Value = "visible";
}
else
{
HiddenIsLogin.Value = "False";
this.ViewStatus.Value = "notlogin";
}
hiddenLoginUserId.Value = LoginUserId.ToString();
StatuteUserId = statute.PostUserId.ToString();
}
catch { }
if (!IsPostBack) PageInit();
}
public void InitStatuteState()
{
string state = "实效";
if (statute.ExpirationDate == DateTime.MinValue)
{
Response.Write(state);
return;
}
if (statute.ExpirationDate < DateTime.Now)
{
Response.Write("失效");
return;
}
Response.Write(state);
}
public bool IsRed { get; set; }
private void PageInit()
{
try
{
if (statute != null)
{
#region 法规基本内容展示
if (!string.IsNullOrEmpty(statute.Title))
this.Title = statute.Title + " - 汇法网";
else
this.Title = "法规详情 - 汇法网";
//基本信息
lblTitle.Text = lblTitle1.Text = lblTitle2.Text = statute.Title;
Collection foreach (CourtInfo ci in cInfo) { if (ci != null) { if (string.IsNullOrEmpty(lblPromulgateDepartmentTitle.Text)) { lblPromulgateDepartmentTitle.Text = ci.CourtName; } else { lblPromulgateDepartmentTitle.Text += "" + ci.CourtName; } } } //lblApprovalDepartmentTitle.Text = lblApprovalDepartmentTitle2.Text = statute.ApprovalDepartmentTitle; lblApprovalDepartmentTitle.Text = statute.ApprovalDepartmentTitle; lblApprovalDepart mentTitle2.Text = statute.ApprovalDepartmentTitle; lblPromulgateWritNumber.Text = lblWriterNumber1.Text = statute.PromulgateWritNumber; lblPromulgateDate.Text = StrUtil.FormartDateTime(statute.PromulgateDate, "yyyy-MM-dd select2 = null; //绑定内容 未登陆显示前10条 if (LoginUserId > 0) { divLogOff.Visible = false; divDownload.Visible = true; select2 = new PagedSelector(1, 0); } else { divLogOff.Visible = true; divDownload.Visible = false; select2 = new PagedSelector(1, 10); lblIsLogin.Visible = true; } select2.OrderBy = "[i].[SortId] ASC"; select2.Columns = "i.Title,i.[Content],i.[Type]"; select2.SourceTable = string.Format("{0} i INNER JOIN {1} c ON i.StatuteItemId=c.ItemId se GTStatuteItemType.Chapter: { css = "chapter"; break; } case GTStatuteItemType.Item: { css = "Item"; break; } case GTStatuteItemType.Section: { css = "section"; break; } case GTStatuteItemType.Sheet: { css = "sheet"; break; } default: { css = "Item"; break; } } return css; } //顶 protected void ibtnRaised_Click(object sender, ImageClickEventArgs e) { if (HiddenRaised.Value == "0") { Statute.StatuteStatisticEditColumn("RaisedTimes