예제 #1
0
        public async Task <Schedule> Get(int type, string index)
        {
            ScheduleParser parser;
            var            f = ApplicationContext.Instance.Facilities.Where(x => x.Index == type).FirstOrDefault();

            switch (type)
            {
            case 0:
                parser = new AuesParser();
                break;

            case 1:
                parser = new KaznauParser();
                break;

            case 2:
                parser = new IneuParser();
                break;

            case 100:
                parser = new AstuParser();
                break;

            default:
                throw new Exception("Incorrect type");
            }
            var s = await parser.ParseSchedule(index);

            s.Facility = f;
            return(s);
        }
예제 #2
0
        public async Task <List <GroupInfo> > Get(int type)
        {
            ScheduleParser parser;

            switch (type)
            {
            case 0:
                parser = new AuesParser();
                break;

            case 1:
                parser = new KaznauParser();
                break;

            case 2:
                parser = new IneuParser();
                break;

            case 100:
                parser = new AstuParser();
                break;

            default:
                throw new Exception("Incorrect type");
            }
            return(await parser.ParseGroupList());
        }