Пример #1
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    private void PageDataBind()
    {
        try
        {
            int TotalCount = 0;

            IHashObject outParams = new HashObject();
            //指定参数类型 第一个参数为out输出类型
            //key 为参数索引从1开始 value为引用类型 out ref
            outParams.Add("1", "out");
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            List <Tb_Ticket_Order> list = baseDataManage.CallMethod("Tb_Ticket_Order", "GetBasePager1", outParams,
                                                                    new object[] { TotalCount, AspNetPager1.PageSize, Curr, "*", Con, ViewState["orderBy"].ToString() }) as List <Tb_Ticket_Order>;

            TotalCount = outParams.GetValue <int>("1");

            AspNetPager1.RecordCount      = TotalCount;
            AspNetPager1.CurrentPageIndex = Curr;
            AspNetPager1.CustomInfoHTML   = "&nbsp;&nbsp;&nbsp;  页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount;

            repList.DataSource = list;
            repList.DataBind();
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('页面出错,请从新点击链接!');", true);
        }
    }
Пример #2
0
    /// <summary>
    /// 订单绑定
    /// </summary>
    private void OrderListDataBind()
    {
        try
        {
            int TotalCount = 0;

            IHashObject outParams = new HashObject();
            //指定参数类型 第一个参数为out输出类型
            //key 为参数索引从1开始 value为引用类型 out ref
            outParams.Add("1", "out");
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            List <Tb_Ticket_Order> list = baseDataManage.CallMethod("Tb_Ticket_Order", "GetBasePager1", outParams,
                                                                    new object[] { TotalCount, AspNetPager1.PageSize, Curr, "*,dbo.GetCpyName(CPCpyNo) NewCpCpyName ", Con, ViewState["orderBy"].ToString() }) as List <Tb_Ticket_Order>;

            TotalCount = outParams.GetValue <int>("1");

            AspNetPager1.RecordCount      = TotalCount;
            AspNetPager1.CurrentPageIndex = Curr;
            AspNetPager1.CustomInfoHTML   = "&nbsp;&nbsp;&nbsp;  页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount;

            repOrderList.DataSource = list;
            repOrderList.DataBind();
        }
        catch (Exception)
        {
        }
    }
Пример #3
0
    /// <summary>
    /// 绑定
    /// </summary>
    private void PageDataBind()
    {
        try
        {
            int TotalCount = 0;

            IHashObject outParams = new HashObject();
            string      sqlWhere  = "OrderId in(select OrderId from Tb_Ticket_Passenger where IsBack=0 and OrderId in(select OrderId from Tb_Ticket_Order where " + Con + "))";

            //指定参数类型 第一个参数为out输出类型
            //key 为参数索引从1开始 value为引用类型 out ref
            outParams.Add("1", "out");
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            List <Tb_Ticket_Order> list = baseDataManage.CallMethod("Tb_Ticket_Order", "GetBasePager1", outParams,
                                                                    new object[] { TotalCount, AspNetPager1.PageSize, Curr, "*", sqlWhere, ViewState["orderBy"].ToString() }) as List <Tb_Ticket_Order>;

            TotalCount = outParams.GetValue <int>("1");

            AspNetPager1.RecordCount      = TotalCount;
            AspNetPager1.CurrentPageIndex = Curr;
            AspNetPager1.CustomInfoHTML   = "&nbsp;&nbsp;&nbsp;  页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount;

            repList.DataSource = list;
            repList.DataBind();
        }
        catch (Exception ex)
        {
            repList.DataSource = null;
            repList.DataBind();
        }
    }
Пример #4
0
    /// <summary>
    /// 显示账单明细
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnPayDetail_Click(object sender, EventArgs e)
    {
        try
        {
            string sqlWhere = " OrderId='" + txtOldOrder.Text.Trim() + "' ";
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            List <Tb_Ticket_Order>     mOrderList    = baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Order>;
            List <Tb_Ticket_Passenger> PassengerList = baseDataManage.CallMethod("Tb_Ticket_Passenger", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Passenger>;


            List <string> strList = new PbProject.Logic.Pay.Bill().CreateOrderAndTicketPayDetailNew(mOrderList[0], PassengerList); //计算订单金额生成订单

            if (strList != null && strList.Count > 0)
            {
                foreach (string item in strList)
                {
                    txtReturnValue.Text += item + "\r\r\n";
                }

                txtReturnValue.Text += "PayMoney = " + mOrderList[0].PayMoney + "\r\r\n";
                txtReturnValue.Text += "OrderMoney = " + mOrderList[0].OrderMoney + "\r\r\n";
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "alert('生成数据失败');", true);
            }
        }
        catch (Exception ex)
        {
        }
    }
