コード例 #1
0
    protected string display_route(string route)
    {
        string result = string.Empty;

        string[] array = route.Split('-');
        foreach (string s in array)
        {
            result += ReadXmlHelper.GetAirPortNameByCode(s) + "-";
        }

        return(result.TrimEnd('-'));
    }
コード例 #2
0
ファイル: searchTicket.aspx.cs プロジェクト: aidai99/feiying
    protected string printf_flights(AiFeiTicket aft, string type)
    {
        if (type.Equals("from"))
        {
            string str = "";

            if (aft.tripType.Equals("1"))
            {
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(aft.fromCityCode) + "</li><li class='lititle2'>起飞:" + convertDate(ajaxToTime, readTimeFromCookie(aft.fromCityCode, aft.toCityCode, aft.airlineCode, "toDt", ajaxToTime)) + "</li>";
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(aft.toCityCode) + "</li><li class='lititle2'>起飞:" + convertDate(ajaxFromTime, readTimeFromCookie(aft.toCityCode, aft.fromCityCode, aft.airlineCode, "toDt", ajaxFromTime)) + "</li>";
            }

            if (aft.tripType.Equals("0"))
            {
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(aft.fromCityCode) + "</li><li class='lititle2'>起飞:" + convertDate(ajaxToTime, readTimeFromCookie(aft.fromCityCode, aft.toCityCode, aft.airlineCode, "toDt", ajaxToTime)) + "</li>";
            }
            return(str);
        }
        else if (type.Equals("to"))
        {
            string str = "";

            if (aft.tripType.Equals("1"))
            {
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(aft.toCityCode) + "</li><li class='lititle2'>到达:" + convertDate(ajaxToTime, readTimeFromCookie(aft.fromCityCode, aft.toCityCode, aft.airlineCode, "arriveDt", ajaxToTime)) + "</li>";
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(aft.fromCityCode) + "</li><li class='lititle2'>到达:" + convertDate(ajaxFromTime, readTimeFromCookie(aft.toCityCode, aft.fromCityCode, aft.airlineCode, "arriveDt", ajaxFromTime)) + "</li>";
            }

            if (aft.tripType.Equals("0"))
            {
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(aft.toCityCode) + "</li><li class='lititle2'>到达:" + convertDate(ajaxToTime, readTimeFromCookie(aft.fromCityCode, aft.toCityCode, aft.airlineCode, "arriveDt", ajaxToTime)) + "</li>";
            }
            return(str);
        }
        else if (type.Equals("line"))
        {
            string str = "";

            if (aft.tripType.Equals("1"))
            {
                str += "<li class='lititle1'><img src='/images/sgo.gif'/>&rarr;</li><li class='lititle2'>&nbsp;</li>";
                str += "<li class='lititle1'><img src='/images/sback.gif'/>&rarr;</li><li class='lititle2'>&nbsp;</li>";
            }

            if (aft.tripType.Equals("0"))
            {
                str += "<li class='lititle1'><img src='/images/sgo.gif'/>&rarr;</li><li class='lititle2'>&nbsp;</li>";
            }
            return(str);
        }
        return("");
    }
コード例 #3
0
ファイル: AifeiRequest.aspx.cs プロジェクト: aidai99/feiying
    protected string printf_flights(FeiYingFlight toFlight, FeiYingFlight backFlight, string type, string ticketType)
    {
        if (type.Equals("from"))
        {
            string str = "";

            if (toFlight != null)
            {
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(from) + "</li><li class='lititle2'>起飞:" + convertDate(totime, toFlight.startTime) + "</li>";
            }

            if (backFlight != null)
            {
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(to) + "</li><li class='lititle2'>起飞:" + convertDate(fromtime, backFlight.startTime) + "</li>";
            }
            return(str);
        }
        else if (type.Equals("to"))
        {
            string str = "";

            if (toFlight != null)
            {
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(to) + "</li><li class='lititle2'>到达:" + convertDate(totime, toFlight.startTime, toFlight.arriveTime) + "</li>";
            }

            if (backFlight != null)
            {
                str += "<li class='lititle1'>" + ReadXmlHelper.GetAirPortNameByCode(from) + "</li><li class='lititle2'>到达:" + convertDate(fromtime, backFlight.startTime, backFlight.arriveTime) + "</li>";
            }
            return(str);
        }
        else if (type.Equals("line"))
        {
            string str = "";

            if (toFlight != null)
            {
                str += "<li class='lititle1'><img src='/images/sgo.gif'/>&rarr;</li><li class='lititle2'>&nbsp;</li>";
            }

            if (backFlight != null)
            {
                str += "<li class='lititle1'><img src='/images/sback.gif'/>&rarr;</li><li class='lititle2'>&nbsp;</li>";
            }
            return(str);
        }
        return("");
    }
