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.JpGoods JpGoods = new TPortalClass.JpGoods(); //旧文档 if (this.txtop.Value == "modify") { DataTable dt = JpGoods.Getdocbyid(int.Parse(this.txtid.Value)); if (dt.Rows.Count > 0) { this.txtDocid.Value = dt.Rows[0]["docid"].ToString(); this.txtid.Value = dt.Rows[0]["id"].ToString(); this.txtcid.Value = dt.Rows[0]["hy_cid"].ToString(); ddlcolname.Value = dt.Rows[0]["hy_cid"].ToString(); this.txthy_goodsname.Text = dt.Rows[0]["hy_goodsname"].ToString(); this.txthy_goodstitle.Text = dt.Rows[0]["hy_goodstitle"].ToString(); this.txthy_linkurl.Text = dt.Rows[0]["hy_linkurl"].ToString(); this.txthy_content.Text = dt.Rows[0]["hy_content"].ToString(); this.txthy_goodsprice.Text = dt.Rows[0]["hy_goodsprice"].ToString(); this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString(); } } else { this.txthy_sort.Text = (JpGoods.GetMaxSort()).ToString(); } }
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.JpGoods JpGoods = new TPortalClass.JpGoods(); //旧文档 if (this.txtop.Value == "modify") { DataTable dt = JpGoods.Getdocbyid(int.Parse(this.txtid.Value)); if (dt.Rows.Count > 0) { this.txtid.Value = dt.Rows[0]["id"].ToString(); this.txtcid.Value = dt.Rows[0]["hy_cid"].ToString(); ddlcolname.Value = dt.Rows[0]["hy_cid"].ToString(); this.txthy_goodsname.Text = dt.Rows[0]["hy_goodsname"].ToString(); this.txthy_goodstitle.Text = dt.Rows[0]["hy_goodstitle"].ToString(); this.txthy_linkurl.Text = dt.Rows[0]["hy_linkurl"].ToString(); //if (dt.Rows[0]["hy_imgurl"].ToString() != "") //{ // this.txtpicurl.Value = dt.Rows[0]["hy_imgurl"].ToString(); // this.lblpic.Text = "<img src='" + dt.Rows[0]["hy_imgurl"].ToString() + "' onError=\"this.src='/images/index/images/nophoto.jpg';\" width=60px height=55px />"; //} this.txthy_content.Text = dt.Rows[0]["hy_content"].ToString(); this.txthy_goodsprice.Text = dt.Rows[0]["hy_goodsprice"].ToString(); this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString(); } } else { TPortalClass.DAO db = new TPortalClass.DAO(); string sql = "select top 1 hy_sort from hy_goods 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"; } } }