using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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 System.Xml.Linq;
using LZBS.BLL;
using LZBS.Model;
using LZBS.Common;

namespace LZBS.Web
{
    public partial class NewsInfo : System.Web.UI.Page
    {
        public string strTitle = "";
        public string strDate = "";
        public string strContent = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["NewsID"] == null)
                {
                    //在Page_Load MyMessageBox.MessageBox 不会显示提示框
                    //MyMessageBox.MessageBox("非法传值", this.Page);
                    //Response.Redirect("Index.aspx",true);
                    //Response.Write("<b style='font-weight:bold; color:red; '>非法传值 <a href='Index.aspx'>返回首页</a></div>");
                    //Response.End();
                    MyMessageBox.MessageBox("非法传值", this.Page, "Index.aspx");
                }
                else
                {
                    B_News bll = new B_News();
                    M_News model = new M_News();
                    model.NewsID = Convert.ToInt32(Request.QueryString["NewsID"].ToString());
                    DataRow dr = bll.GetNewsInfo(model);
                    strTitle = dr["Title"].ToString();
                    strDate = dr["PublishTime"].ToString();
                    strContent = dr["Content"].ToString();
                    model.Numbers = Convert.ToInt32(dr["Numbers"].ToString()) + 1;
                    bll.ChangeNumbers(model);
                }
            }
        }
    }
}