コード例 #4
0
ファイル: contrast.aspx.cs プロジェクト: aidai99/feiying
    protected void Page_Load(object sender, EventArgs e)
    {
        string contrast_str = "";

        if (Request.Cookies["contrast_str"] == null)
        {
            Response.Cookies["contrast_str"].Value   = contrast_str;
            Response.Cookies["contrast_str"].Expires = DateTime.Now.AddDays(1);
        }
        else
        {
            contrast_str = Request.Cookies["contrast_str"].Value;
        }


        if (Request.QueryString["addId"] != null && Request.QueryString["addId"] != "")
        {
            string addId = Request.QueryString["addId"].ToString();
            if (contrast_str.IndexOf(addId + ",") == -1)
            {
                contrast_str = contrast_str + addId + ",";
                Response.Cookies["contrast_str"].Value   = contrast_str;
                Response.Cookies["contrast_str"].Expires = DateTime.Now.AddDays(1);
            }
        }

        if (Request.QueryString["delId"] != null && Request.QueryString["delId"] != "")
        {
            string delId = Request.QueryString["delId"].ToString();
            if (contrast_str.IndexOf(delId + ",") > -1)
            {
                contrast_str = contrast_str.Replace(delId + ",", "");
                Response.Cookies["contrast_str"].Value   = contrast_str;
                Response.Cookies["contrast_str"].Expires = DateTime.Now.AddDays(1);
            }
        }

        contrast_array = contrast_str.Split(",".ToCharArray());
        contrast_num   = contrast_array.Length - 1;
        DataRow        = new DataRow[contrast_num];
        for (int i = 0; i < contrast_num; i++)
        {
            string idString = contrast_array[i].ToString();
            if (idString.IndexOf("kabe") == -1)
            {
                int tid = Convert.ToInt32(contrast_array[i].ToString());
                DataRow[i] = GetTicketDetail(tid);
            }
            else
            {
                kabe_flight flight  = null;
                string[]    array   = idString.Split('_');
                ArrayList   tickets = (ArrayList)Session[string.Format("TicketsSessionKey_{0}_{1}_{2}_{3}_{4}", array[1], array[2], array[3], array[4], array[5])];
                if (tickets == null || tickets.Count == 0)
                {
                    Response.Redirect("/index.aspx");
                    return;
                }

                foreach (kabe_flight f in tickets)
                {
                    if (f.ticketId == array[6])
                    {
                        flight = f;
                    }
                }
                if (flight == null)
                {
                    Response.Redirect("/index.aspx");
                    return;
                }

                //查询机场信息
                string  logopic             = string.Empty;
                string  airchName           = string.Empty;
                string  planNum             = string.Empty;
                string  age                 = string.Empty;
                string  smallPic            = string.Empty;
                string  logoPic             = string.Empty;
                string  airId               = string.Empty;
                string  tairportdescription = string.Empty;
                string  airlineSql          = "select chName,planNum,age,aid,airlineCode,description,smallPic,logoPic from FY_Airline where airlineCode='" + flight.airline + "'";
                DataSet airlineDS           = SqlHelper.ExecuteDataset(SqlHelper.ConnString_select, CommandType.Text, airlineSql);
                if (airlineDS != null && airlineDS.Tables.Count > 0 && airlineDS.Tables[0].Rows.Count > 0)
                {
                    airchName           = airlineDS.Tables[0].Rows[0]["chName"].ToString();
                    airId               = airlineDS.Tables[0].Rows[0]["aid"].ToString();
                    smallPic            = airlineDS.Tables[0].Rows[0]["smallPic"].ToString();
                    logoPic             = airlineDS.Tables[0].Rows[0]["logoPic"].ToString();
                    tairportdescription = airlineDS.Tables[0].Rows[0]["description"].ToString();
                    planNum             = airlineDS.Tables[0].Rows[0]["planNum"].ToString();
                    age = airlineDS.Tables[0].Rows[0]["age"].ToString();
                }
                int    days = new Random().Next(-60, -5);
                string fromCityName = string.Empty, toCityName = string.Empty;

                //出发  到达  航司  查询转机信息
                DataTable dt = new DataTable();
                dt.Columns.Add("fromCity");
                dt.Columns.Add("toCity");
                dt.Columns.Add("fromCityname");
                dt.Columns.Add("fromCityCode");
                dt.Columns.Add("toCityname");
                dt.Columns.Add("toCityCode");
                dt.Columns.Add("addtime");
                dt.Columns.Add("untaxPrice");
                dt.Columns.Add("tripType");
                dt.Columns.Add("tId");
                dt.Columns.Add("fAirportCode");
                dt.Columns.Add("fromPort");
                dt.Columns.Add("tAirportName");
                dt.Columns.Add("logoPic");
                dt.Columns.Add("airname");
                dt.Columns.Add("planNum");
                dt.Columns.Add("age");
                dt.Columns.Add("smallPic");
                dt.Columns.Add("bagPrice");
                dt.Columns.Add("engerTicket");
                dt.Columns.Add("seatShip");
                dt.Columns.Add("shortstayDate");
                dt.Columns.Add("attPrice");
                dt.Columns.Add("longstayDate");
                dt.Columns.Add("childPrice");
                dt.Columns.Add("fromsaleDate");
                dt.Columns.Add("tosaleDate");
                dt.Columns.Add("fromtripDate");
                dt.Columns.Add("totripDate");
                dt.Columns.Add("returnMoney");
                dt.Columns.Add("updateProvision");
                dt.Columns.Add("limitProvision");
                dt.Columns.Add("fAirportName");
                dt.Columns.Add("tAirportCode");
                dt.Columns.Add("toPort");
                dt.Columns.Add("airId");
                dt.Columns.Add("score");
                dt.Columns.Add("zongping");
                dt.Columns.Add("xiai");
                dt.Columns.Add("xiaofei");
                dt.Columns.Add("manyi");
                dt.Columns.Add("fuwu");
                dt.Columns.Add("relayPort");
                dt.Columns.Add("returnTip");
                dt.Columns.Add("tairportdescription");
                dt.Columns.Add("startTime");
                dt.Columns.Add("arriveTime");
                dt.Rows.Add(getFromCityIdByCode(array[2], out fromCityName),
                            getToCityIdByCode(array[3], out toCityName),
                            fromCityName, array[2],
                            toCityName, array[3],
                            "2013-06-08",
                            flight.adultprice,
                            Convert.ToInt32(flight.ft) - 1,
                            "tId",
                            flight.depport,
                            ReadXmlHelper.GetAirPortNameByCode(flight.depport),
                            ReadXmlHelper.GetAirPortNameByCode(flight.arrport),
                            logoPic,
                            airchName,
                            planNum,
                            age,
                            smallPic,
                            string.Empty,                                                                                                                                                                                                                                                                             //bagPrice
                            "电子客票",                                                                                                                                                                                                                                                                                   //engerTicket
                            this.display_seat(flight.deproute.seat),
                            "30",                                                                                                                                                                                                                                                                                     //shortstayDate
                            string.Empty,                                                                                                                                                                                                                                                                             //attPrice
                            "180",                                                                                                                                                                                                                                                                                    //afti.longstayDate,
                            flight.childprice,
                            Convert.ToDateTime(flight.deproute.depdate).AddDays(days).ToString("yyyy-MM-dd"),                                                                                                                                                                                                         //convertDate(afti.fromsaleDate.Trim()),
                            flight.deproute.depdate,                                                                                                                                                                                                                                                                  //convertDate(afti.tosaleDate.Trim()),
                            flight.deproute.depdate,                                                                                                                                                                                                                                                                  //convertDate(afti.fromtripDate.Trim()),
                            flight.deproute.arrdate,                                                                                                                                                                                                                                                                  //convertDate(afti.totripDate.Trim()),
                            string.Empty,                                                                                                                                                                                                                                                                             //afti.returnMoney,
                            string.Empty,                                                                                                                                                                                                                                                                             //afti.updateProvision,
                            "<p>1.此票价为净价,不含任何费用<br />  2.票价如有更改,恕不另行通知<br />  3.不可签转,不可更改行程<br />  4.所有航段必须有确认的订座,不可开OPEN票. <br />  5.退票手续 :可退票,需缴纳手续费<br />  6.误机(NOSHOW) :需收取误机费<br />  7.更改订座 : 允许更改。乘客必须于出发日之前取消原订的航班,否则按照 '误机' 处理<br />  8.儿童票价 :成人票价的75% <br />  9.婴儿票价 :使用 IATA 公布成人票价的10%<br />  &nbsp;</p>", //afti.limitProvision,
                            ReadXmlHelper.GetAirPortNameByCode(flight.depport),                                                                                                                                                                                                                                       // afti.fromAirportName,
                            flight.arrport,                                                                                                                                                                                                                                                                           //afti.toAirportCode,
                            "toPort",
                            airId,
                            "100", //afti.score,
                            "3",   //afti.zongping,
                            "2",   //afti.xiai,
                            "4",   //afti.xiaofei,
                            "4",   //afti.manyi,
                            "4",   //afti.fuwu,
                            flight.deproute.route,
                            "returnTip",
                            tairportdescription,
                            flight.deproute.depdate + " " + flight.deproute.deptime.Insert(2, ":"),
                            flight.deproute.arrdate + " " + flight.deproute.arrtime.Insert(2, ":"));
                DataRow[i] = dt.Rows[0];
            }
        }
    }