Пример #5
0
    /// <summary>
    /// 计算订单金额
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnPayMoney_Click(object sender, EventArgs e)
    {
        try
        {
            string sqlWhere = " OrderId='" + txtOldOrder.Text.Trim() + "' ";
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            List <Tb_Ticket_Order>     mOrderList    = baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Order>;
            List <Tb_Ticket_Passenger> PassengerList = baseDataManage.CallMethod("Tb_Ticket_Passenger", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Passenger>;


            // PbProject.Logic.Pay.Data d = new PbProject.Logic.Pay.Data();
            //string PayMoney = d.CreateOrderPayMoney(mOrderList[0], PassengerList).ToString();
            //string OrderMoney = d.CreateOrderOrderMoney(mOrderList[0], PassengerList).ToString();

            PbProject.Logic.Pay.Bill bill = new PbProject.Logic.Pay.Bill();
            bill.CreateOrderAndTicketPayDetailNew(mOrderList[0], PassengerList);
            decimal PayMoney   = mOrderList[0].PayMoney;
            decimal OrderMoney = mOrderList[0].OrderMoney;


            txtReturnValue.Text += "PayMoney=" + PayMoney + ",OrderMoney=" + OrderMoney;
        }
        catch (Exception ex)
        {
        }
    }
Пример #6
0
        /// <summary>
        /// 获取用户信息表
        /// </summary>
        /// <param name="loginName">登录名</param>
        /// <param name="pwdMD5">MD5密码</param>
        /// <param name="loginIp">客户端IP</param>
        /// <returns>返回用户信息表</returns>
        private DataTable[] GetUserTableArray(string loginName, string pwdMD5, string loginIp)
        {
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            DataTable[] userTableArray;
            HashObject  hashParam = new HashObject();

            hashParam.Add("LoginName", loginName);
            hashParam.Add("LoginPwd", pwdMD5);
            hashParam.Add("IsBool", 1);//区分大小写,写死------------------------------
            hashParam.Add("LoginIP", loginIp);
            userTableArray = baseDataManage.MulExecProc("UserLogin", hashParam);
            return(userTableArray);
        }
Пример #7
0
        public void GetBaiTuoPol()
        {
            PbProject.Model.definitionParam.BaseSwitch BS = new PbProject.Model.definitionParam.BaseSwitch();

            List <PbProject.Model.Bd_Base_Parameters> mBP = new PbProject.Logic.ControlBase.BaseDataManage().
                                                            CallMethod("Bd_Base_Parameters", "GetList", null, new Object[] { "CpyNo='" + _order.OwnerCpyNo.Substring(0, 12) + "'" }) as List <PbProject.Model.Bd_Base_Parameters>;

            BS = PbProject.WebCommon.Utility.BaseParams.getParams(mBP);
            PTBybaituo baituo = new PTBybaituo(_order, BS);

            _allPolicy.AddRange(baituo.GetPolicy(_changePnr));
            DataBaiTuoOk = true;
        }
Пример #8
0
    /// <summary>
    /// 更新出票相关信息
    /// </summary>
    /// <param name="order"></param>
    private void UpdateTicketOrder(PbProject.Model.Tb_Ticket_Order order)
    {
        string resultDes = HttpUtility.UrlDecode(m_DrawResultDes, Encoding.GetEncoding("gb2312"));

        if (m_DrawResult.Trim() == "000000")//出票成功
        {
            string[] passengerInfoList = resultDes.Split(';');
            PbProject.Logic.Order.Tb_Ticket_PassengerBLL psb     = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
            List <PbProject.Model.Tb_Ticket_Passenger>   psmList = psb.GetPasListByOrderID(order.OrderId);

            psmList = ModifyPassenger(passengerInfoList, psb, psmList);

            order = ModifyOrder(order);

            List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                           CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + order.CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

            List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                          CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + order.CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
            bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(order, psmList, mUser[0], mCompany[0], "");
            if (reuslt)
            {
                #region  票宝开放服务接口异步通知出票

                if (order.OrderSourceType == 5)
                {
                    PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                    if (pbInterfaceCmd != null)
                    {
                        bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(order);
                    }
                }
                #endregion
                string msg = PnrNo + "_SUCC";
                client.Send(AddHeadLen(msg));
                LogInfo(string.Format("出票成功.订单号:{0},PNR:{1}", order.OrderId, PnrNo), false);
            }
            else
            {
                LogInfo(string.Format("出票失败.订单号:{0},PNR:{1}", order.OrderId, PnrNo), false);
            }
        }
        else
        {
            LogInfo(resultDes + ",订单号:" + order.OrderId + ",PNR:" + PnrNo, false);
            RollBackTicketOrderState(order, string.Format("出票失败,原因:{0}", resultDes));
        }
        client.Send(AddHeadLen(PnrNo + "_SUCC"));//返回成功
    }
Пример #9
0
    /// <summary>
    /// 通过订单号 计算订单金额
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button9_Click(object sender, EventArgs e)
    {
        string orderid = TextBox5.Text.Trim();

        string sqlWhere = " OrderId='" + orderid + "' ";

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

        //Data data = new Data();
        //TextBox5.Text = data.CreateOrderPayMoney(mOrderList[0], PassengerList).ToString();  //计算时 已经减去手续费了

        PbProject.Logic.Pay.Bill bill = new Bill();

        bill.CreateOrderAndTicketPayDetailNew(mOrderList[0], PassengerList);

        TextBox5.Text = mOrderList[0].OrderMoney.ToString();
    }
Пример #10
0
    /// <summary>
    ///
    /// </summary>
    public void BindCount()
    {
        try
        {
            string UninAllName = txtCustomer.Text.Trim();
            string CPTimeState = DateTime.Parse(cptimestart.Value).ToString("yyyy-MM-dd") + " 00:00:00";
            string CPTimeEnd   = DateTime.Parse(cptimeend.Value).ToString("yyyy-MM-dd") + " 23:59:59";

            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            DataBase.Data.HashObject queryParamter = new DataBase.Data.HashObject();
            queryParamter.Add("UninAllName", UninAllName);
            queryParamter.Add("CPTimeState", CPTimeState);
            queryParamter.Add("CPTimeEnd", CPTimeEnd);

            System.Data.DataTable dt = baseDataManage.EexcProc("Proc_GetGXOrderCount", queryParamter);
            gvTicketDetail.DataSource = dt;
            gvTicketDetail.DataBind();
        }
        catch (Exception)
        {
        }
    }
Пример #11
0
    private void GetData()
    {
        string tmpstr = "";

        string[] sl = HttpContext.Current.Request.Form.AllKeys;//Request.QueryString.AllKeys;
        for (int i = 0; i < sl.Length; i++)
        {
            tmpstr += sl[i] + "=" + HttpContext.Current.Request.Form.Get(i) + "&";//HttpContext.Current.Request.Form.Keys[i] + "&";
        }

        OnErrorNew(HttpUtility.UrlDecode(tmpstr), false);

        //string ticketnoinfo = "";
        //for (int i = 0; i < Request.Form.Count; i++)
        //{
        //    ticketnoinfo = ticketnoinfo + Request.Form.Keys[i].ToString() + ":" + Request.Form[i].ToString() + "|";
        //}
        //ticketnoinfo = HttpUtility.UrlDecode(ticketnoinfo, Encoding.GetEncoding("gb2312"));
        //OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);

        string NewPnr = "";

        string airId = HttpContext.Current.Request.Form.Get("airId");//Request.QueryString["airId"].ToString().Trim();

        OnErrorNew("判断是否有票号信息,airId=" + airId, false);

        if (HttpContext.Current.Request.Form.Get("airId").Trim() != "")
        {
            OnErrorNew("进入 Request.QueryString['status'].ToString().Trim() != ''", false);
            if (HttpContext.Current.Request.Form.Get("Type").Trim() == "1")//出票完成
            {
                bool reuslt = false;
                OnErrorNew("进入出票 Request.QueryString['status'].ToString().Trim() == 'T'", false);
                StringBuilder sb = new StringBuilder();
                List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + HttpContext.Current.Request.Form.Get("orderid").Trim() + "'");

                if (OrderUpdateList.Count == 0)
                {
                    OnErrorNew("根据外部订单号未查找到对应订单,外部订单号:" + HttpContext.Current.Request.Form.Get("orderid").Trim(), false);
                }

                if (OrderUpdateList[0].OrderStatusCode != 3)
                {
                    OnErrorNew("订单状态不是待出票状态...", false);
                }

                //Login(OrderUpdateList);
                if (OrderUpdateList[0].OrderStatusCode == 3)
                {
                    //OrderUpdateList.OrderStatusCode = 4; //出票状态
                    if (HttpContext.Current.Request.Form.Get("NewPnr") != null && HttpContext.Current.Request.Form.Get("NewPnr") != "")
                    {
                        OrderUpdateList[0].ChangePNR = HttpContext.Current.Request.Form.Get("NewPnr");
                    }

                    int tcount = 0;
                    PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                    List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList[0].OrderId);
                    for (int j = 0; j < PassengerList.Count; j++)
                    {
                        string sss = HttpUtility.UrlDecode(HttpContext.Current.Request.Form.Get("passengerName"));

                        OnErrorNew("乘机人列表:" + sss, false);

                        string[] Name = sss.Split('^');
                        for (int i = 0; i < Name.Length; i++)
                        {
                            if (PassengerList[j].PassengerName.Trim().Replace("CHD", "").Trim().Replace(" ", "") == Name[i].Replace("CHD", "").Trim().Replace(" ", ""))
                            {
                                PassengerList[j].TicketNumber = HttpContext.Current.Request.Form.Get("airId").Split('^')[i].ToString();
                                tcount++;
                            }
                        }
                    }

                    if (tcount == PassengerList.Count)
                    {
                        OrderUpdateList[0].OrderStatusCode = 4; //出票状态
                    }
                    else
                    {
                        #region 记录操作日志
                        //添加操作订单的内容
                        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                        PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                        OrderLog.id          = Guid.NewGuid();
                        OrderLog.OrderId     = OrderUpdateList[0].OrderId;
                        OrderLog.OperType    = "修改";
                        OrderLog.OperTime    = DateTime.Now;
                        OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                        OrderLog.WatchType   = 2;
                        string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                        sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                        #endregion
                    }

                    List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                   CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                    List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                  CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
                    reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList[0], PassengerList, mUser[0], mCompany[0], "");
                    if (reuslt)
                    {
                        sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新成功!\r\n");
                        #region  票宝开放服务接口异步通知出票

                        if (OrderUpdateList[0].OrderSourceType == 5)
                        {
                            PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                            if (pbInterfaceCmd != null)
                            {
                                bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList[0]);
                            }
                        }
                        #endregion
                    }
                    else
                    {
                        sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新失败!\r\n");
                    }
                    OnErrorNew("易行记录:" + sb.ToString(), false);
                }
            }
        }
    }
