Пример #1
0
        public void OnCreateOrder()
        {
            //if (_QXValue.Contains("|62|"))//控制是否自动生成订单
            //{

            List <PbProject.Model.Tb_Ticket_SkyWay> skyList = new PbProject.Logic.Order.Tb_Ticket_SkyWayBLL().GetSkyWayListBySQLWhere("OrderId='" + _order.OrderId + "'");

            PnrAnalysis.FormatPNR ss = new PnrAnalysis.FormatPNR();
            string RTContent         = skyList[0].NewPnrContent.Replace("\r", "").Replace("\t", "").Replace("\n", "");
            string PATContent        = ss.RemoveHideChar(skyList[0].Pat).Replace("\r", "").Replace("\t", "").Replace("\n", "");

            #region 处理高低开
            if (!_order.Space.Contains("1"))    //不为子舱位
            {
                string bb = "";
                PnrAnalysis.PatModel sss = ss.GetPATInfo(skyList[0].NewPnrContent, out bb);
                if (sss.ChildPat != null)
                {
                    for (int i = 0; i < sss.PatList.Count; i++)
                    {
                        if (sss.PatList[i].SeatGroup == sss.ChildPat.SeatGroup)
                        {
                            sss.PatList.Remove(sss.PatList[i]);
                            break;
                        }
                    }
                    PatInfo patFirst = sss.PatList[0];
                    PatInfo patLast  = sss.PatList[sss.PatList.Count - 1];
                    //if (_QXValue.Contains("|60|"))
                    //{
                    PATContent = ss.NewPatData(patFirst);
                    //}
                    //else
                    //{
                    //    PATContent = ss.NewPatData(patLast);
                    //}
                    bool IsOnePrice = false;
                    RTContent = ss.RemoveChildSeat(RTContent, out IsOnePrice);
                }
            }
            #endregion


            //OnErrorNew(1, "517开始生成订单", "517生成订单");
            DataSet dsReson;
            if (_order.PolicyId.Split('~')[1].ToString() != "")    //判断有无子政策ID
            {
                dsReson = _517Service.CreateOrderByPnrAndPAT(_517Accout, _517Password, _517Ag, RTContent, _order.BigCode, Convert.ToInt32(_order.PolicyId.Split('~')[0].ToString()), _order.LinkMan, _order.LinkManPhone, _order.PolicyId.Split('~')[1].ToString(), PATContent, _order.PNR);
            }
            else
            {
                dsReson = _517Service.CreateOrderByPnrAndPAT(_517Accout, _517Password, _517Ag, RTContent, _order.BigCode, Convert.ToInt32(_order.PolicyId.Split('~')[0].ToString()), _order.LinkMan, _order.LinkManPhone, "", PATContent, _order.PNR);
            }

            string mes517Create = "";

            for (int i = 0; i < dsReson.Tables[0].Rows.Count; i++)
            {
                for (int j = 0; j < dsReson.Tables[0].Columns.Count; j++)
                {
                    mes517Create = mes517Create + dsReson.Tables[0].Columns[i].ColumnName + ":" + dsReson.Tables[0].Rows[i][j].ToString() + "/";    //DataTable转化成String类型
                }
            }
            mes517Create = "table's name:" + dsReson.Tables[0].TableName + "/table's content:" + mes517Create;
            CreateLog(_order.OrderId, "预定", mes517Create, 1);
            if (dsReson.Tables[0].TableName == "error")    //生成订单失败,记录日志
            {
                CreateLog(_order.OrderId, "预定", mes517Create, 3);
                //OnErrorNew(1, "517生成订单失败", "517生成订单");
            }
            else
            {
                if (dsReson.Tables[0].Rows[0]["OrderId"].ToString() != "")
                {
                    //OnErrorNew(1, "517生成订单成功", "517生成订单");
                    CreateLog(_order.OrderId, "预定", "517生成订单成功!", 3);
                    if (dsReson.Tables[0].Rows[0]["TotlePirce"].ToString() == "")
                    {
                        dsReson.Tables[0].Rows[0]["TotlePirce"] = "0";
                    }
                    OnPay(Convert.ToDecimal(dsReson.Tables[0].Rows[0]["TotlePirce"].ToString()), dsReson.Tables[0].Rows[0]["OrderId"].ToString(), mes517Create);
                }
                else
                {
                    CreateLog(_order.OrderId, "预定", "517生成订单失败:" + mes517Create, 3);
                }
            }
            //}
        }