コード例 #5
0
    /// <summary>
    /// 获取feiying网手工数据
    /// </summary>
    /// <returns></returns>
    private FlightRoundTrip GetFeiying580()
    {
        DataRow         dr    = null;
        DataSet         ds    = null;
        FlightRoundTrip rTrip = null;
        string          str   = "select FY_Ticket.*,FY_FromCity.chName as fromCityname,FY_Airline.airlineCode as airlineCode,FY_FromCity.cityCode as fromCityCode, FY_ToCity.chName as toCityname,FY_ToCity.cityCode as toCityCode, FY_Airline.chName as airname,FY_Airline.planNum as planNum,FY_Airline.age as age,FY_Airline.aId as airId ,FY_Airline.logoPic as logoPic,FY_Airline.smallPic as smallPic, fAirport.chName as fAirportName,fAirport.airPortCode as fAirportCode, tAirport.chName as tAirportName,tAirport.airPortCode as tAirportCode,tAirport.description as tairportdescription from FY_Ticket left join FY_FromCity on FY_FromCity.fId=FY_Ticket.fromCity left join FY_ToCity on FY_ToCity.tId=FY_Ticket.toCity left join FY_Airline on FY_Airline.aId=FY_Ticket.airLine  left join FY_Airport as  fAirport on fAirport.apId=FY_Ticket.fromPort left join FY_Airport as tAirport on tAirport.apId=FY_Ticket.toPort  where FY_Ticket.tId=" + DataGuid;

        try
        {
            ds = SqlHelper.ExecuteDataset(SqlHelper.ConnString_select, CommandType.Text, str);
            if (ds != null && ds.Tables[0].Rows.Count != 0)
            {
                dr = ds.Tables[0].Rows[0];

                rTrip = new FlightRoundTrip();
                List <FlightInfo>  listF  = new List <FlightInfo>();
                List <FlightInfo2> listF2 = new List <FlightInfo2>();
                if (Convert.ToInt32(TripType) == 0)
                {
                    #region 单程
                    List <FlightDetail> listDeteil = new List <FlightDetail>();
                    FlightInfo          finfo      = new FlightInfo();
                    finfo.Data        = Guid.NewGuid().ToString("N").ToUpper();
                    finfo.Source      = "feiying";
                    finfo.TicketPrice = decimal.Parse(dr["untaxPrice"].ToString());
                    finfo.XmlInfo     = dr["tid"].ToString();
                    finfo.Tid         = dr["tid"].ToString();

                    FlightDetail fdInfo = new FlightDetail();
                    fdInfo.AirCompanyCode = dr["airlineCode"].ToString();
                    fdInfo.StartCityCode  = dr["fromCityCode"].ToString();
                    fdInfo.StartCityName  = ReadXmlHelper.GetAirPortNameByCode(dr["fromCityCode"].ToString());
                    fdInfo.BeginCityName  = dr["fromCityname"].ToString();

                    //如果有中转,则到达城市、机场等替换为中转地
                    if (string.IsNullOrEmpty(dr["relayPort"].ToString()))
                    {
                        fdInfo.EndCityCode = dr["toCityCode"].ToString();
                        fdInfo.EndCityName = ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                        fdInfo.ToCityName  = dr["toCityname"].ToString();
                    }
                    else
                    {
                        string[] array = dr["relayPort"].ToString().Split('-');
                        fdInfo.EndCityCode = array[0];
                        fdInfo.EndCityName = ReadXmlHelper.GetAirPortNameByCode(array[0]);
                        long a = 0;//纯粹接收参数
                        fdInfo.ToCityName = ReadXmlHelper.GetToCityNameByCode(array[0], out a);
                    }

                    fdInfo.FromTime   = DateTime.Parse(ReadTime(this.TripDate, 0));
                    fdInfo.ArriveTime = ReadTime(fdInfo.FromTime);
                    listDeteil.Add(fdInfo);
                    //如果有中转
                    if (!string.IsNullOrEmpty(dr["relayPort"].ToString()))
                    {
                        FlightDetail fdInfo2 = new FlightDetail();
                        fdInfo2.AirCompanyCode = string.Empty;       //dr["airlineCode"].ToString();
                        fdInfo2.StartCityCode  = fdInfo.EndCityCode; //dr["fromCityCode"].ToString();
                        fdInfo2.EndCityCode    = dr["toCityCode"].ToString();
                        fdInfo2.StartCityName  = ReadXmlHelper.GetAirPortNameByCode(fdInfo.EndCityCode);
                        fdInfo2.EndCityName    = ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                        fdInfo2.BeginCityName  = fdInfo.ToCityName;//dr["fromCityname"].ToString();
                        fdInfo2.ToCityName     = dr["toCityname"].ToString();
                        fdInfo2.FromTime       = ReadTime(fdInfo.ArriveTime);
                        fdInfo2.ArriveTime     = ReadTime(fdInfo2.FromTime);
                        listDeteil.Add(fdInfo2);
                    }
                    finfo.ListInterFlightDetails = listDeteil;
                    listF.Add(finfo);
                    #endregion
                }
                else
                {
                    #region 去程
                    List <FlightDetail> listDeteil = new List <FlightDetail>();
                    FlightInfo          finfo      = new FlightInfo();
                    finfo.Data        = Guid.NewGuid().ToString("N").ToUpper();
                    finfo.Source      = "feiying";
                    finfo.TicketPrice = decimal.Parse(dr["untaxPrice"].ToString());
                    finfo.XmlInfo     = dr["tid"].ToString();
                    finfo.Tid         = dr["tid"].ToString();

                    FlightDetail fdInfo = new FlightDetail();
                    fdInfo.AirCompanyCode = dr["airlineCode"].ToString();
                    fdInfo.StartCityCode  = dr["fromCityCode"].ToString();
                    fdInfo.StartCityName  = ReadXmlHelper.GetAirPortNameByCode(dr["fromCityCode"].ToString());
                    fdInfo.BeginCityName  = dr["fromCityname"].ToString();

                    //如果有中转,则到达城市、机场等替换为中转地
                    if (string.IsNullOrEmpty(dr["relayPort"].ToString()))
                    {
                        fdInfo.EndCityCode = dr["toCityCode"].ToString();
                        fdInfo.EndCityName = ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                        fdInfo.ToCityName  = dr["toCityname"].ToString();
                    }
                    else
                    {
                        string[] array = dr["relayPort"].ToString().Split('-');
                        fdInfo.EndCityCode = array[0];
                        fdInfo.EndCityName = ReadXmlHelper.GetAirPortNameByCode(array[0]);
                        long a = 0;//纯粹接收参数
                        fdInfo.ToCityName = ReadXmlHelper.GetToCityNameByCode(array[0], out a);
                    }

                    fdInfo.FromTime   = DateTime.Parse(ReadTime(this.TripDate, 0));
                    fdInfo.ArriveTime = ReadTime(fdInfo.FromTime);
                    listDeteil.Add(fdInfo);
                    //如果有中转
                    if (!string.IsNullOrEmpty(dr["relayPort"].ToString()))
                    {
                        FlightDetail fdInfo2 = new FlightDetail();
                        fdInfo2.AirCompanyCode = string.Empty;       //dr["airlineCode"].ToString();
                        fdInfo2.StartCityCode  = fdInfo.EndCityCode; //dr["fromCityCode"].ToString();
                        fdInfo2.EndCityCode    = dr["toCityCode"].ToString();
                        fdInfo2.StartCityName  = ReadXmlHelper.GetAirPortNameByCode(fdInfo.EndCityCode);
                        fdInfo2.EndCityName    = ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                        fdInfo2.BeginCityName  = fdInfo.ToCityName;//dr["fromCityname"].ToString();
                        fdInfo2.ToCityName     = dr["toCityname"].ToString();
                        fdInfo2.FromTime       = ReadTime(fdInfo.ArriveTime);
                        fdInfo2.ArriveTime     = ReadTime(fdInfo2.FromTime);
                        listDeteil.Add(fdInfo2);
                    }
                    finfo.ListInterFlightDetails = listDeteil;
                    listF.Add(finfo);
                    #endregion

                    #region 返程
                    List <FlightDetail> listDeteil2 = new List <FlightDetail>();
                    FlightInfo2         finfo2      = new FlightInfo2();
                    finfo2.Source      = "feiying";
                    finfo2.TicketPrice = decimal.Parse(dr["untaxPrice"].ToString());

                    FlightDetail fdbkInfo = new FlightDetail();
                    fdbkInfo.AirCompanyCode = dr["airlineCode"].ToString();
                    fdbkInfo.StartCityCode  = dr["toCityCode"].ToString();
                    fdbkInfo.StartCityName  = fdInfo.EndCityName;//使用去程的到达机场作为返回的出发机场 //ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                    fdbkInfo.BeginCityName  = dr["toCityname"].ToString();

                    //如果有中转,则到达城市、机场等替换为中转地
                    if (string.IsNullOrEmpty(dr["relayPort"].ToString()))
                    {
                        fdbkInfo.EndCityCode = dr["fromCityCode"].ToString();
                        fdbkInfo.EndCityName = fdInfo.StartCityName;//使用去程的出发机场作为返回的到达机场 //ReadXmlHelper.GetAirPortNameByCode(dr["fromCityCode"].ToString());
                        fdbkInfo.ToCityName  = dr["fromCityname"].ToString();
                    }
                    else
                    {
                        string[] array = dr["relayPort"].ToString().Split('-');
                        fdbkInfo.EndCityCode = array[0];
                        fdbkInfo.EndCityName = fdInfo.EndCityName;
                        long a = 0;                              //纯粹接收参数
                        fdbkInfo.ToCityName = fdInfo.ToCityName; //ReadXmlHelper.GetToCityNameByCode(array[0], out a);
                    }

                    fdbkInfo.FromTime   = DateTime.Parse(ReadTime(this.BackDate, 0));
                    fdbkInfo.ArriveTime = ReadTime(fdbkInfo.FromTime);
                    listDeteil2.Add(fdbkInfo);
                    //如果有中转
                    if (!string.IsNullOrEmpty(dr["relayPort"].ToString()))
                    {
                        FlightDetail fdbkInfo2 = new FlightDetail();
                        fdbkInfo2.AirCompanyCode = string.Empty;         //dr["airlineCode"].ToString();
                        fdbkInfo2.StartCityCode  = fdbkInfo.EndCityCode; //dr["fromCityCode"].ToString();
                        fdbkInfo2.EndCityCode    = dr["fromCityCode"].ToString();
                        fdbkInfo2.StartCityName  = fdbkInfo.EndCityName; //使用第一次中转的到达机场作为第二次中转的出发机场 //ReadXmlHelper.GetAirPortNameByCode(fdbkInfo.EndCityCode);
                        fdbkInfo2.EndCityName    = fdInfo.StartCityName; //使用去程的出发机场作为返回的到达机场 //ReadXmlHelper.GetAirPortNameByCode(dr["fromCityCode"].ToString());
                        fdbkInfo2.BeginCityName  = fdInfo.ToCityName;    //使用去程的到达城市作为返回的出发城市 //dr["fromCityname"].ToString();
                        fdbkInfo2.ToCityName     = dr["fromCityname"].ToString();
                        fdbkInfo2.FromTime       = ReadTime(fdbkInfo.ArriveTime);
                        fdbkInfo2.ArriveTime     = ReadTime(fdbkInfo2.FromTime);
                        listDeteil2.Add(fdbkInfo2);
                    }
                    finfo2.ListInterFlightDetails = listDeteil2;
                    listF2.Add(finfo2);
                    #endregion
                }
                rTrip.ListInterFlightInfo  = listF;
                rTrip.ListInterFlightInfo2 = listF2;
            }
            return(rTrip);
        }
        catch (Exception)
        {
            return(null);
        }
    }