Пример #12
0
    private void GetData()
    {
        StringBuilder sb         = new StringBuilder();
        string        platform   = Request.Form["platform"].ToString();
        string        type       = Request.Form["type"].ToString();
        string        orderguid  = Request.Form["orderguid"].ToString();
        string        orderstate = Request.Form["orderstate"].ToString();
        string        notifymsg  = Request.Form["notifymsg"].ToString();
        string        key        = Request.Form["key"].ToString();
        string        localKey   = string.Empty;

        if (type == "2")
        {
            localKey = string.Format("$%^{0}{1}|8000YI$8000yi$", orderguid, notifymsg);
        }
        else
        {
            localKey = string.Format("$%^{0}{1}8000YI$8000yi$", orderguid, notifymsg);
        }
        localKey = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(localKey, "MD5");
        if (!key.Equals(localKey))
        {
            OnErrorNew("key错误", false);
        }
        else
        {
            string[] notifyMsgSort = notifymsg.Split('^');
            string   PassengerName = string.Empty, TicketNumber = string.Empty;
            if (type == "2")
            {
                PassengerName = notifyMsgSort[1];
                TicketNumber  = notifyMsgSort[2];

                #region 更新数据库订单信息
                List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + orderguid + "'");

                //Kevin 2013-05-28 判断当前订单状态
                if (OrderUpdateList[0].OrderStatusCode != 3)
                {
                    OnErrorNew("外部订单号:" + orderguid + "对应订单状态不是等待出票状态,不做自动复核!", false);
                    return;
                }

                //Login(OrderUpdateList);
                //OrderUpdateList[0].OrderStatusCode = 4; //出票状态

                int tcount = 0;
                PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList[0].OrderId);
                for (int j = 0; j < PassengerList.Count; j++)
                {
                    int number = -1;
                    for (int k = 0; k < PassengerName.Split('|').Length; k++)
                    {
                        if (PassengerName.Split('|')[k].ToString().Replace("CHD", "") == PassengerList[j].PassengerName.Replace("CHD", ""))
                        {
                            number = k;
                            break;
                        }
                    }
                    if (number != -1)
                    {
                        tcount++;
                        PassengerList[j].TicketNumber = TicketNumber.Split('|')[number];
                        PassengerList[j].TicketStatus = 2;
                    }
                }

                if (tcount == PassengerList.Count)
                {
                    OrderUpdateList[0].OrderStatusCode = 4; //出票状态
                }
                else
                {
                    #region 记录操作日志
                    //添加操作订单的内容
                    PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                    PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                    OrderLog.id          = Guid.NewGuid();
                    OrderLog.OrderId     = OrderUpdateList[0].OrderId;
                    OrderLog.OperType    = "修改";
                    OrderLog.OperTime    = DateTime.Now;
                    OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                    OrderLog.WatchType   = 2;
                    string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                    sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                    #endregion
                }

                List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                               CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                              CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;

                bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList[0], PassengerList, mUser[0], mCompany[0], "");
                if (reuslt)
                {
                    sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新成功!\r\n");
                    #region  票宝开放服务接口异步通知出票

                    if (OrderUpdateList[0].OrderSourceType == 5)
                    {
                        PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                        if (pbInterfaceCmd != null)
                        {
                            bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList[0]);
                        }
                    }
                    #endregion
                }
                else
                {
                    sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新失败!\r\n");
                }
                OnErrorNew("记录:" + sb.ToString(), false);
                #endregion
            }
            else if (type == "3" || type == "4")
            {
                //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
                //PiaoBao.Models.Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(orderguid)[0];
                //if (Request.Form["orderstate"].ToString().Contains("已经退票") || Request.Form["orderstate"].ToString().Contains("已经废票"))
                //{
                //    OnErrorNew("8000yi平台退废票成功" + Order.OrderId, false);
                //    Order.A40 = "3";
                //    #region 记录日志
                //    PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
                //    PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
                //    OrderLog.PNR = Order.PNR;
                //    OrderLog.OrderId = Order.OrderId;
                //    if (Order.OrderType == 3)
                //    {
                //        OrderLog.OperateType = 14;
                //    }
                //    else if (Order.OrderType == 4)
                //    {
                //        OrderLog.OperateType = 17;
                //    }
                //    OrderLog.OperateTime = DateTime.Now;
                //    OrderLog.Content = "于 " + DateTime.Now + " 8000yi平台供应已退票";
                //    OrderLog.OperateId = "adminys";
                //    OrderLog.OperateName = "管理员";
                //    OrderLog.OperateCorporationId = 1;
                //    OrderLog.A1 = 1;
                //    int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
                //    #endregion
                //    OrderMan.UpdateTb_Ticket_Order(Order);
                //}
                //else
                //{
                //    OnErrorNew("8000yi平台退废票失败" + Order.OrderId, false);
                //    Order.A40 = "4";
                //    #region 记录日志
                //    PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
                //    PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
                //    OrderLog.PNR = Order.PNR;
                //    OrderLog.OrderId = Order.OrderId;
                //    if (Order.OrderType == 3)
                //    {
                //        OrderLog.OperateType = 14;
                //    }
                //    else if (Order.OrderType == 4)
                //    {
                //        OrderLog.OperateType = 17;
                //    }
                //    OrderLog.OperateTime = DateTime.Now;
                //    OrderLog.Content = "于 " + DateTime.Now + " 8000yi平台供应已拒绝退废票,请联系平台手动处理 ";
                //    OrderLog.OperateId = "adminys";
                //    OrderLog.OperateName = "管理员";
                //    OrderLog.OperateCorporationId = 1;
                //    OrderLog.A1 = 1;
                //    int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
                //    #endregion
                //    OrderMan.UpdateTb_Ticket_Order(Order);
                //}
            }
            OnErrorNew("记录:" + sb.ToString(), false);
        }
    }
