Exemple #1
0
 /// <summary>
 /// 账号余额查询
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnQueryBalance_Click(object sender, EventArgs e)
 {
     try
     {
         string msg      = "";
         string strValue = new PbProject.Logic.Pay.OperOnline().QueryBalance(rblPayType.SelectedValue, txtAct.Text.Trim(), out msg);
         txtReturnValue.Text = strValue;
         Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "alert('" + msg + "');", true);
     }
     catch (Exception ex)
     {
     }
 }
Exemple #2
0
    /// <summary>
    /// 退款查询
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnRefundSel_Click(object sender, EventArgs e)
    {
        string msg         = "";
        string returnValue = new PbProject.Logic.Pay.OperOnline().RefundSel(rblPayType.SelectedValue,
                                                                            txtOldOrder.Text.Trim(), txtNewOrder.Text.Trim(), txtOnlineNo.Text.Trim(), out msg);


        //returnValue += "\r\n" + msg;
        returnValue = returnValue.Replace("#", "\r\r\n");
        returnValue = returnValue.Replace("<br/>", "\r\r\n");

        txtReturnValue.Text = returnValue;
        Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "alert('" + msg + "');", true);
    }
Exemple #3
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSign_Click(object sender, EventArgs e)
    {
        try
        {
            string msg      = "";
            string strAct   = txtAct.Text.Trim();
            string strValue = new PbProject.Logic.Pay.OperOnline().GetSign(rblPayType.SelectedValue, strAct);



            //Response.Write(strValue);
            Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "window.open ('" + strValue + "','newwindow','top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')", true);
        }
        catch (Exception ex)
        {
        }
    }
Exemple #4
0
    /// <summary>
    /// 账号签约查询
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnQuerySign_Click(object sender, EventArgs e)
    {
        try
        {
            string msg      = "";
            string strAct   = txtAct.Text.Trim();
            bool   strValue = new PbProject.Logic.Pay.OperOnline().QuerySign(rblPayType.SelectedValue, strAct);

            if (strValue)
            {
                msg = "签约成功!";
            }
            else
            {
                msg = "签约失败!";
            }

            Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "alert('" + msg + "');", true);
        }
        catch (Exception ex)
        {
        }
    }