コード例 #6
0
    protected void GetAiFeiTickets()
    {
        //获得页面参数
        string dpt    = "";
        string arr    = "";
        string toTime = "";
        string reTime = "";
        string cate   = "";

        //出发城市
        if (fromCity.SelectedValue != "" && fromCity.SelectedValue != "0")
        {
            //获得出发城市三字码
            string  cityCodeSql = "select cityCode from FY_FromCity where fId='" + fromCity.SelectedValue + "'";
            DataSet dsCityCode  = SqlHelper.ExecuteDataset(SqlHelper.ConnString_select, CommandType.Text, cityCodeSql);
            if (dsCityCode != null)
            {
                dpt = dsCityCode.Tables[0].Rows[0]["cityCode"].ToString();
            }
        }
        else
        {
            return;
        }

        //目的城市
        if (txtSearch_tocity.Value.Trim() != "")
        {
            //获得目的城市三字码
            arr = txtSearch_tocity.Value.Trim().Substring(0, 3);
        }
        else
        {
            return;
        }

        //获得出发时间
        if (fromtripDate_more.Value.Trim() != "")
        {
            toTime = fromtripDate_more.Value.Trim().Replace("-", "");
        }
        else
        {
            return;
        }

        //获得到达时间
        if (totripDate_more.Value.Trim() != "")
        {
            reTime = totripDate_more.Value.Trim().Replace("-", "");
        }
        else
        {
            return;
        }

        //获得客票类型
        if (cateSelect.Value.Trim() != "")
        {
            cate = cateSelect.Value.Trim();
        }
        else
        {
            return;
        }



        //请求客票
        AiFeiService aifeiService = new AiFeiService();

        ArrayList data    = aifeiService.GlobalTicket(dpt, arr, toTime, reTime, cate);
        ArrayList tickets = new ArrayList();

        //排序爱飞机票
        foreach (AiFeiTicketEntity orderTicket in data)
        {
            //过滤日期
            DateTime dt = Convert.ToDateTime(orderTicket.totripDate.Substring(0, 4) + "-" + orderTicket.totripDate.Substring(4, 2) + "-" + orderTicket.totripDate.Substring(6, 2));
            if ((dt - DateTime.Now).Days < 0)
            {
                continue;
            }

            //获取中转
            FeiYingFlight toFlight = aifeiService.getFlightMsg2(orderTicket.fromCity, orderTicket.toCity, orderTicket.airlineCode, "");
            if (toFlight != null)
            {
                if (string.IsNullOrEmpty(toFlight.relayPort))
                {
                    orderTicket.relayPort = "直飞";
                }
                else
                {
                    orderTicket.relayPort = ReadXmlHelper.GetAirPortNameByCode(toFlight.relayPort);
                }
            }
            if (tickets.Count == 0)
            {
                tickets.Add(orderTicket);
            }
            else
            {
                for (int i = 0; i < tickets.Count; i++)
                {
                    AiFeiTicketEntity aft = (AiFeiTicketEntity)tickets[i];

                    if (tickets.Count <= i + 1)
                    {
                        tickets.Add(orderTicket);
                        break;
                    }
                    else
                    {
                        AiFeiTicketEntity next = (AiFeiTicketEntity)tickets[i + 1];
                        if (Convert.ToDecimal(orderTicket.ticketPrice) > Convert.ToDecimal(aft.ticketPrice) && Convert.ToDecimal(orderTicket.ticketPrice) <= Convert.ToDecimal(next.ticketPrice))
                        {
                            tickets.Insert(i + 1, orderTicket);
                            break;
                        }
                    }
                }
            }
        }

        this.GetData           = tickets;
        rptshopnews.DataSource = tickets;
        rptshopnews.DataBind();
    }
