Example #1
0
 private void MyBind()
 {
     CartDT         = cartBll.SelByCookID(CartCookID, ProClass);//从数据库中获取
     RPT.DataSource = orderCom.SelStoreDT(CartDT);
     RPT.DataBind();
     totalmoney.InnerText = GetTPrice(CartDT);
 }
Example #2
0
    public void MyBind()
    {
        CartDT = cartBll.SelByCookID(CartCookID, ProClass, ids);
        if (CartDT.Rows.Count < 1)
        {
            function.WriteErrMsg("你尚未选择商品,<a href='/User/Order/OrderList.aspx'>查看我的订单</a>");
        }
        //旅游,酒店等不需要检测地址栏
        switch (DataConvert.CLng(CartDT.Rows[0]["ProClass"]))
        {
        case (int)M_Product.ClassType.LY:
        {
            userli.Visible = true;
            M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(CartDT.Rows[0]["Additional"].ToString());
            model.Guest.AddRange(model.Contract);
            UserRPT.DataSource = model.Guest;
            UserRPT.DataBind();
        }
        break;

        case (int)M_Product.ClassType.JD:
        {
            userli.Visible = true;
            M_Cart_Hotel model = JsonConvert.DeserializeObject <M_Cart_Hotel>(CartDT.Rows[0]["Additional"].ToString());
            model.Guest.AddRange(model.Contract);
            UserRPT.DataSource = model.Guest;
            UserRPT.DataBind();
        }
        break;

        default:     //------地址
            DataTable addressDT = receBll.SelByUID(buser.GetLogin().UserID);
            AddressRPT.DataSource = addressDT;
            AddressRPT.DataBind();
            EmptyDiv.Visible = addressDT.Rows.Count < 1;    //地址为空提醒
            break;
        }
        //------核算费用
        double allmoney = UpdateCartAllMoney(CartDT);

        //------费用统计
        itemnum_span.InnerText     = CartDT.Rows.Count.ToString();
        totalmoney_span1.InnerText = allmoney.ToString("f2");
        //------店铺
        Store_RPT.DataSource = orderCom.SelStoreDT(CartDT);
        Store_RPT.DataBind();
        //------发票绑定
        DataTable invoceDT = new DataTable();//orderBll.SelInvoByUser(buser.GetLogin().UserID);

        if (invoceDT.Rows.Count > 0)
        {
            Invoice_RPT.DataSource = invoceDT;
            Invoice_RPT.DataBind();
        }
        else
        {
            Invoice_RPT.Visible = false;
        }
        //------积分抵扣
        if (SiteConfig.ShopConfig.PointRatiot > 0 && SiteConfig.ShopConfig.PointRatiot < 100 && SiteConfig.ShopConfig.PointRate > 0)
        {
            point_body.Visible = true;
            M_UserInfo usermod = buser.GetLogin();
            Point_L.Text = usermod.UserExp.ToString();
            int usepoint = (int)(allmoney * (SiteConfig.ShopConfig.PointRatiot * 0.01) / SiteConfig.ShopConfig.PointRate);
            function.Script(this, "SumByPoint(" + usepoint + ");");
            PointRate_Hid.Value = SiteConfig.ShopConfig.PointRate.ToString();
        }
        else
        {
            point_tips.Visible = true;
        }
    }