Exemple #5
0
    /// <summary>
    /// 支付查询
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnPaySel_Click(object sender, EventArgs e)
    {
        string msg = "";

        //支付状态查询
        string returnValue = "";


        for (int i = 1; i <= 3; i++)
        {
            returnValue += new PbProject.Logic.Pay.OperOnline().PaySel(i.ToString(), txtOldOrder.Text.Trim(), true, out msg);
            returnValue += "\r\r\n";

            //result = PaySel(i.ToString(), txtOldOrder.Text.Trim(), true, out msg);
            if (msg.Contains("交易成功"))
            {
                break;
            }
        }

        txtReturnValue.Text = returnValue;

        Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "alert('" + msg + "');", true);
    }
    /// <summary>
    /// repCabinList_ItemCommand
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    protected void repOrderList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        try
        {
            string Id     = e.CommandArgument.ToString();
            string msg    = "";
            string result = "";

            if (e.CommandName == "PaySel")//支付状态查询
            {
                #region 支付状态查询

                for (int i = 1; i <= 4; i++)
                {
                    result = new PbProject.Logic.Pay.OperOnline().PaySel(i.ToString(), Id, true, out msg);
                    if (msg.Contains("交易成功"))
                    {
                        break;
                    }
                }
                if (msg.Contains("交易成功"))
                {
                    OrderListDataBind();
                }

                ScriptManager.RegisterStartupScript(this, GetType(), DateTime.Now.Ticks.ToString(), "showdialog('" + msg + "');", true);
                #endregion
            }
            else if (e.CommandName == "RefundSel")//退款查询
            {
                #region 退款查询

                List <Tb_Ticket_Order> mOrderList = baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new Object[] { " id= '" + Id + "'" }) as List <Tb_Ticket_Order>;
                Tb_Ticket_Order        Order      = null; //订单

                if (mOrderList != null && mOrderList.Count > 0)
                {
                    Order = mOrderList[0];
                }
                if (Order != null && Order.PayWay > 0 && Order.PayWay < 13 &&
                    (Order.OrderStatusCode == 5 || Order.OrderStatusCode == 16 || Order.OrderStatusCode == 17 ||
                     Order.OrderStatusCode == 20 || Order.OrderStatusCode == 21 || Order.OrderStatusCode == 22 || Order.OrderStatusCode == 23))
                {
                    result = new PbProject.Logic.Pay.OperOnline().RefundSel(Order, out msg);
                }
                else
                {
                    msg = "订单状态有误,不能退款查询!";
                }

                result = "<textarea style='width:760px; height:360px; background-color:Black; color:Green;'>" + result + "</textarea>";
                string strValue = escape("<span style='color:Red; font-size:18px;'><b>" + msg + "</b></span>" + result);

                ScriptManager.RegisterStartupScript(this, GetType(), DateTime.Now.Ticks.ToString(), "showdialogNew('" + strValue + "');", true);
                #endregion
            }
            else if (e.CommandName == "Refund")//退款处理
            {
                #region 退款处理

                List <Tb_Ticket_Order> mOrderList = baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new Object[] { " id= '" + Id + "'" }) as List <Tb_Ticket_Order>;
                Tb_Ticket_Order        Order      = null; //订单

                if (mOrderList != null && mOrderList.Count > 0)
                {
                    Order = mOrderList[0];
                }
                if (Order != null && (Order.OrderStatusCode == 20 || Order.OrderStatusCode == 21 || Order.OrderStatusCode == 22 || Order.OrderStatusCode == 23))
                {
                    #region 拒绝出票退款处理

                    bool rs = new PbProject.Logic.Pay.OperOnline().TitckOrderRefund(Order, mUser, mCompany, out msg);

                    if (rs)
                    {
                        msg = "";
                    }
                    else
                    {
                        msg = "退款处理失败!" + msg;
                    }
                    #endregion
                }
                else
                {
                    msg = "订单状态有误,不能退款处理!";
                }

                if (msg == "")
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), DateTime.Now.Ticks.ToString(), "TitckOrderRefund();", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), DateTime.Now.Ticks.ToString(), "showdialog('" + msg + "');", true);
                }

                #endregion
            }
            else if (e.CommandName == "Detail")//订单详情
            {
                Response.Redirect("OrderDetail.aspx?Id=" + Id + "&Url=OrderList.aspx&currentuserid=" + this.currentuserid.Value.ToString());
            }
            else if (e.CommandName == "UpdateOrder") //修改订单
            {
                Response.Redirect("OrderUpdate.aspx?Id=" + Id + "&Url=OrderList.aspx&currentuserid=" + this.currentuserid.Value.ToString());
            }
            else if (e.CommandName == "unLock")//解锁
            {
                Tb_Ticket_OrderBLL service = new Tb_Ticket_OrderBLL();
                if (service.OrderUnLock(Id))
                {
                    msg = "此订单已解锁成功!";
                    OrderListDataBind();
                }
                else
                {
                    msg = "解锁失败,请稍后再试!";
                }
                ScriptManager.RegisterStartupScript(this, GetType(), DateTime.Now.Ticks.ToString(), "showdialog('" + msg + "');", true);
            }
        }
        catch (Exception)
        {
        }
    }
    /// <summary>
    /// 处理退废改
    /// </summary>
    /// <param name="OperationType">0.审核中 1 审核通过不退款 、2 拒绝处理、3 审核通过并退款 、4 只退款 </param>
    /// <param name="msg"></param>
    /// <returns></returns>
    private void Process(int OperationType)
    {
        bool   result = false;
        string msg    = "";

        try
        {
            string sqlWhere = " id='" + ViewState["Id"].ToString() + "' ";
            List <Tb_Ticket_Order> OrderList = baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Order>;
            Tb_Ticket_Order        mOrder    = OrderList != null && OrderList.Count > 0 ? OrderList[0] : null;
            if (mOrder != null)
            {
                sqlWhere = " OrderId='" + mOrder.OrderId + "' ";

                /*
                 * 20	取消出票,退款中
                 * 21	退票成功,退款中
                 * 22	废票成功,退款中
                 * 23	拒绝改签,退款中
                 */
                if ("|20|21|22|23|".Contains("|" + mOrder.OrderStatusCode + "|"))
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "showdialogOne('该订单正在退款中。。。','" + ViewState["Url"].ToString() + "');", true);
                    return;
                }

                //Tb_Ticket_Order mOrder = ViewState["Order"] as Tb_Ticket_Order;
                List <Tb_Ticket_Passenger> PassengerList          = ViewState["PassengerList"] as List <Tb_Ticket_Passenger>;
                PbProject.Logic.Order.Tb_Ticket_OrderBLL orderBll = new PbProject.Logic.Order.Tb_Ticket_OrderBLL();

                #region 处理订单状态

                int OrderType = mOrder.TicketStatus; //3.退 4.废 5.改

                if (OperationType == 0)
                {
                    if (mOrder.OrderStatusCode == 6 || mOrder.OrderStatusCode == 7 || mOrder.OrderStatusCode == 8)
                    {
                        //修改订单状态为  审核中
                        if (OrderType == 3)
                        {
                            mOrder.OrderStatusCode = 29;
                        }
                        else if (OrderType == 4)
                        {
                            mOrder.OrderStatusCode = 30;
                        }
                        else if (OrderType == 5)
                        {
                            mOrder.OrderStatusCode = 31;
                        }
                    }
                }
                else if (OperationType == 1)  //审核通过不退款
                {
                    //修改订单状态为  审核通过
                    if (OrderType == 3)
                    {
                        mOrder.OrderStatusCode = 11;
                    }
                    else if (OrderType == 4)
                    {
                        mOrder.OrderStatusCode = 13;
                    }
                    else if (OrderType == 5)
                    {
                        decimal gqPrice = decimal.Parse(txtGQPrice.Text.Trim());

                        if (gqPrice == 0)
                        {
                            // 直接确认改签
                            mOrder.OrderStatusCode = 19;
                            mOrder.PayMoney        = 0;
                            mOrder.OrderMoney      = 0;
                        }
                        else
                        {
                            // 改签等待补差
                            mOrder.OrderStatusCode = 9;
                            mOrder.PayMoney        = gqPrice;
                            mOrder.OrderMoney      = gqPrice;
                            mOrder.TGQHandlingFee  = gqPrice;
                        }
                    }
                }
                else if (OperationType == 2)// 拒绝处理
                {
                    if (OrderType == 3)
                    {
                        mOrder.OrderStatusCode = 12;
                    }
                    else if (OrderType == 4)
                    {
                        mOrder.OrderStatusCode = 14;
                    }
                    else if (OrderType == 5)
                    {
                        mOrder.OrderStatusCode = 10;
                    }

                    mOrder.TGQRefusalReason = txtTGQRefusalReason.Text; //拒绝理由
                }
                else if (OperationType == 3 || OperationType == 4)      // 审核通过并退款    // 只退款
                {
                    //修改订单状态为 退款中, 退款中 只能平台处理

                    if (OrderType == 3)
                    {
                        mOrder.OrderStatusCode = 21;
                    }
                    else if (OrderType == 4)
                    {
                        mOrder.OrderStatusCode = 22;
                    }
                    //else if (OrderType == 5)
                    //    mOrder.OrderStatusCode = 10;
                }

                #endregion

                #region 线下收银 处理

                //线下收银 处理
                if (mOrder.PayWay == 15 && (mOrder.OrderStatusCode == 11 || mOrder.OrderStatusCode == 13 || mOrder.OrderStatusCode == 21 || mOrder.OrderStatusCode == 22))
                {
                    if (mOrder.TicketStatus == 3)
                    {
                        mOrder.OrderStatusCode = 16;
                    }
                    else if (mOrder.TicketStatus == 4)
                    {
                        mOrder.OrderStatusCode = 17;
                    }
                }

                #endregion

                mOrder.A4 = DateTime.Parse(txtA4.Text.Trim());

                mOrder.A6 = decimal.Parse(txtA6.Text.Trim());

                //计算每个乘机人的手续费
                List <Tb_Ticket_Passenger> pasList = GetPassengerList(PassengerList, mOrder);

                string content = "";
                #region 记录手续费日志

                // 11 13 16 17 21 22 29 30

                if (mOrder.OrderStatusCode == 11 || mOrder.OrderStatusCode == 13 ||
                    mOrder.OrderStatusCode == 16 || mOrder.OrderStatusCode == 17 ||
                    mOrder.OrderStatusCode == 21 || mOrder.OrderStatusCode == 22 ||
                    mOrder.OrderStatusCode == 29 || mOrder.OrderStatusCode == 30)
                {
                    string temp = "";
                    bool   re   = false;

                    foreach (Tb_Ticket_Passenger item in pasList)
                    {
                        if (item.TGQHandlingFee > 0)
                        {
                            re = true;
                        }
                        temp += item.TGQHandlingFee + "/";
                    }
                    temp = temp.TrimEnd('/');

                    if (re)
                    {
                        //有手续费
                        //记录日志

                        content = "手续费:" + temp;
                    }
                }

                #endregion

                //退、废、改 处理
                result = orderBll.OperOrderTFG(mOrder, pasList, mUser, mCompany, content);

                string errtitle = "";

                if (result == true)
                {
                    if (OperationType == 3 || OperationType == 4) //退款
                    {
                        result = new PbProject.Logic.Pay.OperOnline().TitckOrderRefund(mOrder, mUser, mCompany, out errtitle);
                    }
                }
                else
                {
                    msg = "处理失败";
                }

                #region

                if (OperationType == 0)
                {
                    msg = result ? "操作成功审核中!" : "操作失败!";
                }
                else if (OperationType == 1)
                {
                    msg = result ? "审核通过成功!" : "审核通过失败!";
                }
                else if (OperationType == 2)
                {
                    msg = result ? "拒绝审核成功!" : "拒绝审核失败!";
                }
                else if (OperationType == 3 || OperationType == 4)
                {
                    msg = mOrder.TicketStatus == 5 ? "处理成功!" : "处理成功!系统退款中...";
                }

                #endregion
            }
        }
        catch (Exception ex)
        {
            msg = "处理出错";
        }

        Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "showdialogOne('" + msg + "','OrderTGQList.aspx?currentuserid=" + this.currentuserid.Value.ToString() + "');", true);
    }