示例#1
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    /// <param name="orderid"></param>
    private void DataBind(string orderid)
    {
        string sqlAirOrderWhere = " OrderId='" + orderid + "'";

        if (mCompany.RoleType == 1)
        {
            sqlAirOrderWhere += " and WatchType in(0,1,2,3,4,5)";
        }
        else
        {
            sqlAirOrderWhere += " and WatchType in(2,3,4,5)";
        }
        sqlAirOrderWhere += " order by OperTime ";

        List <Log_Tb_AirOrder> AirOrderList = baseDataManage.CallMethod("Log_Tb_AirOrder", "GetList", null, new Object[] { sqlAirOrderWhere }) as List <Log_Tb_AirOrder>;

        if (AirOrderList != null && AirOrderList.Count > 0)
        {
            RepOrderLog.DataSource = AirOrderList;
            RepOrderLog.DataBind();
        }
    }
    /// <summary>
    /// 页面信息绑定
    /// </summary>
    private void PageDataBind()
    {
        Tb_Ticket_Order        mOrder    = null;
        string                 sqlWhere  = string.Format("id='{0}'", ViewState["Id"].ToString());
        List <Tb_Ticket_Order> OrderList = this.baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new object[] { sqlWhere }) as List <Tb_Ticket_Order>;

        if (OrderList != null && OrderList.Count > 0)
        {
            mOrder = OrderList[0];
            string OrderId = mOrder.OrderId;
            ViewState["mOrder"] = mOrder;
            if (mOrder.LockLoginName == "")
            {
                lblLockId.Text   = "无";
                lblLockTime.Text = "";
            }
            else
            {
                lblLockId.Text   = mOrder.LockLoginName;
                lblLockTime.Text = mOrder.LockTime.ToString("yyyy-MM-dd HH:mm:ss");
            }
            //查询挂起或者未挂的乘客
            sqlWhere = string.Format(" OrderId='{0}' and Suspended={1}", OrderId, ViewState["Type"].ToString());
            //乘机人信息
            IList <Tb_Ticket_Passenger> PassengerList = this.baseDataManage.CallMethod("Tb_Ticket_Passenger", "GetList", null, new object[] { sqlWhere }) as List <Tb_Ticket_Passenger>;
            RepPassenger.DataSource = PassengerList;
            RepPassenger.DataBind();
            ViewState["mPassenger"] = PassengerList;

            //订单操作日志信息
            sqlWhere = string.Format(" OrderId='{0}' order by OperTime desc ", OrderId);
            IList <Log_Tb_AirOrder> OrderLogList = this.baseDataManage.CallMethod("Log_Tb_AirOrder", "GetList", null, new object[] { sqlWhere }) as List <Log_Tb_AirOrder>;
            RepOrderLog.DataSource = OrderLogList;
            RepOrderLog.DataBind();
        }
    }
    /// <summary>
    /// 绑定订单信息
    /// </summary>
    private void OrderBind()
    {
        try
        {
            string sqlWhere = " id='" + Request.QueryString["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 + "' ";

                #region 订单信息

                //订单信息
                lblInPayNo.Text         = mOrder.InPayNo;
                lblLockId.Text          = mOrder.LockLoginName;
                lblLockTime.Text        = mOrder.LockTime.ToString("yyyy-MM-dd HH:mm:ss");
                lblOrderId.Text         = mOrder.OrderId;
                lblOrderSourceType.Text = GetDictionaryName("33", mOrder.OrderSourceType.ToString());
                lblOrderStatusCode.Text = GetDictionaryName("1", mOrder.OrderStatusCode.ToString());

                //lblPayMoney.Text = mOrder.PayMoney.ToString("F2");
                lblPayMoney.Text     = mOrder.OrderMoney.ToString("F2");
                lblPayNo.Text        = mOrder.PayNo;
                lblPayStatus.Text    = (mOrder.PayStatus == 1) ? "已付" : "未付";
                lblPayWay.Text       = GetDictionaryName("4", mOrder.PayWay.ToString());
                lblPNR.Text          = mOrder.PNR;
                lblPolicyPoint.Text  = mOrder.PolicyPoint + "/" + mOrder.ReturnPoint;
                lblPolicyPoint2.Text = mOrder.PolicyPoint.ToString();
                lblPolicyRemark.Text = mOrder.PolicyRemark;

                lblPolicySource.Text = GetDictionaryName("33", mOrder.PolicySource.ToString());

                // 显示 预订备注
                txtYDRemark.Text = mOrder.YDRemark;
                //退废改  申请理由
                txtTGQApplyReason.Text = mOrder.TGQApplyReason;
                // 拒绝理由
                txtTGQRefusalReason.Text = mOrder.TGQRefusalReason;

                if (mOrder.PolicySource > 2)
                {
                    trOutOrder.Visible = true;
                    //代付信息
                    lblOutOrderId.Text       = mOrder.OutOrderId;
                    lblOutOrderPayFlag.Text  = (mOrder.OutOrderPayFlag == true) ? "已代付" : "未代付";
                    lblOutOrderPayMoney.Text = mOrder.OutOrderPayMoney.ToString("F2");
                    lblOutOrderPayNo.Text    = mOrder.OutOrderPayNo;
                }
                else
                {
                    trOutOrder.Visible = false;
                }

                #endregion

                #region 乘机人信息

                List <Tb_Ticket_Passenger> PassengerList = baseDataManage.CallMethod("Tb_Ticket_Passenger", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Passenger>;

                if (PassengerList != null && PassengerList.Count > 0)
                {
                    RepPassenger.DataSource = PassengerList;
                    RepPassenger.DataBind();
                }

                #endregion

                #region 行程信息

                //现在
                List <Tb_Ticket_SkyWay> SkyWayList = baseDataManage.CallMethod("Tb_Ticket_SkyWay", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_SkyWay>;

                if (SkyWayList != null && SkyWayList.Count > 0)
                {
                    RepSkyWay.DataSource = SkyWayList;
                    RepSkyWay.DataBind();
                }

                //改签的,显示原航程信息
                if (mOrder.TicketStatus == 5)
                {
                    trRepSkyWayOld.Visible = true;
                    string tempSqlWhere = "OrderId='" + mOrder.OldOrderId + "'";
                    List <Tb_Ticket_SkyWay> SkyWayListOld = baseDataManage.CallMethod("Tb_Ticket_SkyWay", "GetList", null, new Object[] { tempSqlWhere }) as List <Tb_Ticket_SkyWay>;

                    if (SkyWayListOld != null && SkyWayListOld.Count > 0)
                    {
                        RepSkyWayOld.DataSource = SkyWayListOld;
                        RepSkyWayOld.DataBind();
                    }
                }
                else
                {
                    trRepSkyWayOld.Visible = false;
                }
                #endregion

                #region 日志信息

                string sqlAirOrderWhere = " OrderId='" + mOrder.OrderId + "'";
                if (mCompany.RoleType == 1)
                {
                    sqlAirOrderWhere += " and WatchType in(0,1,2,3,4,5)";
                }
                else if (mCompany.RoleType == 2 || mCompany.RoleType == 3)
                {
                    sqlAirOrderWhere += " and WatchType in(2,3,4,5)";
                }
                else if (mCompany.RoleType == 4 || mCompany.RoleType == 5)
                {
                    sqlAirOrderWhere += " and WatchType in(4,5)";
                }
                sqlAirOrderWhere += " order by OperTime ";

                List <Log_Tb_AirOrder> AirOrderList = baseDataManage.CallMethod("Log_Tb_AirOrder", "GetList", null, new Object[] { sqlAirOrderWhere }) as List <Log_Tb_AirOrder>;

                if (AirOrderList != null && AirOrderList.Count > 0)
                {
                    RepOrderLog.DataSource = AirOrderList;
                    RepOrderLog.DataBind();
                }

                #endregion

                ViewState["Order"]     = mOrder;
                ViewState["Passenger"] = PassengerList;
            }
        }
        catch (Exception ex)
        {
        }
    }
    /// <summary>
    /// 页面信息绑定
    /// </summary>
    private void PageDataBind()
    {
        try
        {
            //btnTK.Enabled = false;
            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 + "' ";
                // if(mOrder.OrderStatusCode)

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



                #region 订单信息

                //订单信息
                lblInPayNo.Text  = mOrder.InPayNo;
                lblLockId.Text   = mOrder.LockLoginName;
                lblLockTime.Text = mOrder.LockTime.ToString("yyyy-MM-dd HH:mm:ss");
                lblOrderId.Text  = mOrder.OrderId;

                //lblOrderSourceType.Text = mOrder.OrderSourceType.ToString();
                //lblOrderStatusCode.Text = mOrder.OrderStatusCode.ToString();
                lblOrderSourceType.Text = GetDictionaryName("33", mOrder.OrderSourceType.ToString());
                lblOrderStatusCode.Text = GetDictionaryName("1", mOrder.OrderStatusCode.ToString());
                //lblPayMoney.Text = mOrder.PayMoney.ToString("F2");
                //订单状态数据
                Hid_OrderStatus.Value = mOrder.OrderStatusCode.ToString();

                string strPayMoney = mOrder.OrderMoney.ToString("F2");
                if (mOrder.ToString() == "3" || mOrder.ToString() == "4")
                {
                    strPayMoney = "-" + strPayMoney;
                }
                lblPayMoney.Text = strPayMoney;

                lblPayNo.Text     = mOrder.PayNo;
                lblPayStatus.Text = (mOrder.PayStatus == 1) ? "已付" : "未付";
                lblPayWay.Text    = GetDictionaryName("4", mOrder.PayWay.ToString());
                lblPNR.Text       = mOrder.PNR;


                // 换编码
                if (!string.IsNullOrEmpty(mOrder.ChangePNR))
                {
                    lblShowPNR.Text += "换编码:<span style='color:red;'>" + mOrder.ChangePNR + "</span>";
                }

                if (!string.IsNullOrEmpty(mOrder.BigCode))
                {
                    //大编码
                    lblShowPNR.Text += "大编码:<span style='color:red;'>" + mOrder.BigCode + "</span>";
                }

                if (lblShowPNR.Text != "")
                {
                    lblShowPNR.Visible = true;
                    lblShowPNR.Text    = "<br/>" + lblShowPNR.Text;
                }

                string showPolicyPoint = "";
                if (mOrder.ReturnMoney != 0)
                {
                    showPolicyPoint += "原政策:" + mOrder.OldPolicyPoint.ToString("F1") + " 现返:" + mOrder.OldReturnMoney;
                    showPolicyPoint += "<br />出票政策:" + mOrder.PolicyPoint.ToString("F1") + " 现返:" + mOrder.ReturnMoney;
                }
                else
                {
                    showPolicyPoint += "原政策:" + mOrder.OldPolicyPoint.ToString("F1");
                    showPolicyPoint += "<br />出票政策:" + mOrder.PolicyPoint.ToString("F1");
                }

                lblPolicyPoint.Text = showPolicyPoint;


                lblPolicyRemark.Text = mOrder.PolicyRemark;
                lblPolicySource.Text = GetDictionaryName("24", mOrder.PolicySource.ToString());


                // mOrder.TGQApplyReason  退改签申请理由
                // mOrder.TGQRefusalReason  退改签拒绝理由
                // mOrder.YDRemark (订票备注)预订时备注信息
                // mOrder.CPRemark (出票备注)出票时备注信息

                // 显示 预订备注
                txtYDRemark.Text = mOrder.YDRemark;
                //退废改  申请理由
                txtTGQApplyReason.Text = mOrder.TGQApplyReason;
                // 拒绝理由
                txtTGQRefusalReason.Text = mOrder.TGQRefusalReason;


                if (mOrder.A4.ToString("yyyy-MM-dd") == "1900-01-01")
                {
                    txtA4.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
                else
                {
                    txtA4.Text = mOrder.A4.ToString("yyyy-MM-dd HH:mm:ss");
                }

                txtA6.Text = mOrder.A6.ToString();

                #endregion

                #region 乘机人信息

                List <Tb_Ticket_Passenger> PassengerList = baseDataManage.CallMethod("Tb_Ticket_Passenger", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Passenger>;

                if (PassengerList != null && PassengerList.Count > 0)
                {
                    RepPassenger.DataSource = PassengerList;
                    RepPassenger.DataBind();
                }

                #endregion

                #region 行程信息

                List <Tb_Ticket_SkyWay> SkyWayList = baseDataManage.CallMethod("Tb_Ticket_SkyWay", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_SkyWay>;

                if (SkyWayList != null && SkyWayList.Count > 0)
                {
                    RepSkyWay.DataSource = SkyWayList;
                    RepSkyWay.DataBind();
                }

                //改签的,显示原航程信息
                if (mOrder.TicketStatus == 5)
                {
                    trRepSkyWayOld.Visible = true;
                    string tempSqlWhere = "OrderId='" + mOrder.OldOrderId + "'";
                    List <Tb_Ticket_SkyWay> SkyWayListOld = baseDataManage.CallMethod("Tb_Ticket_SkyWay", "GetList", null, new Object[] { tempSqlWhere }) as List <Tb_Ticket_SkyWay>;

                    if (SkyWayListOld != null && SkyWayListOld.Count > 0)
                    {
                        RepSkyWayOld.DataSource = SkyWayListOld;
                        RepSkyWayOld.DataBind();
                    }
                }
                else
                {
                    trRepSkyWayOld.Visible = false;
                }

                #endregion

                #region 日志信息

                string sqlAirOrderWhere = " OrderId='" + mOrder.OrderId + "'";
                if (mCompany.RoleType == 1)
                {
                    sqlAirOrderWhere += " and WatchType in(0,1,2,3,4,5)";
                }
                else if (mCompany.RoleType == 2 || mCompany.RoleType == 3)
                {
                    sqlAirOrderWhere += " and WatchType in(2,3,4,5)";
                }
                else if (mCompany.RoleType == 4 || mCompany.RoleType == 5)
                {
                    sqlAirOrderWhere += " and WatchType in(4,5)";
                }
                sqlAirOrderWhere += " order by OperTime ";

                List <Log_Tb_AirOrder> AirOrderList = baseDataManage.CallMethod("Log_Tb_AirOrder", "GetList", null, new Object[] { sqlAirOrderWhere }) as List <Log_Tb_AirOrder>;


                if (AirOrderList != null && AirOrderList.Count > 0)
                {
                    RepOrderLog.DataSource = AirOrderList;
                    RepOrderLog.DataBind();
                }

                #endregion

                ViewState["Order"]         = mOrder;
                ViewState["PassengerList"] = PassengerList;
                ViewState["SkyWayList"]    = SkyWayList;

                //7	申请退票,等待审核
                //8	申请废票,等待审核
                //9	改签审核成功,等待补差
                //10	审核失败,拒绝改签
                //11	审核成功,等待退票
                //12	审核失败,拒绝退票
                //13	审核成功,等待废票
                //14	审核失败,拒绝废票
                //15	补差成功,等待确认
                //16	退票成功,交易结束
                //17	废票成功,交易结束
                //18	拒绝补差,改签失败
                //19	改签成功,交易结束

                span2.Visible = true; // 2.拒绝审核

                // span1 1. 通过审核不退款
                // span2 2.拒绝审核
                // span3 3.审核通过并退款
                // span4 4.退款

                hid_TicketStatus.Value = mOrder.TicketStatus.ToString();

                if (mOrder.TicketStatus == 3) //3.退票
                {
                    trTF.Style["display"] = "block";

                    #region 退票手续费

                    if (mOrder.OrderStatusCode == 7)
                    {
                        //7	申请退票,等待审核
                        lblShow.Text  = "退票审核";
                        span1.Visible = true; // 1. 通过审核不退款

                        td4.Visible = true;
                        td2.Visible = true;
                        td3.Visible = true;

                        span0.Visible = true;
                    }
                    else if (mOrder.OrderStatusCode == 29)
                    {
                        //7	申请退票,等待审核
                        lblShow.Text  = "退票审核";
                        span1.Visible = true; // 1. 通过审核不退款

                        td4.Visible = true;
                        td2.Visible = true;
                        td3.Visible = true;
                    }
                    else if (mOrder.OrderStatusCode == 11)
                    {
                        //11 审核成功,等待退票
                        lblShow.Text = "退款处理";
                        btnNoOk.Text = "拒绝退票";
                        td4.Visible  = true;
                        td2.Visible  = true;
                        td3.Visible  = true;

                        span4.Visible = true;
                    }
                    #endregion
                }
                else if (mOrder.TicketStatus == 4) //废票
                {
                    trTF.Style["display"] = "block";

                    #region 废票
                    if (mOrder.OrderStatusCode == 8)
                    {
                        //8	申请废票,等待审核
                        lblShow.Text  = "废票审核";
                        span1.Visible = true; //1. 通过审核不退款

                        td4.Visible = true;
                        td2.Visible = true;
                        td3.Visible = true;

                        span0.Visible = true;
                    }
                    else if (mOrder.OrderStatusCode == 30)
                    {
                        //8	申请废票,等待审核
                        lblShow.Text  = "废票审核";
                        span1.Visible = true; //1. 通过审核不退款

                        td4.Visible = true;
                        td2.Visible = true;
                        td3.Visible = true;
                    }
                    else if (mOrder.OrderStatusCode == 13)
                    {
                        //13	审核成功,等待废票
                        lblShow.Text = "退款处理";
                        btnNoOk.Text = "拒绝废票";

                        td4.Visible = true;
                        td2.Visible = true;
                        td3.Visible = true;

                        span4.Visible = true;
                    }

                    #endregion
                }
                else if (mOrder.TicketStatus == 5) //5.改签
                {
                    trGQ.Style["display"] = "block";
                    // 隐藏


                    if (mOrder.OrderStatusCode == 31)
                    {
                        span1.Visible  = true;
                        btnOktoSH.Text = "通过审核";

                        labHCName.Text = "新行程信息";
                        lblShow.Text   = "改签审核";
                        btnNoOk.Text   = "拒绝改签";

                        span0.Visible = true;
                    }
                    else
                    {
                        span1.Visible  = true;
                        btnOktoSH.Text = "通过审核";

                        labHCName.Text = "新行程信息";
                        lblShow.Text   = "改签审核";
                        btnNoOk.Text   = "拒绝改签";
                    }
                }

                if (KongZhiXiTong != null && KongZhiXiTong.Contains("|47|"))
                {
                    //分开
                    span3.Visible = false;
                }
                else
                {
                    if (mOrder.OrderStatusCode == 7 || mOrder.OrderStatusCode == 8)
                    {
                        span3.Visible = true;//不分开
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }