当前位置: 首页>>代码示例>>C#>>正文


C# clsMasters.GetIgnoreList方法代码示例

本文整理汇总了C#中BAL.clsMasters.GetIgnoreList方法的典型用法代码示例。如果您正苦于以下问题:C# clsMasters.GetIgnoreList方法的具体用法?C# clsMasters.GetIgnoreList怎么用?C# clsMasters.GetIgnoreList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BAL.clsMasters的用法示例。


在下文中一共展示了clsMasters.GetIgnoreList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getAvailableRoutes

        public AvailableTrips getAvailableRoutes(int sourceId, int destinationId, String dateOfJourney, String URL, String ConsumerKey, int ProviderID)
        {
            try
            {
                dateOfJourney = dateOfJourney.Split('-')[2] + "-" + dateOfJourney.Split('-')[1] + "-" + dateOfJourney.Split('-')[0];
                if (File.Exists(Path.Combine(HttpRuntime.AppDomainAppPath, "Routes\\" + dateOfJourney + ".xml")))
                {
                    DataSet ds = new DataSet();
                    ds.ReadXml(Path.Combine(HttpRuntime.AppDomainAppPath, "Routes\\" + dateOfJourney + ".xml"));
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables["route"].Rows.Count > 0)
                    {
                        objAvailableTrips = new AvailableTrips();
                        DataView dv = ds.Tables["route"].DefaultView;
                        dv.RowFilter = "origin_id=" + sourceId + "and destination_id=" + destinationId;
                        foreach (DataRowView item in dv)
                        {
                            //add the routes that match with given source and destinations
                            if (int.Parse(item["origin_id"].ToString()) == sourceId && int.Parse(item["destination_id"].ToString()) == destinationId)
                            {
                                LJ.CLB.DTO.TripDetails objTripDetails = new DTO.TripDetails();
                                objTripDetails.providerName = "BITLA";
                                objTripDetails.arrivalTime = CalculateArrivalTime(item["dep_time"].ToString(), item["duration"].ToString());
                                objTripDetails.availableSeats = item["available_seats"].ToString();
                                //boardingTimes are fetched in seat layout
                                objTripDetails.busType = item["bus_type"].ToString();
                                //cancellationPolicy  is not valid for bitla
                                objTripDetails.cancellationPolicy = String.Empty;
                                objTripDetails.departureTime = item["dep_time"].ToString();
                                //droppingTimes are fetched in seat layout
                                objTripDetails.duration = item["duration"].ToString();
                                objTripDetails.fares = item["fare_str"].ToString();
                                objTripDetails.id = item["reservation_id"].ToString();
                                objTripDetails.partialCancellationAllowed = item["is_cancellable"].ToString();
                                objTripDetails.travels = item["travels"].ToString();
                                objTripDetails.sourceId = int.Parse(item["origin_id"].ToString());
                                objTripDetails.destinationId = int.Parse(item["destination_id"].ToString());
                                trip.Add(objTripDetails);
                            }
                        }

                    }
                    //ignore operator list
                    clsMasters obj = new clsMasters();
                    DataSet dsignore = obj.GetIgnoreList(ProviderID);
                    if (dsignore != null)
                    {
                        if (dsignore.Tables[0].Rows.Count > 0)
                        {
                            foreach (DataRow row in dsignore.Tables[0].Rows)
                            {
                                trip = trip.Where(e => e.travels != row[3].ToString()).ToList();
                            }

                        }

                    }
                    foreach (var bt in trip)
                    {
                        LJ.CLB.DTO.TripDetails objTripDetails = new DTO.TripDetails();
                        objTripDetails.providerName = "BITLA";
                        objTripDetails.arrivalTime = CalculateArrivalTime(bt.departureTime.ToString(), bt.duration.ToString());
                        objTripDetails.availableSeats = bt.availableSeats.ToString();
                        //boardingTimes are fetched in seat layout
                        objTripDetails.busType = bt.busType.ToString();
                        //cancellationPolicy  is not valid for bitla
                        objTripDetails.cancellationPolicy = String.Empty;
                        objTripDetails.departureTime = bt.departureTime.ToString();
                        //droppingTimes are fetched in seat layout
                        objTripDetails.duration = bt.duration.ToString() + " hrs";
                        objTripDetails.fares = bt.fares.ToString();
                        objTripDetails.id = bt.id.ToString();
                        objTripDetails.partialCancellationAllowed = bt.partialCancellationAllowed.ToString();
                        objTripDetails.travels = bt.travels.ToString();
                        objTripDetails.sourceId = int.Parse(bt.sourceId.ToString());
                        objTripDetails.destinationId = int.Parse(bt.destinationId.ToString());
                        objAvailableTrips.Add(objTripDetails);
                    }
                }

                return objAvailableTrips;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:86,代码来源:Bitla.cs

示例2: getTripListV2

        public AvailableTrips getTripListV2(int sourceId, int destinationId, String dateOfJourney, String URL, String ConsumerKey, String ConsumerSecret, int ProviderID)
        {
            try
            {

                //return "";
                //Convert dd-mm-yyyy format to API compatible format dd/mm/yyyy
                dateOfJourney = dateOfJourney.Replace('-', '/');
                client = new TGTravelServiceClient("TGSWS", URL);
                TripWithArrival response = client.getTripListV2(ConsumerKey, ConsumerSecret, sourceId.ToString(), destinationId.ToString(), dateOfJourney);
                AvailableTrips objAvailableTrips = null;
                if (response != null && response.tripList != null && response.tripList.Length > 0)
                {
                    objAvailableTrips = new AvailableTrips();
                    #region Loop each trip and add trip details to availabletrips

                    //ignore operator list

                    List<object> oo = new List<object>();
                    clsMasters obj = new clsMasters();
                    DataSet ds = obj.GetIgnoreList(ProviderID);
                    if (ds != null)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            AvailableFlights = response.tripList.ToList();
                            foreach (DataRow row in ds.Tables[0].Rows)
                            {

                                AvailableFlights = AvailableFlights.Where(e => e.provider != row[3].ToString()).ToList();

                            }
                        }
                        else
                        {
                            AvailableFlights = response.tripList.ToList();
                        }
                    }

                    //end ignore operator list
                    // List<TripWithArrivalDTO> AvailableFlights = response.tripList.Where(e => e.provider.Except(studentQuery).ToList();

                    foreach (TripWithArrivalDTO item in AvailableFlights)
                    {
                        //if (item.provider == "SVR Tours &  Travels")
                        //{
                        //}

                        LJ.CLB.DTO.TripDetails objTripDetails = new DTO.TripDetails();
                        objTripDetails.providerName = "TICKETGOOSE";
                        //remove seconds and make it to 12hr format
                        if (item.arrivalTime != null)
                        {
                            if (int.Parse(item.arrivalTime.Split(':')[0]) < 12) objTripDetails.arrivalTime = item.arrivalTime.Split(':')[0] + ':' + item.arrivalTime.Split(':')[1] + " AM";
                            else objTripDetails.arrivalTime = (int.Parse(item.arrivalTime.Split(':')[0]) - 12).ToString() + ':' + item.arrivalTime.Split(':')[1] + " PM";
                        }
                        else
                            objTripDetails.arrivalTime = "-";

                        objTripDetails.availableSeats = item.availableSeats;

                        //objTripDetails.boardingTimes = JsonConvert.SerializeObject(item.pickUpPointList);
                        objTripDetails.busType = item.type;
                        //cancellationPolicy  is not valid for ticketgoose
                        objTripDetails.cancellationPolicy = String.Empty;

                        //remove seconds and make it to 12hr format
                        if (item.departureTime != null)
                        {
                            if (int.Parse(item.departureTime.Split(':')[0]) < 12) objTripDetails.departureTime = item.departureTime.Split(':')[0] + ':' + item.departureTime.Split(':')[1] + " AM";
                            else objTripDetails.departureTime = (int.Parse(item.departureTime.Split(':')[0]) - 12).ToString() + ':' + item.departureTime.Split(':')[1] + " PM";
                        }

                        //objTripDetails.droppingTimes = String.Empty;

                        if (item.departureTime != null && item.arrivalTime != null)
                            //objTripDetails.duration = Duration(objTripDetails.departureTime, objTripDetails.arrivalTime);
                            objTripDetails.duration = Duration(objTripDetails.departureTime, objTripDetails.arrivalTime);
                        if (objTripDetails.duration == null)
                        {
                            objTripDetails.duration = "-";
                        }
                        objTripDetails.fares = item.fare;
                        objTripDetails.id = item.scheduleId;
                        //partialCancellationAllowed is not valid for ticketkgoose
                        objTripDetails.partialCancellationAllowed = String.Empty;
                        objTripDetails.travels = item.provider;
                        objTripDetails.sourceId = sourceId;
                        objTripDetails.destinationId = destinationId;
                        objAvailableTrips.Add(objTripDetails);

                    }
                    #endregion
                }

                return objAvailableTrips;

            }
            catch (Exception ex)
            {
//.........这里部分代码省略.........
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:101,代码来源:TicketGoose.cs


注:本文中的BAL.clsMasters.GetIgnoreList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。