Пример #13
0
    private void GetData()
    {
        string ticketnoinfo = "";

        for (int i = 0; i < Request.Form.Count; i++)
        {
            ticketnoinfo = ticketnoinfo + Request.Form.Keys[i].ToString() + ":" + Request.Form[i].ToString() + "|";
        }
        OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);
        string NotifyType      = Request.Form["NotifyType"].ToString();      //通知类型(出票通知;待出票通知)
        string OrderId         = Request.Form["OrderId"].ToString();         //订单Id
        string DrawABillFlag   = Request.Form["DrawABillFlag"].ToString();   //出票状态(0表示出票,1表示取消出票)
        string DrawABillRemark = Request.Form["DrawABillRemark"].ToString(); //取消出票理由
        string TicketNos       = Request.Form["TicketNos"].ToString();       //票号信息(结算码|票号|证件类型|证件号|乘机人姓名)
        string Sign            = Request.Form["Sign"].ToString();            //Sign
        string Pnr             = Request.Form["Pnr"].ToString();             //Pnr
        string NewPnr          = "";

        if (Request.Form["NewPnr"] != null)
        {
            NewPnr = Request.Form["NewPnr"].ToString(); //NewPnr
        }

        //Kevin 2013-05-28 Edit
        //判断当前订单状态,如果不是 已经支付等待出票,则退出
        List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList2 = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + OrderId + "'");

        //Login(OrderUpdateList);
        if (OrderUpdateList2[0].OrderStatusCode != 3) //等待出票状态
        {
            OnErrorNew("外部订单号:" + OrderId + "对应订单状态不为等待出票状态,不做自动复核!", false);
            return;
        }


        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
        StringBuilder sb = new StringBuilder();

        sb.AppendFormat("\r\n\r\n\r\n\r\n\r\n");
        sb.AppendFormat("517出票通知日志记录" + "\r\n");
        sb.AppendFormat("访问IP" + ":" + Page.Request.UserHostAddress + "\r\n");
        sb.AppendFormat("通知类型:" + NotifyType.ToString() + "\r\n");
        sb.AppendFormat("517订单编号:" + OrderId.ToString() + "\r\n");
        if (DrawABillFlag == "0")
        {
            sb.AppendFormat("出票状态:已经出票\r\n");
            string JSMA          = "";
            string TicketNumber  = "";
            string PidType       = "";
            string Pid           = "";
            string PassengerName = "";
            for (int i = 0; i < TicketNos.Split(',').Length; i++)
            {
                JSMA          = JSMA + "," + TicketNos.Split(',')[i].Split('|')[0].ToString();
                JSMA          = JSMA.TrimStart(',').TrimEnd(',');
                TicketNumber  = TicketNumber + "," + TicketNos.Split(',')[i].Split('|')[0].ToString() + "-" + TicketNos.Split(',')[i].Split('|')[1].ToString();
                TicketNumber  = TicketNumber.TrimStart(',').TrimEnd(',');
                PidType       = PidType + "," + TicketNos.Split(',')[i].Split('|')[2].ToString();
                PidType       = PidType.TrimStart(',').TrimEnd(',');
                Pid           = Pid + "," + TicketNos.Split(',')[i].Split('|')[3].ToString();
                Pid           = Pid.TrimStart(',').TrimEnd(',');
                PassengerName = PassengerName + "," + TicketNos.Split(',')[i].Split('|')[4].ToString();
                PassengerName = PassengerName.TrimStart(',').TrimEnd(',');
            }
            if (JSMA != "")
            {
                sb.AppendFormat("结算码:" + JSMA + "\r\n");
                sb.AppendFormat("票号:" + TicketNumber + "\r\n");
                sb.AppendFormat("证件类型:" + PidType + "\r\n");
                sb.AppendFormat("证件号:" + Pid + "\r\n");
                sb.AppendFormat("乘机人姓名:" + PassengerName + "\r\n");
            }
            else
            {
                sb.AppendFormat("票号信息:" + TicketNos.ToString() + "\r\n");
            }
            sb.AppendFormat("效验码:" + Sign + "\r\n");
            #region 更新数据库订单信息

            List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + OrderId + "'");
            //Login(OrderUpdateList);

            if (NewPnr != null && NewPnr != "")
            {
                OrderUpdateList[0].ChangePNR = NewPnr;
            }

            int tcount = 0;
            PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
            List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList[0].OrderId);
            for (int j = 0; j < PassengerList.Count; j++)
            {
                int number = -1;
                for (int k = 0; k < PassengerName.Split(',').Length; k++)
                {
                    if (PassengerName.Split(',')[k].ToString().Replace("CHD", "") == PassengerList[j].PassengerName.Replace("CHD", ""))
                    {
                        number = k;
                        break;
                    }
                }
                if (number != -1)
                {
                    PassengerList[j].TicketNumber = TicketNumber.Split(',')[number];
                    PassengerList[j].TicketStatus = 2;
                    tcount++;
                }
            }

            //如果乘机人和票号数量一致,则更改订单状态
            if (tcount == PassengerList.Count)
            {
                OrderUpdateList[0].OrderStatusCode = 4; //出票状态
            }
            else
            {
                #region 记录操作日志
                //添加操作订单的内容
                PbProject.Model.Log_Tb_AirOrder OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                OrderLog.id          = Guid.NewGuid();
                OrderLog.OrderId     = OrderUpdateList[0].OrderId;
                OrderLog.OperType    = "修改";
                OrderLog.OperTime    = DateTime.Now;
                OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                OrderLog.WatchType   = 2;
                string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                #endregion
            }

            List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                           CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

            List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                          CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
            bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList[0], PassengerList, mUser[0], mCompany[0], "");
            if (reuslt)
            {
                sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新成功!\r\n");
                #region  票宝开放服务接口异步通知出票

                if (OrderUpdateList[0].OrderSourceType == 5)
                {
                    PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                    if (pbInterfaceCmd != null)
                    {
                        bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList[0]);
                    }
                }
                #endregion
            }
            else
            {
                sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新失败!\r\n");
            }
        }
        else
        {
            sb.AppendFormat("出票状态:取消出票\r\n");
            sb.AppendFormat("取消出票理由:" + DrawABillRemark.ToString() + "\r\n");
        }
        #endregion
        OnErrorNew("记录:" + sb.ToString(), false);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        OnErrorNew("进入 ReturnBaiTuoPay.aspx_Load()", false);

        string tmpstr = "";

        string[] sl = Request.QueryString.AllKeys;
        for (int i = 0; i < sl.Length; i++)
        {
            tmpstr += sl[i] + "=" + Request.QueryString[sl[i]].ToString() + "&";
        }

        OnErrorNew(tmpstr, false);


        PbProject.Model.Tb_Ticket_Order            Order = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(Request.QueryString["portorderid"].ToString());
        PbProject.Model.definitionParam.BaseSwitch BS    = new PbProject.Model.definitionParam.BaseSwitch();
        List <PbProject.Model.Bd_Base_Parameters>  mBP   = new PbProject.Logic.ControlBase.BaseDataManage().
                                                           CallMethod("Bd_Base_Parameters", "GetList", null, new Object[] { "CpyNo='" + Order.OwnerCpyNo.Substring(0, 12) + "'" }) as List <PbProject.Model.Bd_Base_Parameters>;

        BS = PbProject.WebCommon.Utility.BaseParams.getParams(mBP);
        //Login(Order);
        PbProject.Logic.PTInterface.PTBybaituo OrderBaiTuoInterface = new PbProject.Logic.PTInterface.PTBybaituo(Order, BS);
        w_BTWebService.BaiTuoWeb BaiTuoWebService = new w_BTWebService.BaiTuoWeb();
        //BaiTuoWebService.BaiTuoWeb BaiTuoWebService = new BaiTuoWebService.BaiTuoWeb();
        //System.Threading.Thread.Sleep(50000);

        if (Request.QueryString["forderformid"] != null && Request.QueryString["messageType"].ToString() == "2")
        {
            #region 出票
            #region 参数接收
            string forderformid = Request.QueryString["forderformid"].ToString();
            string produceType  = Request.QueryString["produceType"].ToString();
            string messageType  = Request.QueryString["messageType"].ToString();
            OnErrorNew("ticketnoinfo内容:" + "messageType:" + messageType + "/forderformid:" + forderformid + "/produceType:" + produceType, false);
            #endregion
            XmlElement xmlElement = OrderBaiTuoInterface.BaiTuoCpSend(forderformid);

            XmlNode xml = BaiTuoWebService.getOrderInfoXml(xmlElement);

            OnErrorNew("取订单XML内容:" + xml.InnerXml, false);
            DataSet      ds  = new DataSet();
            StringReader rea = new StringReader("<ORDER_INFO_RS>" + xml.InnerXml + "</ORDER_INFO_RS>");
            #region 测试数据
            //string sss = "";
            //sss += "<ORDERINFO OrderID=\"f1020\" IssuedDate=\"2008-12-24 10:07:31\" Status=\"4\" Flag=\"1\" Shouldpaid=\"8180.00\" Money=\"8000.00\">";
            //sss += "<TICKETINFO PNR=\"RE566\" personName=\"wangchun2\" DepartCity=\"PEK\" ArrivalCity=\"SHA\" InsuranceNumber=\"D000028127\" Price=\"450\" AgentPrice=\"440\" InsurancePolicyNO=\"\" EhomeBillno=\"\" >999-789456120</TICKETINFO>";
            //sss += "<TICKETINFO PNR=\"RE567\" personName=\"wangchun3\" DepartCity=\"PEK\" ArrivalCity=\"SHA\" InsuranceNumber=\"\" Price=\"450\" AgentPrice=\"440\" InsurancePolicyNO=\"\" EhomeBillno=\"\">999-789456121</TICKETINFO>";
            //sss += "<TICKETINFO PNR=\"RE568\" personName=\"wangchun4\" DepartCity=\"PEK\" ArrivalCity=\"SHA\" InsuranceNumber=\"D000028127\" Price=\"450\" AgentPrice=\"440\" InsurancePolicyNO=\"\" EhomeBillno=\"\">999-789456122</TICKETINFO>";
            //sss += "</ORDERINFO>";
            //sss += "<Error Code=\"611001\">出错原因</Error>";
            //StringReader rea = new StringReader("<ORDER_INFO_RS>" + sss + "</ORDER_INFO_RS>");
            #endregion
            XmlTextReader xmlReader = new XmlTextReader(rea);

            ds.ReadXml(xmlReader);
            if (ds.Tables.Count > 1)
            {
                OnErrorNew("订单状态:" + ds.Tables[0].Rows[0]["Status"].ToString(), false);
                if (ds.Tables[0].Rows[0]["Status"].ToString() == "4")
                {
                    if (Order != null)
                    {
                        if (Order.OrderStatusCode == 4)
                        {
                            OnErrorNew("该票号已经出票", false);
                            return;
                        }
                        if (Order.OrderStatusCode == 3)
                        {
                            int tcount = 0;
                            PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                            List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(Order.OrderId);
                            OnErrorNew("开始修改订单状态", false);
                            for (int i = 0; i < PassengerList.Count; i++)
                            {
                                for (int j = 0; j < ds.Tables[1].Rows.Count; j++)
                                {
                                    if (PassengerList[i].PassengerName.Replace("CHD", "") == ds.Tables[1].Rows[j]["personName"].ToString().Replace("CHD", ""))
                                    {
                                        OnErrorNew(PassengerList[i].PassengerName + ":" + ds.Tables[1].Rows[j]["TICKETINFO_TEXT"].ToString(), false);
                                        PassengerList[i].TicketNumber = ds.Tables[1].Rows[j]["TICKETINFO_TEXT"].ToString();
                                        PassengerList[i].TicketStatus = 2;
                                        tcount++;
                                    }
                                }
                            }

                            if (tcount == PassengerList.Count)
                            {
                                Order.OrderStatusCode = 4; //出票状态
                            }
                            else
                            {
                                #region 记录操作日志
                                //添加操作订单的内容
                                PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                                PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                                OrderLog.id          = Guid.NewGuid();
                                OrderLog.OrderId     = Order.OrderId;
                                OrderLog.OperType    = "修改";
                                OrderLog.OperTime    = DateTime.Now;
                                OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                                OrderLog.WatchType   = 2;
                                string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                                sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                                #endregion
                            }


                            bool reuslt = false;
                            List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                           CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + Order.CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                            List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                          CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + Order.CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
                            reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(Order, PassengerList, mUser[0], mCompany[0], "");
                            if (reuslt)
                            {
                                OnErrorNew("修改订单完成", false);
                                #region  票宝开放服务接口异步通知出票

                                if (Order.OrderSourceType == 5)
                                {
                                    PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                                    if (pbInterfaceCmd != null)
                                    {
                                        bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(Order);
                                    }
                                }
                                #endregion
                            }
                            else
                            {
                                OnErrorNew("修改订单失败", false);
                            }
                        }
                    }
                }
            }
            #endregion
        }
        else if (Request.QueryString["orderID"] != null && Request.QueryString["messageType"].ToString() == "12")//拒绝退/废票的消息
        {
            //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
            //Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(Request.QueryString["orderID"].ToString())[0];
            //OnErrorNew("百拓退废票失败" + Order.OrderId, false);
            //Order.A40 = "4";
            //#region 记录日志
            //PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //OrderLog.PNR = Order.PNR;
            //OrderLog.OrderId = Order.OrderId;
            //if (Order.OrderType == 3)
            //{
            //    OrderLog.OperateType = 14;
            //}
            //else if (Order.OrderType == 4)
            //{
            //    OrderLog.OperateType = 17;
            //}
            //OrderLog.OperateTime = DateTime.Now;
            //OrderLog.Content = "于 " + DateTime.Now + " 百拓平台供应已拒绝退废票,请联系平台手动处理 拒绝原因:" + Request.QueryString["memo"].ToString();
            //OrderLog.OperateId = "adminys";
            //OrderLog.OperateName = "管理员";
            //OrderLog.OperateCorporationId = 1;
            //OrderLog.A1 = 1;
            //int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //#endregion
            //OrderMan.UpdateTb_Ticket_Order(Order);
        }
        else if (Request.QueryString["orderID"] != null && (Request.QueryString["messageType"].ToString() == "13" || Request.QueryString["messageType"].ToString() == "14"))//退废票办理完成,等待供应商退款的消息
        {
            //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
            //Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(Request.QueryString["orderID"].ToString())[0];
            //OnErrorNew("百拓退废票成功" + Order.OrderId, false);
            //Order.A40 = "3";
            //#region 记录日志
            //PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //OrderLog.PNR = Order.PNR;
            //OrderLog.OrderId = Order.OrderId;
            //if (Order.OrderType == 3)
            //{
            //    OrderLog.OperateType = 14;
            //}
            //else if (Order.OrderType == 4)
            //{
            //    OrderLog.OperateType = 17;
            //}
            //OrderLog.OperateTime = DateTime.Now;
            //OrderLog.Content = "于 " + DateTime.Now + " 百拓平台供应已退票";
            //OrderLog.OperateId = "adminys";
            //OrderLog.OperateName = "管理员";
            //OrderLog.OperateCorporationId = 1;
            //OrderLog.A1 = 1;
            //int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //#endregion
            //OrderMan.UpdateTb_Ticket_Order(Order);
        }
    }
    private void GetData()
    {
        if (Request.QueryString["passengerNames"].ToString() != "")
        {
            string ticketnoinfo = "";
            for (int i = 0; i < Request.QueryString.Count; i++)
            {
                ticketnoinfo = ticketnoinfo + Request.QueryString.Keys[i].ToString() + ":" + Request.QueryString[i].ToString() + "|";
            }
            OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);
            string[] passengerNames = Request.QueryString["passengerNames"].ToString().TrimStart(',').TrimEnd(',').Split(',');
            string[] ticketNos      = Request.QueryString["ticketNos"].ToString().TrimStart(',').TrimEnd(',').Split(',');
            string   sequenceNo     = Request.QueryString["sequenceNo"].ToString();
            string   pnrNo          = Request.QueryString["pnrNo"].ToString();
            string   oldPnrNo       = "";
            if (Request.QueryString["oldPnrNo"] != null)
            {
                oldPnrNo = Request.QueryString["oldPnrNo"].ToString(); //oldPnrNo
            }
            StringBuilder sb = new StringBuilder();
            List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + sequenceNo + "'");
            //Login(OrderUpdateList);
            if (OrderUpdateList[0].OrderStatusCode == 3)
            {
                if (oldPnrNo != null && oldPnrNo != "")
                {
                    OrderUpdateList[0].ChangePNR = oldPnrNo;
                }

                int tcount = 0;
                PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList[0].OrderId);
                for (int j = 0; j < PassengerList.Count; j++)
                {
                    for (int i = 0; i < passengerNames.Length; i++)
                    {
                        if (PassengerList[j].PassengerName.Trim().Replace("CHD", "") == passengerNames[i].ToString().Trim().Replace("CHD", ""))
                        {
                            tcount++;
                            PassengerList[j].TicketNumber = ticketNos[i].ToString().Trim();
                            PassengerList[j].TicketStatus = 2;
                        }
                    }
                }

                if (tcount == PassengerList.Count)
                {
                    OrderUpdateList[0].OrderStatusCode = 4; //出票状态
                }
                else
                {
                    #region 记录操作日志
                    //添加操作订单的内容
                    PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                    PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                    OrderLog.id          = Guid.NewGuid();
                    OrderLog.OrderId     = OrderUpdateList[0].OrderId;
                    OrderLog.OperType    = "修改";
                    OrderLog.OperTime    = DateTime.Now;
                    OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                    OrderLog.WatchType   = 2;
                    string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                    sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                    #endregion
                }

                List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                               CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                              CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
                bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList[0], PassengerList, mUser[0], mCompany[0], "");
                if (reuslt)
                {
                    sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新成功!\r\n");
                    #region  票宝开放服务接口异步通知出票

                    if (OrderUpdateList[0].OrderSourceType == 5)
                    {
                        PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                        if (pbInterfaceCmd != null)
                        {
                            bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList[0]);
                        }
                    }
                    #endregion
                }
                else
                {
                    sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新失败!\r\n");
                }
            }
            OnErrorNew("记录:" + sb.ToString(), false);
        }
        else if (Request.QueryString["venderRefundTime"].ToString() != "")//退废票通知
        {
            //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
            //PiaoBao.Models.Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(Request.QueryString["sequenceNo"].ToString())[0];
            //if (Request.QueryString["type"].ToString() == "1")//平台已经退废票
            //{
            //    PiaoBao.Models.User_Company mCompany = PiaoBao.BLLLogic.Factory_System.CreateCompanyManager().SelectUser_CompanyByRoleType()[0];
            //    string strWhere = " pid='" + mCompany.PId + "' and keyno='" + mCompany.KeyNo + "'";
            //    StringBuilder strSql = new StringBuilder();
            //    strSql.Append("select A1 ");
            //    strSql.Append(" FROM Tb_User_Supplier ");
            //    DataSet ds = Maticsoft.DBUtility.DbHelperSQL.Query(strSql.ToString() + "where " + strWhere);
            //    if (ds.Tables[0].Rows[0]["A1"].ToString().Contains("|71|"))//自动退废票开关开启
            //    {
            //        PiaoBao.BLLLogic.Order.Tb_Ticket_PassengerManager PassengerMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_PassengerManager();
            //        IList<PiaoBao.Models.Tb_Ticket_Passenger> PassengerList = PassengerMan.SelectTb_Ticket_PassengerByOrderId(Order.OrderId);
            //        PiaoBao.BLLLogic.Order.Tb_Ticket_SkyWayManager SkyWayManager = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_SkyWayManager();
            //        IList<PiaoBao.Models.Tb_Ticket_SkyWay> SkyWayList = SkyWayManager.SelectTb_Ticket_SkyWayByOrderId(Order.OrderId);
            //        PiaoBao.BLLLogic.Order.OrderTGQ orderTGQ = new PiaoBao.BLLLogic.Order.OrderTGQ();
            //        string ProcessMsg = "";
            //        string TFsxFee = Request.QueryString["refundFee"].ToString();

            //        bool reuslt = orderTGQ.Process(out ProcessMsg, 1, GetTGQFee(PassengerList, TFsxFee), 0, Order.OrderType.ToString(), "", IsProcess(PassengerList), Order, PassengerList, SkyWayList);
            //        Order.A40 = "3";
            //        OrderMan.UpdateTb_Ticket_Order(Order);
            //        string Contents = "";
            //        if (reuslt)
            //        {
            //            OnErrorNew("系统自动退废票成功" + Order.OrderId, false);
            //            Contents = "于 " + DateTime.Now + " 51book平台供应已退票,系统自动退废票成功!";
            //        }
            //        else
            //        {
            //            OnErrorNew("系统自动退废票失败" + Order.OrderId, false);
            //            Contents = "于 " + DateTime.Now + " 51book平台供应已退票,系统自动退废票失败:" + ProcessMsg + "!";
            //        }
            //        #region 记录日志
            //        PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //        PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //        OrderLog.PNR = Order.PNR;
            //        OrderLog.OrderId = Order.OrderId;
            //        if (Order.OrderType == 3)
            //        {
            //            OrderLog.OperateType = 14;
            //        }
            //        else if (Order.OrderType == 4)
            //        {
            //            OrderLog.OperateType = 17;
            //        }
            //        OrderLog.OperateTime = DateTime.Now;
            //        OrderLog.Content = Contents;
            //        OrderLog.OperateId = "adminys";
            //        OrderLog.OperateName = "管理员";
            //        OrderLog.OperateCorporationId = 1;
            //        OrderLog.A1 = 1;
            //        int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //        #endregion
            //    }
            //    else
            //    {
            //        OnErrorNew("开关未开,不走系统自动退废票" + Order.OrderId, false);
            //        Order.A40 = "3";
            //        #region 记录日志
            //        PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //        PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //        OrderLog.PNR = Order.PNR;
            //        OrderLog.OrderId = Order.OrderId;
            //        if (Order.OrderType == 3)
            //        {
            //            OrderLog.OperateType = 14;
            //        }
            //        else if (Order.OrderType == 4)
            //        {
            //            OrderLog.OperateType = 17;
            //        }
            //        OrderLog.OperateTime = DateTime.Now;
            //        OrderLog.Content = "于 " + DateTime.Now + " 51book平台供应已退票";
            //        OrderLog.OperateId = "adminys";
            //        OrderLog.OperateName = "管理员";
            //        OrderLog.OperateCorporationId = 1;
            //        OrderLog.A1 = 1;
            //        int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //        #endregion
            //        OrderMan.UpdateTb_Ticket_Order(Order);
            //    }
            //}
            //else//平台退废票失败
            //{
            //    OnErrorNew("平台退废票失败" + Order.OrderId, false);
            //    Order.A40 = "4";
            //    #region 记录日志
            //    PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //    PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //    OrderLog.PNR = Order.PNR;
            //    OrderLog.OrderId = Order.OrderId;
            //    if (Order.OrderType == 3)
            //    {
            //        OrderLog.OperateType = 14;
            //    }
            //    else if (Order.OrderType == 4)
            //    {
            //        OrderLog.OperateType = 17;
            //    }
            //    OrderLog.OperateTime = DateTime.Now;
            //    OrderLog.Content = "于 " + DateTime.Now + " 51book平台供应已拒绝退废票,请联系平台手动处理 拒绝原因:" + Request.QueryString["venderRemark"].ToString();
            //    OrderLog.OperateId = "adminys";
            //    OrderLog.OperateName = "管理员";
            //    OrderLog.OperateCorporationId = 1;
            //    OrderLog.A1 = 1;
            //    int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //    #endregion
            //    OrderMan.UpdateTb_Ticket_Order(Order);
            //}
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //string result = "<?xml version=\"1.0\" encoding=\"gb2312\" ?><orderinfo><pnr>HF5N1R</pnr><code>1</code><message /><orderno></orderno><orderstatus>1</orderstatus><paystatus>1</paystatus><pnrsrcid>0101912051714341204</pnrsrcid ><payprice>543.6</ payprice><tradeno>2012051773929436</tradeno><tickets><ticket><passenger>张平</passenger><tktno>876-2037972475</tktno></ticket></tickets></orderinfo>";
        //System.Threading.Thread.Sleep(50000);
        OnErrorNew("进入 Pay_AutoPayByAlipayNotifyUrl_Load()", true);

        try
        {
            if (Request.Form["ticketnoinfo"] != null && Request.Form["ticketnoinfo"].ToString() != "")
            {
                string ticketnoinfo = Request.Form["ticketnoinfo"].ToString();
                ticketnoinfo = HttpUtility.UrlDecode(ticketnoinfo, Encoding.GetEncoding("gb2312"));

                OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(ticketnoinfo);
                DataSet      ds  = new DataSet();
                StringReader rea = new StringReader(doc.InnerXml);

                XmlTextReader xmlReader = new XmlTextReader(rea);

                ds.ReadXml(xmlReader);
                PbProject.Model.Tb_Ticket_Order Order = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(ds.Tables[0].Rows[0]["pnrsrcid"].ToString());
                //Login(Order);
                if (ticketnoinfo.IndexOf("支付成功后,取票号失败,请您手工操作") > -1)
                {
                    #region 记录操作日志
                    //添加操作订单的内容
                    PbProject.Model.Log_Tb_AirOrder OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                    OrderLog.id          = Guid.NewGuid();
                    OrderLog.OrderId     = Order.OrderId;
                    OrderLog.OperType    = "修改";
                    OrderLog.OperTime    = DateTime.Now;
                    OrderLog.OperContent = "于 " + DateTime.Now + " 航空公司已出票,自动取票号失败,请您手工出票!";
                    OrderLog.WatchType   = 2;
                    string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                    #endregion
                    OnErrorNew("支付成功后,取票号失败,请您手工操作!", false);
                    return;
                }
                if (Order.OrderStatusCode == 4)
                {
                    OnErrorNew("该票号已经出票", false);
                    return;
                }

                int tcount = 0;
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    PbProject.Logic.Order.Tb_Ticket_PassengerBLL psb     = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                    List <PbProject.Model.Tb_Ticket_Passenger>   psmList = psb.GetPasListByOrderID(ds.Tables[0].Rows[0]["pnrsrcid"].ToString());
                    OnErrorNew("开始修改票号", false);
                    for (int i = 0; i < psmList.Count; i++)
                    {
                        for (int j = 0; j < ds.Tables[2].Rows.Count; j++)
                        {
                            if (ds.Tables[2].Rows[j]["tktno"].ToString() != "")
                            {
                                if (psmList[i].PassengerName.ToUpper() == ds.Tables[2].Rows[j]["passenger"].ToString().ToUpper() || psmList[i].PassengerName.ToUpper() == HttpUtility.UrlDecode(ds.Tables[2].Rows[j]["passenger"].ToString().ToUpper(), Encoding.Default) || psmList[i].PassengerName.ToUpper() == HttpUtility.UrlDecode(ds.Tables[2].Rows[j]["passenger"].ToString().ToUpper()))
                                {
                                    psmList[i].TicketStatus = 2;
                                    psmList[i].TicketNumber = ds.Tables[2].Rows[j]["tktno"].ToString().Trim();
                                    tcount++;
                                }
                            }
                        }
                    }

                    if (tcount != psmList.Count)
                    {
                        #region 记录操作日志
                        //添加操作订单的内容
                        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                        PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                        OrderLog.id          = Guid.NewGuid();
                        OrderLog.OrderId     = Order.OrderId;
                        OrderLog.OperType    = "修改";
                        OrderLog.OperTime    = DateTime.Now;
                        OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                        OrderLog.WatchType   = 2;
                        string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                        sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                        #endregion
                    }

                    decimal payprice = 0;

                    try
                    {
                        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 &&
                            !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["payprice"].ToString()) &&
                            !ds.Tables[0].Rows[0]["payprice"].ToString().Contains("-"))
                        {
                            payprice = payprice = Convert.ToDecimal(ds.Tables[0].Rows[0]["payprice"].ToString());
                        }
                    }
                    catch (Exception)
                    {
                    }

                    if (payprice != 0)
                    {
                        Order.AirPoint = 1 - (payprice - Order.ABFee - Order.FuelFee) / Order.PMFee;
                        Order.AirPoint = Math.Round(Order.AirPoint, 3);
                    }
                    //是否更改订单状态
                    //默认更改状态
                    bool IsUpdateOrderStatus = true;
                    try
                    {
                        foreach (PbProject.Model.Tb_Ticket_Passenger item in psmList)
                        {
                            //婴儿没有回帖票号 不修改状态
                            if (item.PassengerType == 3 && string.IsNullOrEmpty(item.TicketNumber.Trim()))
                            {
                                IsUpdateOrderStatus = false;
                                break;
                            }
                        }
                        if ((IsUpdateOrderStatus) && (tcount == psmList.Count))
                        {
                            Order.OrderStatusCode = 4;
                        }
                    }
                    catch (Exception)
                    {
                    }
                    List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                   CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + Order.CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                    List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                  CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + Order.CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;

                    bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(Order, psmList, mUser[0], mCompany[0], (IsUpdateOrderStatus ? "B2B自动出票" : "B2B自动出票【婴儿票请手动处理】"));
                    if (reuslt)
                    {
                        //零时改回状态
                        BaseDataManage manage = new BaseDataManage();
                        manage.ExecuteNonQuerySQLInfo("update Tb_Ticket_Order set OrderStatusCode=" + Order.OrderStatusCode + " where OrderId='" + Order.OrderId + "'");

                        #region  票宝开放服务接口异步通知出票

                        if (Order.OrderSourceType == 5)
                        {
                            PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                            if (pbInterfaceCmd != null)
                            {
                                bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(Order);
                            }
                        }
                        #endregion
                        OnErrorNew(string.Format("出票成功.订单号:{0},PNR:{1}", Order.OrderId, Order.PNR), false);
                    }
                    else
                    {
                        OnErrorNew(string.Format("出票失败.订单号:{0},PNR:{1}", Order.OrderId, Order.PNR), false);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            #region 记录数据日志
            try
            {
                OnErrorNew("报错:" + ex.Message, false);
            }
            catch { }
            #endregion
        }
    }
