Beispiel #1
0
    protected void TxtStore_TextChanged(object sender, EventArgs e)
    {
        //验证店铺编号是否存在
        if (!MemberOrderAgainBLL.CheckStore(GetStoreId()))
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001779", "对不起,您输入的店铺不存在!") + "');", true);
            return;
        }

        //绑定产品树
        ProductTree myTree = new ProductTree();

        this.menuLabel.Text = myTree.getMenu10(GetStoreId());
        AddOrderBLL.BindCurrency_Rate(this.DropCurrency, GetStoreId());
    }
Beispiel #2
0
    /// <summary>
    /// 确定按钮事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void go_Click(object sender, EventArgs e)
    {
        //验证店铺编号
        if (TxtStore.Text == "" || TxtStore.Text == null)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("006026", "店铺编号不能为空!") + "');", true);
            return;
        }
        //获取用户选择商品的总钱和总积分
        IList <MemberDetailsModel> choseProList = AddMemberDetails();
        decimal          SumMoney    = Convert.ToDecimal(ViewState["TotalMoney"]);               //Convert.ToDecimal(new RegistermemberBLL().getZongJing(choseProList));
        decimal          SumPv       = Convert.ToDecimal(ViewState["TotalPv"]);                  //Convert.ToDecimal(new RegistermemberBLL().getZongPv(choseProList));
        string           orderID     = MemberOrderAgainBLL.GetOrderInfo(IsEdit(), GetOrderId()); //获取报单号
        MemberOrderModel momberorder = AddOrdrer(orderID, SumMoney, SumPv);



        //验证店铺是否存在
        if (!MemberOrderAgainBLL.CheckStore(TxtStore.Text))
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("006027", "店铺编号不存在!") + "');", true);
            return;
        }

        //需要修改session取得期数,需要修改
        if (!new RegistermemberBLL().IsMaxQiShu(CommonDataBLL.getMaxqishu()))
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001543", "只可对最大期数据进行操作") + "');", true);
            return;
        }
        //得到用户选择商品总金额和总积分
        if (choseProList.Count == 0)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001550", "对不起,您还没有输入订货数量信息!") + "');", true);
            return;
        }
        if (Convert.ToBoolean(ViewState["StateCount"]))
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("007039", "对不起,您选择了停售产品,并且超出了店铺库存数量!") + "');", true);
            return;
        }

        if (panel2.Visible)
        {
            //验证国家省份城市是否选择
            if (CountryCity1.Country == "" || CountryCity1.Province == "" || CountryCity1.City == "")//|| CountryCity1.Country == "请选择" || CountryCity1.Province == "请选择" || CountryCity1.City == "请选择")
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001548", "对不起,请选择国家省份城市!") + "');", true);
                return;
            }
        }

        if (panel2.Visible)
        {
            //详细地址不能为空
            if (Txtdz.Text == "")
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("006933", "对不起,请填写详细地址!") + "');", true);
                return;
            }
        }
        double notEnoughmoney = new RegistermemberBLL().CheckMoneyIsEnough(choseProList, GetStoreId(), orderID);

        //不足货物的钱
        momberorder.LackProductMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(GetStoreId(), notEnoughmoney));//获得标准币种

        //添加订单,跟新会员业绩,和该店库存报单的费用
        if (MemberOrderAgainBLL.AddOrderData(IsEdit(), momberorder, choseProList))
        {
            if (!IsEdit())
            {
                double totalmoney = Convert.ToDouble(SumMoney);
                double totalcomm  = 0;
                double zongMoney  = totalmoney + totalcomm;

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "var formobj=document.createElement('form');"
                                                        + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(momberorder.OrderId, 1, 1) + "';" +
                                                        "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='MemberOrder.aspx';", true);

                //购物车的session
                if (Session["proList"] != null)
                {
                    Session.Remove("proList");
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("000222", "修改成功!") + "');location.href='membertrade.aspx';", true);
            }
        }
        else
        {
            if (!IsEdit())
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001557", "报单失败!") + "');", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("000225", "修改失败!") + "');", true);
            }
        }
    }