예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.txtUid.Value != "")
     {
         this.Session["hyuid"] = this.txtUid.Value;
     }
     if (this.Request.QueryString["id"] != null)
     {
         try
         {
             id = Convert.ToInt32(this.Request.QueryString["id"].ToString());
         }
         catch
         {
             id = 1;
         }
     }
     this.txtaid.Value = id.ToString();
     this.txtcid.Value = "008";
     this.lb_type.Text = "金点活动";
     StringBuilder stringBuilder = new StringBuilder();
     JpActivity jpActivity = new JpActivity();
     DataTable dt = jpActivity.Getdocbyid(id);
     HyFileatt HyFileatt = new HyFileatt();
     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_bt"].ToString();
         DataTable dt_img = HyFileatt.Getdocs(dt.Rows[0]["docid"].ToString(), 1);
         if (dt_img.Rows.Count > 0)
         {
             imgPath = dt_img.Rows[0]["hy_filepath"].ToString();
         }
         this.lb_article.Text = dt.Rows[0]["hy_content"].ToString();
     }
 }
예제 #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.JpActivity JpActivity = new TPortalClass.JpActivity();

        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpActivity.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                this.txthy_bt.Text = dt.Rows[0]["hy_bt"].ToString();
                this.txthy_bt.Enabled = false;
                this.txthy_starttime.Value = Convert.ToDateTime(dt.Rows[0]["hy_starttime"].ToString()).ToString("yyyy-MM-dd");
                this.txthy_endtime.Value = Convert.ToDateTime(dt.Rows[0]["hy_endtime"].ToString()).ToString("yyyy-MM-dd");
                this.txthy_address.Text = dt.Rows[0]["hy_address"].ToString();
                this.txthy_contact.Text = dt.Rows[0]["hy_contact"].ToString();
                this.txthy_tel.Text = dt.Rows[0]["hy_tel"].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 />";
                //}
                this.txthy_category.Text = dt.Rows[0]["hy_category"].ToString();
                this.txthy_content.Text = dt.Rows[0]["hy_content"].ToString();
                this.txthy_bz.Text = dt.Rows[0]["hy_bz"].ToString();
                this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString();
                this.txtaddtime.Value = dt.Rows[0]["hy_addtime"].ToString();
                this.txtdjr.Value = dt.Rows[0]["hy_djr"].ToString();
            }
        }
        else
        {
            TPortalClass.DAO db = new TPortalClass.DAO();
            string sql = "select top 1  hy_sort   from hy_activity 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";
            }

        }
    }