Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Request.QueryString["aid"] != null)
     {
         aid = this.Request.QueryString["aid"].ToString();
     }
     if (this.Request.QueryString["cid"] != null)
     {
         cid = this.Request.QueryString["cid"].ToString();
     }
     this.txtcid.Value = cid;
     this.txtaid.Value = aid;
     this.lb_type.Text = "帮教帮办";
     StringBuilder stringBuilder = new StringBuilder();
     JpHelp jpHelp = new JpHelp();
     DataTable dt = jpHelp.Getdocbyid(Convert.ToInt32(aid));
     if (dt.Rows.Count > 0)
     {
         this.lb_time.Text = Convert.ToDateTime(dt.Rows[0]["hy_addtime"].ToString()).ToString("yyyy年MM月dd日");
         this.lb_title.Text = dt.Rows[0]["hy_content"].ToString();
         imgPath = dt.Rows[0]["hy_images"].ToString();
         this.lb_article.Text = dt.Rows[0]["hy_content"].ToString();
     }
 }
Exemplo n.º 2
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
        }

        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();     //文档ID
        }
        TPortalClass.JpHelp JpHelp = new TPortalClass.JpHelp();

        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpHelp.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                this.txtid.Value = dt.Rows[0]["id"].ToString();
                this.txthy_tel.Text = dt.Rows[0]["hy_tel"].ToString();
                this.txthy_reply.Text = dt.Rows[0]["hy_reply"].ToString();
                this.txthy_content.Text = dt.Rows[0]["hy_content"].ToString();
                this.txthy_addtime.Text = Convert.ToDateTime(dt.Rows[0]["hy_addtime"].ToString()).ToString("yyyy-MM-dd");
                this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString();
                if (dt.Rows[0]["hy_ifsh"].ToString() == "0")
                {
                    this.txthy_replytime.Text = "";
                    this.txthy_accepttime.Text = "";
                }
                if (dt.Rows[0]["hy_ifsh"].ToString() == "1")
                {
                    this.txthy_replytime.Text = "";
                    this.txthy_accepttime.Text = Convert.ToDateTime(dt.Rows[0]["hy_accepttime"].ToString()).ToString("yyyy-MM-dd");
                }
                if (dt.Rows[0]["hy_ifsh"].ToString() == "2")
                {
                    this.txthy_replytime.Text = Convert.ToDateTime(dt.Rows[0]["hy_replytime"].ToString()).ToString("yyyy-MM-dd");
                    this.txthy_accepttime.Text = Convert.ToDateTime(dt.Rows[0]["hy_accepttime"].ToString()).ToString("yyyy-MM-dd");
                }

            }
        }
        else
        {
            TPortalClass.DAO db = new TPortalClass.DAO();
            string sql = "select top 1  hy_sort   from hy_help order by hy_sort desc ";
            DataTable dt = db.GetDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                this.txthy_sort.Text = (Convert.ToInt32(dt.Rows[0]["hy_sort"].ToString()) + 1).ToString();
            }
            else
            {
                this.txthy_sort.Text = "1";
            }
        }
    }