Esempio n. 1
0
    protected void gv_browOrder_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string[] args = e.CommandArgument.ToString().Split(':');
        if (args.Length != 7)
        {
            ScriptHelper.SetAlert(Page, "数据异常");
            return;
        }
        string           orderId     = args[0];//报单ID
        MemberOrderModel mOrderModel = new MemberOrderModel();
        MemberInfoModel  mInfoModel  = null;

        if (args[5].Trim() == "1")
        {
            MemberOrderAgainBLL memberOrderAgainBLL = new MemberOrderAgainBLL();
            memberOrderAgainBLL.WriterDataToPage(mOrderModel, args[6], args[0]);
        }
        else
        {
            mInfoModel = new MemberInfoModel();
            AddOrderBLL AddOrderBLL = new AddOrderBLL();
            AddOrderBLL.GetDataFormInfoAndOrder(args[1], int.Parse(args[4]), args[6], mInfoModel, mOrderModel);
        }
        if (mOrderModel == null)
        {
            ScriptHelper.SetAlert(Page, "当前报单已经不存在.");
            return;
        }
        string number         = args[1];
        string defrayname     = args[2];
        string payStatus      = args[3];
        string orderExpectNum = args[4];
        string isagain        = args[5].ToString();
        string storeId        = args[6].ToString();
        string SqlCon         = System.Configuration.ConfigurationManager.ConnectionStrings["connString"].ConnectionString;

        //如果是修改
        if (e.CommandName == "M")
        {
            //          Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.BalanceBrowseMemberOrdersEdit);
            if (payStatus == "0")
            {
                //对未支付报单
                if (isagain == "0") //未确认注册修改
                {
                    //Response.Redirect("RegisterMember.aspx?mode=edit&orderId=" + orderId + "&flag=0&number=" + number + "&StoreID=" + storeId);

                    Response.Redirect("../RegisterUpdate1.aspx?OrderID=" + orderId + "&Number=" + number + "&CssType=3&storeId=" + storeId);
                }
                else if (isagain == "1")          //未确认复销修改
                {
                    Response.Redirect("MemberOrderAgain.aspx?mode=edit&orderId=" + orderId + "&ordertype=" + mOrderModel.OrderType + "&flag=0&number=" + number + "&StoreID=" + storeId);

                    // Response.Redirect("../RegisterUpdate1.aspx?OrderID=" + orderId + "&Number=" + number + "&CssType=3&storeId=" + storeId);
                }
                else
                {
                    return;
                }
            }
            else if (payStatus == "1" && defrayname == "1")
            {
                //对已支付报单
                if (isagain == "0")    //已确认注册修改
                {
                    if (mOrderModel.OrderType == 4)
                    {
                        //Response.Redirect("RegisterMember1.aspx?mode=edit&orderId=" + orderId + "&flag=1&number=" + number + "&StoreID=" + storeId + "&except=" + orderExpectNum);
                        Response.Redirect("../RegisterUpdate1.aspx?OrderID=" + orderId + "&Number=" + number + "&CssType=3&storeId=" + storeId + "&tp=1");
                    }
                    else
                    {
                        //Server.Transfer("RegisterMember.aspx?mode=edit&orderId=" + orderId + "&flag=1&number=" + number + "&StoreID=" + storeId+"&ExceptOld=true");

                        Response.Redirect("../RegisterUpdate1.aspx?OrderID=" + orderId + "&Number=" + number + "&CssType=3&storeId=" + storeId);
                    }
                }
                else if (isagain == "1")         //已确认复销修改
                {
                    Response.Redirect("MemberOrderAgain.aspx?mode=edit&orderId=" + orderId + "&ordertype=" + mOrderModel.OrderType + "&flag=1&number=" + number + "&StoreID=" + storeId);
                    //Response.Redirect("../RegisterUpdate1.aspx?OrderID=" + orderId + "&Number=" + number + "&CssType=3&storeId=" + storeId);
                }
                else
                {
                    return;
                }
            }
        }
    }