コード例 #7
0
ファイル: showTicket.aspx.cs プロジェクト: aidai99/feiying
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["tId"] != null)
        {
            string tId = Request.QueryString["tId"];
            if (tId.IndexOf("kabe") == -1)
            {
                id        = Convert.ToInt32(Request.QueryString["tId"].ToString());
                ticketOne = GetTicketDetail(id);
            }
            else
            {
                string[]  array   = tId.Split('_');
                ArrayList tickets = (ArrayList)Session[string.Format("TicketsSessionKey_{0}_{1}_{2}_{3}_{4}", array[1], array[2], array[3], array[4], array[5])];
                if (tickets == null || tickets.Count == 0)
                {
                    //scripthelp.AlertAndRedirect("记录超时,请重新查询票价信息!", "/index.aspx", this);
                    Response.Redirect("/index.aspx");
                    return;
                }


                foreach (kabe_flight f in tickets)
                {
                    if (f.ticketId == array[6])
                    {
                        flight = f;
                    }
                }
                if (flight == null)
                {
                    //scripthelp.AlertAndRedirect("获取票价信息时报,请重新查询票价信息!", "/index.aspx", this);
                    Response.Redirect("/index.aspx");
                    return;
                }

                //出发  到达  航司  查询转机信息
                DataTable dt = new DataTable();
                dt.Columns.Add("fromCity");
                dt.Columns.Add("toCity");
                dt.Columns.Add("fromCityname");
                dt.Columns.Add("fromCityCode");
                dt.Columns.Add("toCityname");
                dt.Columns.Add("toCityCode");
                dt.Columns.Add("addtime");
                dt.Columns.Add("untaxPrice");
                dt.Columns.Add("tripType");
                dt.Columns.Add("tId");
                dt.Columns.Add("fAirportCode");
                dt.Columns.Add("fromPort");
                dt.Columns.Add("tAirportName");
                dt.Columns.Add("logoPic");
                dt.Columns.Add("airname");
                dt.Columns.Add("planNum");
                dt.Columns.Add("age");
                dt.Columns.Add("smallPic");
                dt.Columns.Add("bagPrice");
                dt.Columns.Add("engerTicket");
                dt.Columns.Add("seatShip");
                dt.Columns.Add("shortstayDate");
                dt.Columns.Add("attPrice");
                dt.Columns.Add("longstayDate");
                dt.Columns.Add("childPrice");
                dt.Columns.Add("fromsaleDate");
                dt.Columns.Add("tosaleDate");
                dt.Columns.Add("fromtripDate");
                dt.Columns.Add("totripDate");
                dt.Columns.Add("returnMoney");
                dt.Columns.Add("updateProvision");
                dt.Columns.Add("limitProvision");
                dt.Columns.Add("fAirportName");
                dt.Columns.Add("tAirportCode");
                dt.Columns.Add("toPort");
                dt.Columns.Add("airId");
                dt.Columns.Add("score");
                dt.Columns.Add("zongping");
                dt.Columns.Add("xiai");
                dt.Columns.Add("xiaofei");
                dt.Columns.Add("manyi");
                dt.Columns.Add("fuwu");
                dt.Columns.Add("relayPort");
                dt.Columns.Add("returnTip");
                dt.Columns.Add("tairportdescription");
                dt.Columns.Add("startTime");
                dt.Columns.Add("arriveTime");
                this.pan_aifeitime.Visible = true;

                //查询机场信息
                string  logopic             = string.Empty;
                string  airchName           = string.Empty;
                string  planNum             = string.Empty;
                string  age                 = string.Empty;
                string  smallPic            = string.Empty;
                string  logoPic             = string.Empty;
                string  airId               = string.Empty;
                string  tairportdescription = string.Empty;
                string  airlineSql          = "select chName,planNum,age,aid,airlineCode,description,smallPic,logoPic from FY_Airline where airlineCode='" + flight.airline + "'";
                DataSet airlineDS           = SqlHelper.ExecuteDataset(SqlHelper.ConnString_select, CommandType.Text, airlineSql);
                if (airlineDS != null && airlineDS.Tables.Count > 0 && airlineDS.Tables[0].Rows.Count > 0)
                {
                    airchName           = airlineDS.Tables[0].Rows[0]["chName"].ToString();
                    airId               = airlineDS.Tables[0].Rows[0]["aid"].ToString();
                    smallPic            = airlineDS.Tables[0].Rows[0]["smallPic"].ToString();
                    logoPic             = airlineDS.Tables[0].Rows[0]["logoPic"].ToString();
                    tairportdescription = airlineDS.Tables[0].Rows[0]["description"].ToString();
                    planNum             = airlineDS.Tables[0].Rows[0]["planNum"].ToString();
                    age = airlineDS.Tables[0].Rows[0]["age"].ToString();
                }
                int days = new Random().Next(-60, -5);
                this.flight_fplan = this.display_plan(flight.segment, flight.deproute.route);
                if (flight.ft == "2")
                {
                    this.flight_tplan = this.display_plan(flight.segment, flight.arrroute.route);
                }

                dt.Rows.Add(getFromCityIdByCode(array[2]),
                            getToCityIdByCode(array[3]),
                            this.fromCityName, array[2],
                            this.toCityName, array[3],
                            "2013-06-08",
                            flight.adultprice,
                            Convert.ToInt32(flight.ft) - 1,
                            tId,
                            flight.depport,
                            ReadXmlHelper.GetAirPortIDByCode(flight.depport),
                            ReadXmlHelper.GetAirPortNameByCode(flight.arrport),
                            logoPic,
                            airchName,
                            planNum,
                            age,
                            smallPic,
                            string.Empty,                                                                                                                                                                                                                                                                             //bagPrice
                            "电子客票",                                                                                                                                                                                                                                                                                   //engerTicket
                            this.display_seat(flight.deproute.seat),
                            "30",                                                                                                                                                                                                                                                                                     //shortstayDate
                            string.Empty,                                                                                                                                                                                                                                                                             //attPrice
                            "180",                                                                                                                                                                                                                                                                                    //afti.longstayDate,
                            flight.childprice,
                            Convert.ToDateTime(flight.deproute.depdate).AddDays(days).ToString("yyyy-MM-dd"),                                                                                                                                                                                                         //convertDate(afti.fromsaleDate.Trim()),
                            flight.deproute.depdate,                                                                                                                                                                                                                                                                  //convertDate(afti.tosaleDate.Trim()),
                            flight.deproute.depdate,                                                                                                                                                                                                                                                                  //convertDate(afti.fromtripDate.Trim()),
                            flight.deproute.arrdate,                                                                                                                                                                                                                                                                  //convertDate(afti.totripDate.Trim()),
                            string.Empty,                                                                                                                                                                                                                                                                             //afti.returnMoney,
                            string.Empty,                                                                                                                                                                                                                                                                             //afti.updateProvision,
                            "<p>1.此票价为净价,不含任何费用<br />  2.票价如有更改,恕不另行通知<br />  3.不可签转,不可更改行程<br />  4.所有航段必须有确认的订座,不可开OPEN票. <br />  5.退票手续 :可退票,需缴纳手续费<br />  6.误机(NOSHOW) :需收取误机费<br />  7.更改订座 : 允许更改。乘客必须于出发日之前取消原订的航班,否则按照 '误机' 处理<br />  8.儿童票价 :成人票价的75% <br />  9.婴儿票价 :使用 IATA 公布成人票价的10%<br />  &nbsp;</p>", //afti.limitProvision,
                            ReadXmlHelper.GetAirPortNameByCode(flight.depport),                                                                                                                                                                                                                                       // afti.fromAirportName,
                            flight.arrport,                                                                                                                                                                                                                                                                           //afti.toAirportCode,
                            ReadXmlHelper.GetAirPortIDByCode(flight.arrport),
                            airId,
                            "100", //afti.score,
                            "3",   //afti.zongping,
                            "2",   //afti.xiai,
                            "4",   //afti.xiaofei,
                            "4",   //afti.manyi,
                            "4",   //afti.fuwu,
                            flight.deproute.route,
                            "returnTip",
                            tairportdescription,
                            flight.deproute.depdate + " " + flight.deproute.deptime.Insert(2, ":"),
                            flight.deproute.arrdate + " " + flight.deproute.arrtime.Insert(2, ":"));
                //fromCityname,toCityname,toCityCode,toCityname,addtime,
                //untaxPrice,tripType,tId,fAirportCode,fromCityCode,fromPort,
                //tAirportName,logoPic,airname,planNum,age
                //smallPic,bagPrice,engerTicket,seatShip,shortstayDate,attPrice
                //longstayDate,childPrice,fromsaleDate,tosaleDate,
                //fromtripDate,totripDate,returnMoney,updateProvision
                ticketOne = dt.Rows[0];
            }

            int fCityId = Convert.ToInt32(ticketOne["fromCity"].ToString());
            int tCityId = Convert.ToInt32(ticketOne["toCity"].ToString());
            ticket_7      = GetTicketDetailBydelay(7, fCityId, tCityId, 6);
            ticket_14     = GetTicketDetailBydelay(14, fCityId, tCityId, 6);
            ticket_30     = GetTicketDetailBydelay(30, fCityId, tCityId, 6);
            ticket_60     = GetTicketDetailBydelay(60, fCityId, tCityId, 6);
            ticket_90     = GetTicketDetailBydelay(90, fCityId, tCityId, 6);
            ticket_120    = GetTicketDetailBydelay(120, fCityId, tCityId, 6);
            ticket_180    = GetTicketDetailBydelay(180, fCityId, tCityId, 6);
            ticket_365    = GetTicketDetailBydelay(365, fCityId, tCityId, 6);
            ticket_all    = GetTicketDetailBydelay(0, fCityId, tCityId, 5);
            tmax          = tmax > ticket_7.Count ? tmax : ticket_7.Count;
            tmax          = tmax > ticket_14.Count ? tmax : ticket_14.Count;
            tmax          = tmax > ticket_30.Count ? tmax : ticket_30.Count;
            tmax          = tmax > ticket_60.Count ? tmax : ticket_60.Count;
            tmax          = tmax > ticket_90.Count ? tmax : ticket_90.Count;
            tmax          = tmax > ticket_120.Count ? tmax : ticket_120.Count;
            tmax          = tmax > ticket_180.Count ? tmax : ticket_180.Count;
            tmax          = tmax > ticket_365.Count ? tmax : ticket_365.Count;
            hotNews       = getNewsRandom(id);
            randowTicketF = GetRandowTicketF(14, fCityId, tCityId, 10);
            randowTicketT = GetRandowTicketT(14, fCityId, tCityId, 10);
            randowNews    = getQuanByType(ticketOne["toCityname"].ToString());
        }
        else
        {
            Response.Redirect("international.aspx");
        }
    }
