コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CommonFunction.isLoginCheck();
         ViewState["HTML"]      = "";
         ViewState["strAction"] = Request.QueryString["action"];
         int tid = Convert.ToInt32(Request.QueryString["tid"]);
         ViewState["dtType"] = NewsInfoService.Get_TypeInfoByTypeId(tid);
         if (Request.QueryString["nid"] != null)
         {
             int nid = Convert.ToInt32(Request.QueryString["nid"]);
             ViewState["nid"] = nid;
             DataTable dt = NewsInfoService.Get_NewsInfo(nid);
             txtTitle.Text     = dt.Rows[0]["N_Title"].ToString();
             txtTime.Text      = Convert.ToDateTime(dt.Rows[0]["N_Time"].ToString()).ToShortDateString();
             txtFrom.Text      = dt.Rows[0]["N_From"].ToString();
             ViewState["HTML"] = dt.Rows[0]["N_ImgPath"].ToString();
         }
         else
         {
             txtTime.Text = DateTime.Now.ToShortDateString();
             txtFrom.Text = "本站原创";
         }
     }
 }
コード例 #2
0
ファイル: Page.aspx.cs プロジェクト: github188/smartbooks
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int id = Convert.ToInt32(Request.QueryString["id"].ToString());
         Table = NewsInfoService.Get_NewsInfo(id);
         this.Panel_img.Visible = Property.HaveImg(id);
         BindTitleAndMenu(id);
     }
 }
コード例 #3
0
    public static bool HaveImg(int oid)
    {
        bool      result = false;
        DataTable dt     = NewsInfoService.Get_NewsInfo(oid);

        foreach (DataRow dr in dt.Rows)
        {
            if (dr["N_ImgPath"].ToString() != "")
            {
                result = true;
            }
        }
        return(result);
    }