Example #1
0
    public void bind_date(int _id)
    {
        Cms.BLL.C_order   bll   = new Cms.BLL.C_order();
        Cms.Model.C_order model = bll.GetModel(_id);
        ordernum.InnerHtml         = model.order_num;
        updateTime.InnerHtml       = model.updateTime.ToString();
        OrderStatus.InnerHtml      = model.order_status.ToString() == "0" ? "未完单" : "已完单";
        isPayment.InnerHtml        = model.is_payment.ToString() == "0" ? "未支付" : "已支付";
        countprice.InnerHtml       = Convert.ToDecimal(model.price_sum).ToString("0.00");
        Quantity.InnerHtml         = model.quantity_sum.ToString();
        isDelivery.InnerHtml       = model.is_delivery.ToString() == "0" ? "未发货" : "已发货";
        is_receiving.InnerHtml     = model.is_receiving.ToString() == "0" ? "未收货" : "已收货";
        integral_sum.InnerHtml     = model.integral_sum.ToString();
        pay_method.InnerHtml       = model.pay_method.ToString() == "" ? "微信支付" : model.pay_method.ToString();
        shipping_method.InnerHtml  = model.shipping_method.ToString();
        note.InnerHtml             = model.note.ToString();
        recommended_code.InnerHtml = model.recommended_code.ToString();
        courierNumber.Text         = model.courier_number.ToString();
        fahuoCode.Text             = model.fahuoCode.ToString();
        fahuoMsg.Text = model.fahuoMsg.ToString();
        if (model.is_delivery == 1)
        {
            btnSubmit.Visible = false;
        }
        #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_ordersub bllordersub = new Cms.BLL.C_ordersub();
        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.c_user_address().GetList("id=" + model.adress_id);
        if (ds3 != null && ds3.Tables[0].Rows.Count > 0)
        {
            RepAddress.DataSource = ds3.Tables[0].DefaultView;
            RepAddress.DataBind();
        }
        #endregion
    }
Example #2
0
    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();
        }
    }