Esempio n. 2
0
    protected void gv_browOrder_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "P")
        {
            string    orderid = e.CommandArgument.ToString();
            string    num     = "";
            double    ttmoney = 0;
            DataTable dt      = DBHelper.ExecuteDataTable("select  number,TotalMoney  from memberorder where  orderid='" + orderid + "'");
            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                num     = dr["number"].ToString();
                ttmoney = Convert.ToDouble(dr["TotalMoney"]);
                double nep     = Convert.ToDouble(DBHelper.ExecuteScalar("  select CoinnewPrice   from CoinPlant where CoinIndex = 'CoinE' "));
                double nedde   = (ttmoney * 0.05) / nep;
                int    choselv = 1;

                double eblace = Convert.ToDouble(DBHelper.ExecuteScalar("select  pointEin -pointEout as r from memberinfo where  number='" + num + "'"));
                if (nedde > eblace)
                {
                    ScriptHelper.SetAlert(Page, "火星币账户余额不足,不能完成协助支付!");
                    // btnSearch_Click(null, null);
                    return;
                }

                int rr = MemberOrderDAL.PayOrder(num, orderid, 0, 0, 0, nedde, choselv, "USDT账户支付订单,支付中断,后台协助支付");

                if (rr == 1)
                {
                    int ee = MemberOrderDAL.payOrderEcoin(num, orderid, nedde, "E币支付激活,激活成功!");  if (ee == 1)
                    {
                        ScriptHelper.SetAlert(Page, "协助支付成功");
                    }
                    btnSearch_Click(null, null);
                    return;
                }
                else
                {
                    ScriptHelper.SetAlert(Page, "协助支付失败!");
                    btnSearch_Click(null, null);
                    return;
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('订单不存在!');</script>", false);
                btnSearch_Click(null, null);
                return;
            }
        }


        string[] args = e.CommandArgument.ToString().Split(':');
        //if (args.Length != 7)
        //{
        //    ScriptHelper.SetAlert(Page, this.GetTran("001089", "数据异常"));
        //    return;
        //}
        string           orderId     = args[0];//报单ID
        MemberOrderModel mOrderModel = new MemberOrderModel();
        MemberInfoModel  mInfoModel  = null;

        if (args[5].Trim() == "1")
        {
            MemberOrderAgainBLL memberOrderAgainBLL = new MemberOrderAgainBLL();
            memberOrderAgainBLL.WriterDataToPage(mOrderModel, args[6], args[0]);
        }
        else
        {
            mInfoModel = new MemberInfoModel();
            AddOrderBLL AddOrderBLL = new AddOrderBLL();
            AddOrderBLL.GetDataFormInfoAndOrder(args[1], int.Parse(args[4]), args[6], mInfoModel, mOrderModel);
        }
        if (mOrderModel == null)
        {
            ScriptHelper.SetAlert(Page, this.GetTran("001784", "当前报单已经不存在"));
            return;
        }
        string number         = args[1];
        string defrayname     = args[2];
        string payStatus      = args[3];
        string orderExpectNum = args[4];
        string isagain        = args[5].ToString();
        string storeId        = args[6].ToString();
        string SqlCon         = DAL.DBHelper.connString;

        if (e.CommandName == "OK")
        {
            int selectIndex = ((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex;
            Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.BalanceBrowseMemberOrdersEdit);
            if (payStatus == "0")
            {
                if (mOrderModel.IsAgain == 0)
                {
                    string info = MemberOrderAgainBLL.AuditingOrder((sender as LinkButton).CommandArgument.ToString());
                    if (info == "")
                    {
                        ScriptHelper.SetAlert(Page, "支付成功!");
                        btnSearch_Click(null, null);
                    }
                    else
                    {
                        ScriptHelper.SetAlert(Page, info);
                    }
                }
                else if (mOrderModel.IsAgain == 1)
                {
                    string info = MemberOrderAgainBLL.AuditingOrder((sender as LinkButton).CommandArgument.ToString());
                    if (info == "")
                    {
                        ScriptHelper.SetAlert(Page, "支付成功!");
                        btnSearch_Click(null, null);
                    }
                    else
                    {
                        ScriptHelper.SetAlert(Page, info);
                    }
                }
                else
                {
                    ScriptHelper.SetAlert(Page, this.GetTran("001786", "当前报单是否复销类型不正确."));
                    return;
                }
            }
            else
            {
                ScriptHelper.SetAlert(Page, this.GetTran("001789", "已经确认过的报单单不可再确认."));
                return;
            }
            btnSearch_Click(null, null);
        }
        else if (e.CommandName == "M")
        {
            if (payStatus == "0")
            {
                Response.Redirect("../RegisterUpdate1.aspx?OrderID=" + orderId + "&Number=" + number + "&CssType=3&storeId=" + storeId);
                //对未支付报单
                if (isagain == "0") //未确认注册修改
                {
                    Response.Redirect("../RegisterUpdate1.aspx?OrderID=" + orderId + "&Number=" + number + "&CssType=3&storeId=" + storeId);
                }
                else if (isagain == "1")          //未确认复销修改
                {
                    Response.Redirect("MemberOrderAgain.aspx?mode=edit&orderId=" + orderId + "&ordertype=" + mOrderModel.OrderType + "&flag=0&number=" + number + "&StoreID=" + storeId);
                }
                else
                {
                    return;
                }
            }
            else
            {
                ScriptHelper.SetAlert(Page, this.GetTran("000000", "无法对已支付的报单进行修改!"));
            }
        }
        else if (e.CommandName == "D")
        {
            //if (payStatus == "0")
            //{

            if (isagain == "0")
            {
                Application.Lock();
                //注册报单删除
                string result = bll.DelMembersDeclaration(number, mInfoModel.ExpectNum, orderId, mOrderModel.StoreId, Convert.ToDouble(mOrderModel.LackProductMoney));
                //返回null标识没有产生错误
                Application.UnLock();
                if (result == null)
                {
                    result = this.GetTran("000008", "删除成功");
                }
                ScriptHelper.SetAlert(Page, result);
            }
            else if (isagain == "1")
            {
                Application.Lock();
                string result = viewFuXiaoBLL.DelOredrAgain(orderId, double.Parse(mOrderModel.TotalPv.ToString()), number, mOrderModel.OrderExpect, mOrderModel.StoreId);
                Application.UnLock();
                if (result == null)
                {
                    result = this.GetTran("000008", "删除成功");
                }
                ScriptHelper.SetAlert(Page, result);
            }
            btnSearch_Click(null, null);
            //}
            //else
            //{



            //   // ScriptHelper.SetAlert(Page, this.GetTran("000000", "无法删除已支付的报单!"));
            //}
            //btnSearch_Click(null, null);
        }


        else if (e.CommandName == "E")
        {
            if (payStatus == "1")
            {
                string         sql  = @"UPDATE memberorder SET isSend = 1  WHERE OrderID = @orderId";
                SqlParameter[] para =
                {
                    new SqlParameter("@orderId", orderId)
                };
                int idd = DBHelper.ExecuteNonQuery(sql, para, CommandType.Text);
                if (idd == 1)
                {
                    ScriptHelper.SetAlert(Page, "发货成功!");
                }
                else
                {
                    ScriptHelper.SetAlert(Page, "发货失败!");
                }
            }
            else
            {
                ScriptHelper.SetAlert(Page, this.GetTran("000000", "未付款的报单没法发货!"));
            }
            btnSearch_Click(null, null);
        }
    }