Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable addressDT = receBll.SelByUID(buser.GetLogin().UserID);

            AddressRPT.DataSource = addressDT;
            AddressRPT.DataBind();
            EmptyDiv.Visible = addressDT.Rows.Count < 1;//地址为空提醒
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //BindDP();
         M_UserInfo mu = buser.GetLogin();
         if (Mid > 0)
         {
             M_UserRecei model = receBll.GetSelect(Mid, mu.UserID);
             if (model == null)
             {
                 function.WriteErrMsg("修改的地址不存在");
             }
             ZipCode_T.Text = model.Zipcode;
             //省市县
             Street_T.Text    = model.Street;
             ReceName_T.Text  = model.ReceivName;
             MobileNum_T.Text = model.MobileNum;
             pro_hid.Value    = model.Provinces;
             Def_chk.Checked  = model.isDefault == 1 ? true : false;
             if (model.phone.Split('-').Length > 1)
             {
                 Area_T.Text  = model.phone.Split('-')[0];
                 Phone_T.Text = model.phone.Split('-')[1];
             }
             rUrl = Request.QueryString["ReturnUrl"];
         }
         else
         {
             IPCity cityMod = IPScaner.FindCity(IPScaner.GetUserIP());//"59.52.159.79"
             if (cityMod.IsValid)
             {
                 function.Script(this, "pcc.SetDef('" + cityMod.Province + "','" + cityMod.City + "','" + cityMod.County + "');");
             }
         }
         //用户没有其它地址时自动开启默认
         DataTable addressDT = receBll.SelByUID(mu.UserID);
         if (addressDT == null || addressDT.Rows.Count < 1)
         {
             Def_chk.Checked = true;
         }
     }
 }
Beispiel #3
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;
        }
    }
Beispiel #4
0
        public void MyBind()
        {
            M_UserInfo mu = buser.GetLogin();

            CartDT = cartBll.SelByCartID(B_Cart.GetCartID(), mu.UserID, ProClass, ids);
            if (CartDT.Rows.Count < 1)
            {
                function.WriteErrMsg("你尚未选择商品,<a href='/User/Order/OrderList'>查看我的订单</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;
            }
            //------核算费用
            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;
            }
            //------用户有哪些优惠券
            DataTable avdt = avBll.U_Sel(mu.UserID, -100, 1);

            if (avdt.Rows.Count > 0)
            {
                arrive_div.Style.Add("display", "block");
                arrive_data_div.Visible = true;
                avdt.Columns.Add("enable", typeof(int));
                avdt.Columns.Add("err", typeof(string));
                for (int i = 0; i < avdt.Rows.Count; i++)
                {
                    DataRow dr    = avdt.Rows[i];
                    double  money = allmoney;
                    string  err   = "";
                    dr["enable"] = avBll.U_CheckArrive(new M_Arrive().GetModelFromReader(dr), mu.UserID, ref money, ref err) ? 1 : 0;
                    dr["err"]    = err;
                }
                avdt.DefaultView.RowFilter = "enable='1'";
                //function.WriteErrMsg(avdt.DefaultView.ToTable().Rows.Count.ToString());
                Arrive_Active_RPT.DataSource = avdt.DefaultView.ToTable();
                Arrive_Active_RPT.DataBind();
                avdt.DefaultView.RowFilter    = "enable='0'";
                Arrive_Disable_RPT.DataSource = avdt.DefaultView.ToTable();
                Arrive_Disable_RPT.DataBind();
            }
            else
            {
                arrive_empty_div.Visible = true;
            }
        }
Beispiel #5
0
        public IActionResult Order_Address()
        {
            DataTable dt = receBll.SelByUID(mu.UserID);

            return(PartialView("Comp/Order_Address", dt));
        }