コード例 #8
0
ファイル: AiFeiService.cs プロジェクト: aidai99/feiying
    /// <summary>
    /// 机票具体信息查询接口
    /// </summary>
    public AiFeiTicketInfo TicketInfo(string num)
    {
        try
        {
            string url = aifeServerUrl + ticketInfoUrl + _account + num;
            //string url = "http://localhost:4896/web/af.html";
            WebRequest request = WebRequest.Create(url);
            request.Timeout = 5000;
            WebResponse response     = request.GetResponse();
            string      responseText = new System.IO.StreamReader(response.GetResponseStream()).ReadToEnd();

            string[] ticketOptions = responseText.Split('^');

            if (ticketOptions.Length == 22)
            {
                AiFeiTicketInfo afte = new AiFeiTicketInfo();
                afte.fromCityCode = ticketOptions[0];
                long id = 0;
                afte.fromCityName    = ReadXmlHelper.GetFromCityNameByCode(ticketOptions[0].ToString(), out id);
                afte.toCityCode      = ticketOptions[1];
                afte.toCityName      = ReadXmlHelper.GetToCityNameByCode(ticketOptions[1].ToString(), out id);
                afte.fromAirportCode = ticketOptions[2];
                afte.fromAirportName = ReadXmlHelper.GetAirPortNameByCode(ticketOptions[2]);
                afte.toAirportCode   = ticketOptions[3];
                afte.toAirportName   = ReadXmlHelper.GetAirPortNameByCode(ticketOptions[3]);
                afte.airlineName     = ticketOptions[4];


                if (ticketOptions[5] == "SF")
                {
                    afte.tripType = "1";
                }
                else if (ticketOptions[5] == "DC")
                {
                    afte.tripType = "0";
                }

                afte.ft            = ticketOptions[6];
                afte.cangwei       = ticketOptions[7];
                afte.untaxprice    = ticketOptions[8];
                afte.shortstayDate = ticketOptions[9];

                afte.longstayDate    = ticketOptions[10];
                afte.childPrice      = ticketOptions[11];
                afte.fromsaleDate    = ticketOptions[12];
                afte.tosaleDate      = ticketOptions[13];
                afte.fromtripDate    = ticketOptions[14];
                afte.totripDate      = ticketOptions[15];
                afte.returnMoney     = ticketOptions[16];
                afte.updateProvision = ticketOptions[17];

                afte.wuji           = ticketOptions[18];
                afte.xingli         = ticketOptions[19];
                afte.limitProvision = ticketOptions[20];

                return(afte);
            }
        }
        catch
        {
            return(null);
        }
        return(null);
    }
