Esempio n. 1
0
 public BusJob(BusFinder tripFinder, DataContext dataContext, SmtpService smtpService, SmsService smsService)
 {
     this.dataContext = dataContext;
     this.tripFinder  = tripFinder;
     this.smtpService = smtpService;
     this.smsService  = smsService;
 }
Esempio n. 2
0
        public MainDialog(UserState userState, IRoutService routService, BusFinder busFinder, BlaBlaCarFinder blaBlaCarFinder)
            : base(nameof(MainDialog))
        {
            this.userState = userState;

            AddDialog(new TravelDialog(busFinder, blaBlaCarFinder));
            AddDialog(new RoutDialog(routService));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                InitialStepAsync
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
Esempio n. 3
0
        public TravelDialog(BusFinder busFinder, BlaBlaCarFinder blaBlaCarFinder) : base(nameof(TravelDialog))
        {
            this.busFinder       = busFinder;
            this.blaBlaCarFinder = blaBlaCarFinder;

            AddDialog(new DateTimePrompt(nameof(DateTimePrompt)));
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                DestinationStepAsync,
                DepartureStepAsync,
                ResultsStepAsync
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
Esempio n. 4
0
        public RoutDialog(ITelegramBotClient botClient)
        {
            var blaBlaCarConfig = new BlaBlaCarConfig
            {
                ApiUrl =
                    "https://public-api.blablacar.com/api/v2/trips?locale=uk_UA&cur=UAH&fn={from}&tn={to}&db={date}",
                ApiKey = "9bd3dc5d46c34a0cb1ac951322208f77"
            };
            var busConfig = new BusConfig
            {
                ApiUrl =
                    "http://ticket.bus.com.ua/order/forming_bn?point_from={from}&point_to={to}&date={date}&date_add=0&fn=round_search",
                BookingUrl =
                    "http://ticket.bus.com.ua/order/forming_bn?round_num={round_num}&count=1&email={email}&reservation=&bs_code={bus_code}&point_from={from_code}&point_to={to_code}&local_point_from={local_from_code}&local_point_to={local_to_code}&date={date}&date_add=0&date_dep={date}&fn=check_places&ya=0&submit=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0+%D0%BC%D0%B5%D1%81%D1%82+%D0%B8+%D1%81%D1%82%D0%BE%D0%B8%D0%BC%D0%BE%D1%81%D1%82%D0%B8",
                SiteUrl = "http://ticket.bus.com.ua/"
            };

            blaBlaCarFinder = new BlaBlaCarFinder(new HttpService(), new DateFormatter(), Options.Create(blaBlaCarConfig));
            busFinder       = new BusFinder(new HttpService(), new DateFormatter(), Options.Create(busConfig),
                                            new LinkBuilder(new DateFormatter(), Options.Create(busConfig)));
            dialogFlowService = new DialogFlowService();
            this.botClient    = botClient;
        }
Esempio n. 5
0
 public BusController(BusFinder busFinder)
 {
     tripFinder = busFinder;
 }