/// <summary> /// Method to get available trips for given provider /// </summary> /// <param name="ProviderName"></param> /// <param name="objClientAPIDetails"></param> /// <returns>Returns JSON string with list of available trips</returns> private SeatsInfo GetTripDetailsByProviderName(ClientAPIDetails objClientAPIDetails, BusesSearchFilter objBusesSearchFilter, String tripId, String markUpFare, String SeatLayoutId) { SeatsInfo objSeatsInfo = new SeatsInfo(); try { switch (objClientAPIDetails.ProviderName) { case "ABHIBUS": case "SVR": case "KALLADA": case "KAVERI": case "RAJESH": case "SAIANJANA": AbhibusAPI clsAbhibusAPI = new AbhibusAPI(); objSeatsInfo = clsAbhibusAPI.getBusSeatLayout(objBusesSearchFilter.SourceID , objBusesSearchFilter.DestinationID , objBusesSearchFilter.JourneyDate , tripId , "0" , objClientAPIDetails.APIURL , objClientAPIDetails.ConsumerKey); break; case "BITLA": case "MORNINGSTAR": BitlaAPI clsBitlaAPI = new BitlaAPI(); objSeatsInfo = clsBitlaAPI.getServiceDetails(tripId , objClientAPIDetails.APIURL , objClientAPIDetails.ConsumerKey); break; case "TICKETGOOSE": TicketGooseAPI clsTicketGooseAPI = new TicketGooseAPI(); objSeatsInfo = clsTicketGooseAPI.getTripDetailsV2(objBusesSearchFilter.SourceID , objBusesSearchFilter.DestinationID , objBusesSearchFilter.JourneyDate , tripId , objClientAPIDetails.APIURL , objClientAPIDetails.ConsumerKey , objClientAPIDetails.ConsumerSecret); break; //easy bus 18-05-2013 case "EASYBUS": EasybusAPI clsEasyBusAPI = new EasybusAPI(); objSeatsInfo = clsEasyBusAPI.getLayoutDetails(objBusesSearchFilter.SourceID , objBusesSearchFilter.DestinationID , objBusesSearchFilter.JourneyDate , tripId , SeatLayoutId , markUpFare , "0" , objClientAPIDetails.APIURL , objClientAPIDetails.ConsumerKey); break; default: break; } objSeatsInfo.providerName = objClientAPIDetails.ProviderName; } catch (Exception ex) { //to do //Log Exception } return objSeatsInfo; }
public DataSet GetcallBack(string Resrvation_Id, string url, string ConsumerKey, string ConsumerSecret, string doj) { DataSet ds = new DataSet(); ClientAPIList objClientAPIList = new ClientAPIList(); GetAPIProvidersList(ConsumerKey, ConsumerSecret); objClientAPIList = (ClientAPIList)HttpContext.Current.Cache["ClientAPI-" + ConsumerKey]; //Check if atleast one provider is accessible if (objClientAPIList != null && objClientAPIList.Count > 0) { objClientAPIList.Where(e => e.ProviderName == Convert.ToString("BITLA")); BitlaAPI bitla = new BitlaAPI(); SeatsInfo seat = new SeatsInfo(); seat = bitla.getServiceDetails(Resrvation_Id, objClientAPIList[0].APIURL, objClientAPIList[0].ConsumerKey); ds = convertJsonStringToDataSet(JsonConvert.SerializeObject(seat)); } return ds; }