コード例 #9
0
ファイル: searchTicket2.aspx.cs プロジェクト: aidai99/feiying
    /// <summary>
    /// 获取Fei580票价
    /// </summary>
    /// <returns></returns>
    protected List <FlightRoundTrip> getFei580Ticekt()
    {
        #region SQL语句
        StringBuilder str = new StringBuilder();
        str.Append("select top 100 percent");
        str.Append(" FY_Ticket.tid,FY_Ticket.untaxPrice,FY_Ticket.relayPort,FY_Ticket.tripType,");
        str.Append(" FY_FromCity.cityCode as fromCityCode,");
        str.Append(" FY_ToCity.cityCode as toCityCode,");
        str.Append(" FY_Tax.tax,");
        str.Append(" FY_FromCity.chName as fromCityname,FY_FromCity.fId,FY_Airline.aId,FY_ToCity.tId as toId,");
        str.Append(" FY_ToCity.chName as toCityname,FY_Airline.airlineCode as airlineCode,FY_Airline.chName as airname, FY_Airline.smallPic as smallPic from FY_Ticket ");
        str.Append(" left join FY_FromCity on FY_FromCity.fId=FY_Ticket.fromCity");
        str.Append(" left join FY_ToCity on FY_ToCity.tId=FY_Ticket.toCity");
        str.Append(" left join FY_Airline on FY_Airline.aId=FY_Ticket.airLine");
        str.Append(" left join FY_Tax on (FY_Ticket.tripType =FY_Tax.taxType and FY_Ticket.airLine = FY_Tax.airline and FY_Ticket.toCity = FY_Tax.toCity and FY_Ticket.fromCity = FY_Tax.fromCity)");
        str.Append(" where 1=1 ");
        if (this.tripType != 2)
        {
            str.Append(" and (FY_Ticket.tripType=" + this.tripType + ")");
        }
        if (this.fromcity != 0)
        {
            str.Append(" and (FY_FromCity.fId=" + this.fromcity + ")");
        }
        if (!string.IsNullOrEmpty(this.tocityName1))
        {
            str.Append(" and (FY_ToCity.chName like '%" + tocityName1 + "%')");
        }
        if (!string.IsNullOrEmpty(this.tripDate))
        {
            str.Append(" and (FY_Ticket.fromtripDate<='" + tripDate + "' and FY_Ticket.totripDate>='" + tripDate + "' )");
        }
        if (!string.IsNullOrEmpty(this.tripDate) && !string.IsNullOrEmpty(this.backDate) && this.tripType != 0)
        {
            int day = (Convert.ToDateTime(backDate) - Convert.ToDateTime(tripDate)).Days;
            str.Append(" and DateDiff(d,FY_Ticket.fromtripDate,FY_Ticket.totripDate) >= " + day);
        }
        str.Append(" and (FY_Ticket.tosaleDate>='" + DateTime.Now.ToString("yyyy-MM-dd") + "')");
        if (!string.IsNullOrEmpty(this.airlineId))
        {
            str.Append(" and (FY_Airline.aId=" + airlineId + ")");
        }
        if (string.IsNullOrEmpty(this.orderStr))
        {
            str.Append(" order by FY_Ticket.untaxPrice asc ,FY_Ticket.tId desc");
        }
        else
        {
            str.Append(" order by FY_Ticket." + this.orderStr + " asc ,FY_Ticket.tId desc");
        }
        #endregion
        DataSet   ds = SqlHelper.ExecuteDataset(SqlHelper.ConnString_select, CommandType.Text, str.ToString());
        DataTable dt = ds.Tables[0];

        List <FlightRoundTrip> ListRTrip = new List <FlightRoundTrip>();

        foreach (DataRow dr in dt.Rows)
        {
            FlightRoundTrip    rTrip  = new FlightRoundTrip();
            List <FlightInfo>  listF  = new List <FlightInfo>();
            List <FlightInfo2> listF2 = new List <FlightInfo2>();
            if (Convert.ToInt32(dr["tripType"]) == 0)
            {
                #region 单程
                List <FlightDetail> listDeteil = new List <FlightDetail>();
                FlightInfo          finfo      = new FlightInfo();
                finfo.Data        = Guid.NewGuid().ToString("N").ToUpper();
                finfo.Source      = "feiying";
                finfo.TicketPrice = decimal.Parse(dr["untaxPrice"].ToString());
                finfo.XmlInfo     = dr["tid"].ToString();
                finfo.Tid         = dr["tid"].ToString();

                FlightDetail fdInfo = new FlightDetail();
                fdInfo.AirCompanyCode = dr["airlineCode"].ToString();
                fdInfo.StartCityCode  = dr["fromCityCode"].ToString();
                fdInfo.StartCityName  = ReadXmlHelper.GetAirPortNameByCode(dr["fromCityCode"].ToString());
                fdInfo.BeginCityName  = dr["fromCityname"].ToString();

                //如果有中转,则到达城市、机场等替换为中转地
                if (string.IsNullOrEmpty(dr["relayPort"].ToString()))
                {
                    fdInfo.EndCityCode = dr["toCityCode"].ToString();
                    fdInfo.EndCityName = ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                    fdInfo.ToCityName  = dr["toCityname"].ToString();
                }
                else
                {
                    string[] array = dr["relayPort"].ToString().Split('-');
                    fdInfo.EndCityCode = array[0];
                    fdInfo.EndCityName = ReadXmlHelper.GetAirPortNameByCode(array[0]);
                    long a = 0;//纯粹接收参数
                    fdInfo.ToCityName = ReadXmlHelper.GetToCityNameByCode(array[0], out a);
                }

                fdInfo.FromTime   = DateTime.Parse(ReadTime(this.tripDate, 0));
                fdInfo.ArriveTime = ReadTime(fdInfo.FromTime);
                listDeteil.Add(fdInfo);
                //如果有中转
                if (!string.IsNullOrEmpty(dr["relayPort"].ToString()))
                {
                    FlightDetail fdInfo2 = new FlightDetail();
                    fdInfo2.AirCompanyCode = string.Empty;       //dr["airlineCode"].ToString();
                    fdInfo2.StartCityCode  = fdInfo.EndCityCode; //dr["fromCityCode"].ToString();
                    fdInfo2.EndCityCode    = dr["toCityCode"].ToString();
                    fdInfo2.StartCityName  = ReadXmlHelper.GetAirPortNameByCode(fdInfo.EndCityCode);
                    fdInfo2.EndCityName    = ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                    fdInfo2.BeginCityName  = fdInfo.ToCityName;//dr["fromCityname"].ToString();
                    fdInfo2.ToCityName     = dr["toCityname"].ToString();
                    fdInfo2.FromTime       = ReadTime(fdInfo.ArriveTime);
                    fdInfo2.ArriveTime     = ReadTime(fdInfo2.FromTime);
                    listDeteil.Add(fdInfo2);
                }
                finfo.ListInterFlightDetails = listDeteil;
                listF.Add(finfo);
                #endregion
            }
            else
            {
                #region 去程
                List <FlightDetail> listDeteil = new List <FlightDetail>();
                FlightInfo          finfo      = new FlightInfo();
                finfo.Data        = Guid.NewGuid().ToString("N").ToUpper();
                finfo.Source      = "feiying";
                finfo.TicketPrice = decimal.Parse(dr["untaxPrice"].ToString());
                finfo.XmlInfo     = dr["tid"].ToString();
                finfo.Tid         = dr["tid"].ToString();

                FlightDetail fdInfo = new FlightDetail();
                fdInfo.AirCompanyCode = dr["airlineCode"].ToString();
                fdInfo.StartCityCode  = dr["fromCityCode"].ToString();
                fdInfo.StartCityName  = ReadXmlHelper.GetAirPortNameByCode(dr["fromCityCode"].ToString());
                fdInfo.BeginCityName  = dr["fromCityname"].ToString();

                //如果有中转,则到达城市、机场等替换为中转地
                if (string.IsNullOrEmpty(dr["relayPort"].ToString()))
                {
                    fdInfo.EndCityCode = dr["toCityCode"].ToString();
                    fdInfo.EndCityName = ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                    fdInfo.ToCityName  = dr["toCityname"].ToString();
                }
                else
                {
                    string[] array = dr["relayPort"].ToString().Split('-');
                    fdInfo.EndCityCode = array[0];
                    fdInfo.EndCityName = ReadXmlHelper.GetAirPortNameByCode(array[0]);
                    long a = 0;//纯粹接收参数
                    fdInfo.ToCityName = ReadXmlHelper.GetToCityNameByCode(array[0], out a);
                }

                fdInfo.FromTime   = DateTime.Parse(ReadTime(this.tripDate, 0));
                fdInfo.ArriveTime = ReadTime(fdInfo.FromTime);
                listDeteil.Add(fdInfo);
                //如果有中转
                if (!string.IsNullOrEmpty(dr["relayPort"].ToString()))
                {
                    FlightDetail fdInfo2 = new FlightDetail();
                    fdInfo2.AirCompanyCode = string.Empty;       //dr["airlineCode"].ToString();
                    fdInfo2.StartCityCode  = fdInfo.EndCityCode; //dr["fromCityCode"].ToString();
                    fdInfo2.EndCityCode    = dr["toCityCode"].ToString();
                    fdInfo2.StartCityName  = ReadXmlHelper.GetAirPortNameByCode(fdInfo.EndCityCode);
                    fdInfo2.EndCityName    = ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                    fdInfo2.BeginCityName  = fdInfo.ToCityName;//dr["fromCityname"].ToString();
                    fdInfo2.ToCityName     = dr["toCityname"].ToString();
                    fdInfo2.FromTime       = ReadTime(fdInfo.ArriveTime);
                    fdInfo2.ArriveTime     = ReadTime(fdInfo2.FromTime);
                    listDeteil.Add(fdInfo2);
                }
                finfo.ListInterFlightDetails = listDeteil;
                listF.Add(finfo);
                #endregion

                #region 返程
                List <FlightDetail> listDeteil2 = new List <FlightDetail>();
                FlightInfo2         finfo2      = new FlightInfo2();
                finfo2.Source      = "feiying";
                finfo2.TicketPrice = decimal.Parse(dr["untaxPrice"].ToString());

                FlightDetail fdbkInfo = new FlightDetail();
                fdbkInfo.AirCompanyCode = dr["airlineCode"].ToString();
                fdbkInfo.StartCityCode  = dr["toCityCode"].ToString();
                fdbkInfo.StartCityName  = fdInfo.EndCityName;//使用去程的到达机场作为返回的出发机场 //ReadXmlHelper.GetAirPortNameByCode(dr["toCityCode"].ToString());
                fdbkInfo.BeginCityName  = dr["toCityname"].ToString();

                //如果有中转,则到达城市、机场等替换为中转地
                if (string.IsNullOrEmpty(dr["relayPort"].ToString()))
                {
                    fdbkInfo.EndCityCode = dr["fromCityCode"].ToString();
                    fdbkInfo.EndCityName = fdInfo.StartCityName;//使用去程的出发机场作为返回的到达机场 //ReadXmlHelper.GetAirPortNameByCode(dr["fromCityCode"].ToString());
                    fdbkInfo.ToCityName  = dr["fromCityname"].ToString();
                }
                else
                {
                    string[] array = dr["relayPort"].ToString().Split('-');
                    fdbkInfo.EndCityCode = array[0];
                    fdbkInfo.EndCityName = fdInfo.EndCityName;
                    long a = 0;                              //纯粹接收参数
                    fdbkInfo.ToCityName = fdInfo.ToCityName; //ReadXmlHelper.GetToCityNameByCode(array[0], out a);
                }

                fdbkInfo.FromTime   = DateTime.Parse(ReadTime(this.backDate, 0));
                fdbkInfo.ArriveTime = ReadTime(fdbkInfo.FromTime);
                listDeteil2.Add(fdbkInfo);
                //如果有中转
                if (!string.IsNullOrEmpty(dr["relayPort"].ToString()))
                {
                    FlightDetail fdbkInfo2 = new FlightDetail();
                    fdbkInfo2.AirCompanyCode = string.Empty;         //dr["airlineCode"].ToString();
                    fdbkInfo2.StartCityCode  = fdbkInfo.EndCityCode; //dr["fromCityCode"].ToString();
                    fdbkInfo2.EndCityCode    = dr["fromCityCode"].ToString();
                    fdbkInfo2.StartCityName  = fdbkInfo.EndCityName; //使用第一次中转的到达机场作为第二次中转的出发机场 //ReadXmlHelper.GetAirPortNameByCode(fdbkInfo.EndCityCode);
                    fdbkInfo2.EndCityName    = fdInfo.StartCityName; //使用去程的出发机场作为返回的到达机场 //ReadXmlHelper.GetAirPortNameByCode(dr["fromCityCode"].ToString());
                    fdbkInfo2.BeginCityName  = fdInfo.ToCityName;    //使用去程的到达城市作为返回的出发城市 //dr["fromCityname"].ToString();
                    fdbkInfo2.ToCityName     = dr["fromCityname"].ToString();
                    fdbkInfo2.FromTime       = ReadTime(fdbkInfo.ArriveTime);
                    fdbkInfo2.ArriveTime     = ReadTime(fdbkInfo2.FromTime);
                    listDeteil2.Add(fdbkInfo2);
                }
                finfo2.ListInterFlightDetails = listDeteil2;
                listF2.Add(finfo2);
                #endregion
            }
            rTrip.ListInterFlightInfo  = listF;
            rTrip.ListInterFlightInfo2 = listF2;
            ListRTrip.Add(rTrip);
        }
        return(ListRTrip);
    }