Example #1
0
        public GTFS(Agency transitAgency)
            : base(transitAgency)
        {
            db = new DatabaseDataContext();

            agency = (from a in db.GTFS_Agencies where a.ID == transitAgency.AgencyID select a).Single();
        }
        public List<Agency> GetAgencies(string key)
        {
            this.ValidateKey(key);

            DatabaseDataContext db = new DatabaseDataContext();

            List<Agency> result = new List<Agency>();

            foreach (var r in db.GTFS_Agencies.OrderBy(a => a.Name))
            {
                Agency a = new Agency();
                a.AgencyID = r.ID;
                a.Name = r.Name;
                a.State = r.State;
                a.TimeZone = r.TimeZone;

                result.Add(a);
            }

            WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Origin", "*");
            return result;
        }
Example #3
0
 public RouteShout(Agency transitAgency)
     : base(transitAgency)
 {
     this.APIKey = "97027712b04709de2958f77edcc25f1d";
 }
Example #4
0
 public Seattle(Agency transitAgency)
     : base(transitAgency)
 {
     this.APIKey = "0e182a1e-2d1f-49df-b4dd-c3fe09929d98";
 }
Example #5
0
 public WMATA(Agency transitAgency)
     : base(transitAgency)
 {
     this.APIKey = "sr3rfhh9347x4tvgsvaaxakn";
 }
Example #6
0
 protected IWebService(Agency transitAgency)
 {
     this.TransitAgency = transitAgency;
 }
Example #7
0
 public CTA(Agency transitAgency)
     : base(transitAgency)
 {
     this.APIKey = "jGijvDCQLFimphXidZxyJ8UPL";
 }
Example #8
0
 public CityBus(Agency transitAgency)
     : base(transitAgency)
 {
 }
Example #9
0
 public BART(Agency transitAgency)
     : base(transitAgency)
 {
     this.APIKey = "ETDH-BAEA-Y9UQ-9TXU";
 }
        private IWebService SelectWebService(string agencyid)
        {
            DatabaseDataContext db = new DatabaseDataContext();
            var agency = new Agency((from a in db.GTFS_Agencies where a.ID == agencyid select a).Single());

            IWebService webService;
            switch (agency.AgencyID)
            {
                case "bart":
                    webService = new BART(agency);
                    break;
                case "citybus":
                    webService = new CityBus(agency);
                    break;
                case "cta":
                    webService = new CTA(agency);
                    break;
                case "mta":
                    webService = new MTA(agency);
                    break;
                case "seattle":
                    webService = new Seattle(agency);
                    break;
                case "wmata":
                    webService = new WMATA(agency);
                    break;
                default:
                    webService = new GTFS(agency);
                    break;
            }

            webService.TransitAgency = agency;

            return webService;
        }