public void bind_date(int _id) { Cms.BLL.C_order_integral bll = new Cms.BLL.C_order_integral(); Cms.Model.C_order_integral model = bll.GetModel(_id); ordernum.InnerHtml = model.order_num; updateTime.InnerHtml = model.updateTime.ToString(); OrderStatus.InnerHtml = getState(Convert.ToInt32(model.order_status)); countprice.InnerHtml = model.price_sum.ToString(); Quantity.InnerHtml = model.quantity_sum.ToString(); integral_sum.InnerHtml = model.integral_sum.ToString(); note.InnerHtml = model.note.ToString(); recommended_code.InnerHtml = model.recommended_code.ToString(); #region 会员信息===================== int struserid = Convert.ToInt32(model.user_id); Cms.BLL.C_user blluser = new Cms.BLL.C_user(); DataSet ds2 = blluser.GetList("id=" + struserid); if (ds2 != null && ds2.Tables[0].Rows.Count > 0) { UserName.InnerHtml = ds2.Tables[0].Rows[0]["username"].ToString(); userMoney.InnerHtml = Convert.ToDecimal(ds2.Tables[0].Rows[0]["userMoney"]).ToString("0.00"); userJifen.InnerHtml = ds2.Tables[0].Rows[0]["userscore"].ToString(); } else { userinfo.InnerHtml = "匿名用户"; } #endregion #region 产品信息=========================== Cms.BLL.C_order_integralsub bllordersub = new Cms.BLL.C_order_integralsub(); DataSet ds1 = bllordersub.GetList("order_id=" + _id); if (ds1 != null && ds1.Tables[0].Rows.Count > 0) { Repeaterordersub.DataSource = ds1.Tables[0].DefaultView; Repeaterordersub.DataBind(); } #endregion #region 收货信息=========================== DataSet ds3 = new Cms.BLL.sc_stores().GetList("id=" + model.storesId); if (ds3 != null && ds3.Tables[0].Rows.Count > 0) { RepAddress.DataSource = ds3.Tables[0].DefaultView; RepAddress.DataBind(); } #endregion }
public void DataBind(int userId) { Cms.Model.C_user model = new Cms.BLL.C_user().GetModel(userId); this.username.Text = model.username.ToString();; //姓名 this.usercard.Text = model.usercard.ToString(); //会员卡 this.password.Text = model.password.ToString(); //密码 this.openid.Text = model.openid.ToString(); //微信账号 this.birthday.Text = string.Format("{0:yyyy-MM-dd}", model.birthday); this.useraddress.Text = model.useraddress.ToString(); this.telphone.Text = model.telphone.ToString(); this.marryday.Text = string.Format("{0:yyyy-MM-dd}", model.marryday); //this.userMoney.Text = Convert.ToDecimal(model.userMoney).ToString("0.00"); this.userJifen.Text = model.userscore.ToString(); this.shopcode.Text = model.shopcode.ToString(); this.shopname.Text = model.shopname.ToString(); this.sex.SelectedValue = model.sex.ToString();//性别 this.updatetime.Text = model.updatetime.ToString(); DataSet ds = new Cms.BLL.c_user_address().GetList("user_id=" + userId); if (ds != null && ds.Tables[0].Rows.Count > 0) { rptList.DataSource = ds.Tables[0].DefaultView; rptList.DataBind(); } else { rptList.DataSource = ds.Tables[0].DefaultView; rptList.DataBind(); } DataSet dsBuy = new Cms.BLL.C_ordersub().GetList("user_id=" + userId); if (dsBuy != null && dsBuy.Tables[0].Rows.Count > 0) { RepBuyRecord.DataSource = dsBuy.Tables[0].DefaultView; RepBuyRecord.DataBind(); } else { RepBuyRecord.DataSource = dsBuy.Tables[0].DefaultView; RepBuyRecord.DataBind(); } DataSet dsIntegral = new Cms.BLL.C_order_integralsub().GetList("user_id=" + userId); if (dsIntegral != null && dsIntegral.Tables[0].Rows.Count > 0) { RepIntegralRec.DataSource = dsIntegral.Tables[0].DefaultView; RepIntegralRec.DataBind(); } else { RepIntegralRec.DataSource = dsIntegral.Tables[0].DefaultView; RepIntegralRec.DataBind(); } DataSet dsOne = new Cms.BLL.C_integral_rec().GetList("user_id=" + userId); if (dsOne != null && dsOne.Tables[0].Rows.Count > 0) { Repeater1.DataSource = dsOne.Tables[0].DefaultView; Repeater1.DataBind(); } else { Repeater1.DataSource = dsOne.Tables[0].DefaultView; Repeater1.DataBind(); } }