Пример #2
0
        public void OnCreateOrder()
        {
            //if (_QXValue.Contains("|62|"))//控制是否自动生成订单
            //{

            List <PbProject.Model.Tb_Ticket_SkyWay> skyList = new PbProject.Logic.Order.Tb_Ticket_SkyWayBLL().GetSkyWayListBySQLWhere("OrderId='" + _order.OrderId + "'");

            PnrAnalysis.FormatPNR ss = new PnrAnalysis.FormatPNR();
            string RTContent         = skyList[0].NewPnrContent.Replace("\r", "").Replace("\t", "").Replace("\n", "");
            string PATContent        = ss.RemoveHideChar(skyList[0].Pat).Replace("\r", "").Replace("\t", "").Replace("\n", "");

            #region 处理高低开
            if (!_order.Space.Contains("1"))//不为子舱位
            {
                string bb = "";
                PnrAnalysis.PatModel sss = ss.GetPATInfo(skyList[0].NewPnrContent, out bb);
                if (sss.ChildPat != null)
                {
                    for (int i = 0; i < sss.PatList.Count; i++)
                    {
                        if (sss.PatList[i].SeatGroup == sss.ChildPat.SeatGroup)
                        {
                            sss.PatList.Remove(sss.PatList[i]);
                            break;
                        }
                    }
                    PatInfo patFirst = sss.PatList[0];
                    PatInfo patLast  = sss.PatList[sss.PatList.Count - 1];
                    //if (_QXValue.Contains("|60|"))
                    //{
                    PATContent = ss.NewPatData(patFirst);
                    //}
                    //else
                    //{
                    //    PATContent = ss.NewPatData(patLast);
                    //}
                    bool IsOnePrice = false;
                    RTContent = ss.RemoveChildSeat(RTContent, out IsOnePrice);
                }
            }
            #endregion


            //OnErrorNew(1, "517开始生成订单", "517生成订单");
            DataSet dsReson;


            dsReson = _yeeXingService.ParsePnrBookContract(_yeeXingAccout, _yeeXingAccout2, _order.PNR, RTContent, PATContent, _order.PolicyId, _order.PMFee.ToString(), _order.OrderId, _order.PolicyPoint.ToString(), _order.ReturnMoney.ToString());

            string mesYeeXingCreate = "";

            for (int i = 0; i < dsReson.Tables[0].Rows.Count; i++)
            {
                for (int j = 0; j < dsReson.Tables[0].Columns.Count; j++)
                {
                    mesYeeXingCreate = mesYeeXingCreate + dsReson.Tables[0].Columns[i].ColumnName + ":" + dsReson.Tables[0].Rows[i][j].ToString() + "/";//DataTable转化成String类型
                }
            }
            mesYeeXingCreate = "table's name:" + dsReson.Tables[0].TableName + "/table's content:" + mesYeeXingCreate;
            CreateLog(_order.OrderId, "预定", mesYeeXingCreate, 1);
            if (dsReson.Tables[0].Rows[0]["is_success"].ToString() == "F")//生成订单失败,记录日志
            {
                CreateLog(_order.OrderId, "预定", mesYeeXingCreate, 3);
            }
            else
            {
                CreateLog(_order.OrderId, "预定", "易行生成订单成功!", 3);
                if (dsReson.Tables[0].Rows[0]["totalPrice"].ToString() == "")
                {
                    dsReson.Tables[0].Rows[0]["totalPrice"] = "0";
                }
                OnPay(Convert.ToDecimal(dsReson.Tables[0].Rows[0]["totalPrice"].ToString()), dsReson.Tables[0].Rows[0]["orderid"].ToString(), mesYeeXingCreate);
            }
            //}
        }