Example #1
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.JpGuidePage JpGuidePage = new TPortalClass.JpGuidePage();

        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpGuidePage.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                this.txtid.Value = dt.Rows[0]["id"].ToString();
                this.txthy_name.Text = dt.Rows[0]["hy_name"].ToString();
                this.txthy_url.Text = dt.Rows[0]["hy_url"].ToString();
                if (dt.Rows[0]["hy_images"].ToString() != "")
                {
                    this.txtpicurl.Value = dt.Rows[0]["hy_images"].ToString();
                    this.lblpic.Text = "<img src='" + dt.Rows[0]["hy_images"].ToString() + "' onError=\"this.src='/images/index/images/nophoto.jpg';\" width=60px height=55px />";
                }
                if (dt.Rows[0]["hy_ifused"].ToString() == "0")
                {
                    ddlifused.Value = "0";
                }
                else
                {
                    ddlifused.Value = "1";
                }
                this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString();
            }
        }
        else
        {
            if (JpGuidePage.GetMaxSort().Rows.Count > 0)
            {
                this.txthy_sort.Text = (Convert.ToInt32(JpGuidePage.GetMaxSort().Rows[0]["hy_sort"].ToString()) + 1).ToString();
            }
            else
            {
                this.txthy_sort.Text = "1";
            }
        }
    }