Пример #17
0
    private void GetData()
    {
        string ticketnoinfo = "";

        for (int i = 0; i < Request.Form.Count; i++)
        {
            ticketnoinfo = ticketnoinfo + Request.Form.Keys[i].ToString() + ":" + Request.Form[i].ToString() + "|";
        }
        ticketnoinfo = HttpUtility.UrlDecode(ticketnoinfo, Encoding.GetEncoding("gb2312"));
        OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);
        if (GetValue("ticket_no").ToString().Trim() != "")
        {
            OnErrorNew("进入 Request.Form['status'].ToString().Trim() != ''", false);
            if (GetValue("status").ToString().Trim() == "T" && GetValue("service").ToString().Trim() == "order_issue_notify")//出票完成
            {
                bool reuslt = false;
                OnErrorNew("进入出票 Request.Form['status'].ToString().Trim() == 'T'", false);
                StringBuilder sb = new StringBuilder();
                PbProject.Model.Tb_Ticket_Order OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(GetValue("order_no").ToString());
                //Login(OrderUpdateList);
                if (OrderUpdateList.OrderStatusCode == 3)
                {
                    int tcount = 0;
                    //OrderUpdateList.OrderStatusCode = 4; //出票状态

                    PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                    List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList.OrderId);
                    for (int j = 0; j < PassengerList.Count; j++)
                    {
                        string   sss  = HttpUtility.UrlDecode(GetValue("passenger").ToString(), Encoding.GetEncoding("gb2312"));
                        string[] Name = sss.Split('^');
                        for (int i = 0; i < Name.Length; i++)
                        {
                            if (PassengerList[j].PassengerName.Trim().Replace("CHD", "").Trim().Replace(" ", "") == Name[i].Replace("CHD", "").Trim().Replace(" ", ""))
                            {
                                PassengerList[j].TicketNumber = GetValue("ticket_no").ToString().Split('^')[i].ToString();
                                tcount++;
                            }
                        }
                    }

                    if (tcount == PassengerList.Count)
                    {
                        OrderUpdateList.OrderStatusCode = 4; //出票状态
                    }
                    else
                    {
                        #region 记录操作日志
                        //添加操作订单的内容
                        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                        PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                        OrderLog.id          = Guid.NewGuid();
                        OrderLog.OrderId     = OrderUpdateList.OrderId;
                        OrderLog.OperType    = "修改";
                        OrderLog.OperTime    = DateTime.Now;
                        OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                        OrderLog.WatchType   = 2;
                        string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                        sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                        #endregion
                    }

                    List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                   CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList.CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                    List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                  CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList.CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
                    reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList, PassengerList, mUser[0], mCompany[0], "");
                    if (reuslt)
                    {
                        sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList.OrderId + "信息,更新成功!\r\n");
                        #region  票宝开放服务接口异步通知出票

                        if (OrderUpdateList.OrderSourceType == 5)
                        {
                            PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                            if (pbInterfaceCmd != null)
                            {
                                bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList);
                            }
                        }
                        #endregion
                    }
                    else
                    {
                        sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList.OrderId + "信息,更新失败!\r\n");
                    }
                    OnErrorNew("今日记录:" + sb.ToString(), false);
                }
            }
            else if (GetValue("status").ToString().Trim() == "1" && GetValue("service").ToString().Trim() == "order_refund_notify")
            {
                PbProject.Model.Tb_Ticket_Order Order = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(GetValue("order_no").ToString());
                OnErrorNew("今日退废票成功" + Order.OrderId, false);
                //Order.A40 = "3";
                //#region 记录日志
                //PbProject.Model.Log_Tb_AirOrder OrderLog = new PbProject.Model.Log_Tb_AirOrder();
                //PbProject.Logic.Log.Log_ErrorBLL OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
                //OrderLog.PNR = Order.PNR;
                //OrderLog.OrderId = Order.OrderId;
                //if (Order.OrderType == 3)
                //{
                //    OrderLog.OperateType = 14;
                //}
                //else if (Order.OrderType == 4)
                //{
                //    OrderLog.OperateType = 17;
                //}
                //OrderLog.OperateTime = DateTime.Now;
                //OrderLog.Content = "于 " + DateTime.Now + " 今日平台供应已退票";
                //OrderLog.OperateId = "adminys";
                //OrderLog.OperateName = "管理员";
                //OrderLog.OperateCorporationId = 1;
                //OrderLog.A1 = 1;
                //int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
                //#endregion
                //OrderMan.UpdateTb_Ticket_Order(Order);
            }
            else if (GetValue("status").ToString().Trim() == "2" && GetValue("service").ToString().Trim() == "order_refund_notify")
            {
                //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
                //PiaoBao.Models.Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(GetValue("order_no").ToString())[0];
                //OnErrorNew("今日退废票失败" + Order.OrderId, false);
                //Order.A40 = "4";
                //#region 记录日志
                //PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
                //PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
                //OrderLog.PNR = Order.PNR;
                //OrderLog.OrderId = Order.OrderId;
                //if (Order.OrderType == 3)
                //{
                //    OrderLog.OperateType = 14;
                //}
                //else if (Order.OrderType == 4)
                //{
                //    OrderLog.OperateType = 17;
                //}
                //OrderLog.OperateTime = DateTime.Now;
                //OrderLog.Content = "于 " + DateTime.Now + " 今日平台供应已拒绝退废票,请联系平台手动处理 拒绝原因:" + GetValue("remark").ToString();
                //OrderLog.OperateId = "adminys";
                //OrderLog.OperateName = "管理员";
                //OrderLog.OperateCorporationId = 1;
                //OrderLog.A1 = 1;
                //int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
                //#endregion
                //OrderMan.UpdateTb_Ticket_Order(Order);
            }
        }
    }