Beispiel #1
0
 private List<Agency> getFlightAgency(String agencyhtml)
 {
     List<Agency> agencyList = new List<Agency>();
     int agencyStart = agencyhtml.IndexOf("<div class=\"agent-list\">", 0);
     int agencyEnd = agencyhtml.IndexOf("<div class=\"gotop", agencyStart);
     agencyhtml = agencyhtml.Substring(agencyStart, agencyEnd - agencyStart);
     if (agencyhtml.IndexOf("<div class=\"stage fn-pr border-bottom bookInfo  vendors\" data-book", 0) > 0)
         while (true)
         {
             Agency agency = new Agency();
             int priceStart = agencyhtml.IndexOf("&price", 0);
             int priceEnd = agencyhtml.IndexOf("&uid", priceStart);
             agency.price = agencyhtml.Substring(priceStart + 7, priceEnd - priceStart - 7).Trim();
             int nameStart = agencyhtml.IndexOf("<p class=\"vn\">", priceEnd);
             int nameEnd = agencyhtml.IndexOf("</p>", nameStart);
             agency.AgencyName = agencyhtml.Substring(nameStart + 14, nameEnd - nameStart - 14);
             agencyList.Add(agency);
             int nextAgency = agencyhtml.IndexOf("<div class=\"stage fn-pr border-bottom bookInfo  vendors\" data-book", priceEnd);
             if (nextAgency > 0)
                 agencyhtml = agencyhtml.Substring(nextAgency);
             else
                 break;
         }
     else
     {
         while (true)
         {
             Agency agency = new Agency();
             int nameStart = agencyhtml.IndexOf("<p class=\"vn\">", 0);
             int nameEnd = agencyhtml.IndexOf("</p>", nameStart);
             agency.AgencyName = agencyhtml.Substring(nameStart + 14, nameEnd - nameStart - 14);
             agency.price = "-";
             agencyList.Add(agency);
             int nextAgency = agencyhtml.IndexOf("<p class=\"vn\">", nameEnd);
             if (nextAgency > 0)
                 agencyhtml = agencyhtml.Substring(nextAgency);
             else
                 break;
         }
     }
     return agencyList;
 }
Beispiel #2
0
        /*
        public RS_FlightDetail GetFlightAgency(string _flight)
        {
        }*/
        private RS_FlightDetail ReplaceFlightDetail(RS_FlightDetail dfd, FlightResponseData frd)
        {
            Agency ag = new Agency();
            ag.AgencyName = frd.provider;
            ag.price = frd.standardPrice.ToString();
            dfd.AgencyList.Add(ag);
            if (System.Convert.ToDecimal(dfd.MinPrice) > frd.standardPrice)
                dfd.MinPrice = ag.price;
            dfd.Airline = frd.airline;
            dfd.CraftType = frd.craftType;
            dfd.APort = frd.aPort;
            dfd.ArriveTime = frd.arriveTime.ToUniversalTime().ToString();
            dfd.DPort = frd.dPort;
            dfd.OilFee = frd.adultOilFee.ToString();
            dfd.Tax = frd.adultTax.ToString();
            dfd.TakeOffTime = frd.takeOffTime.ToUniversalTime().ToString();

            return dfd;
        }
Beispiel #3
0
        private RS_FlightDetail ReplaceIntlFlightDetail(RS_FlightDetail ifd, IntlFlightResponseData ifrd)
        {
            Agency ag = new Agency();
            ag.AgencyName = ifrd.provider;
            ag.price = ifrd.standardPrice.ToString();
            ifd.AgencyList.Add(ag);
            if (System.Convert.ToDecimal(ifd.MinPrice) > ifrd.standardPrice)
                ifd.MinPrice = ag.price;
            ifd.Airline = ifrd.airline;
            ifd.CraftType = ifrd.craftType;
            ifd.APort = ifrd.aPort;
            ifd.ArriveTime = System.Convert.ToDateTime(ifrd.arriveTime).ToUniversalTime().ToString();
            ifd.DPort = ifrd.dPort;
            ifd.OilFee = ifrd.fuelCharge.ToString();
            ifd.Tax = ifrd.tax.ToString();
            ifd.TakeOffTime = System.Convert.ToDateTime(ifrd.takeOffTime).ToUniversalTime().ToString();
            ifd.Stops = ifrd.TotalRoutings;

            return ifd;
        }
Beispiel #4
0
 public void addAgency(Agency agency)
 {
     AgencyList.Add(agency);
 }