Example #1
0
        public async Task GetSpaPlaces(IDialogContext context, IAwaitable <string> result)
        {
            var selectedCard = await result;
            var type         = "";
            await context.PostAsync("You have selected " + selectedCard);

            switch (selectedCard)
            {
            case BeautyParlour:
                type = "beauty parlours";
                break;

            case Salons:
                type = "salons";
                break;

            case Gym:
                type = "gyms";
                break;
            }
            TextSearch ts         = new TextSearch();
            var        attachment = ts.makeRequest(placename, type);
            Activity   msg        = (Activity)context.MakeMessage();

            msg.Recipient        = msg.Recipient;
            msg.Type             = "message";
            msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
            msg.Attachments      = attachment;
            await context.PostAsync(msg);

            context.Wait(MessageReceived);
        }
Example #2
0
        public async Task GetDevotionalPlaces(IDialogContext context, IAwaitable <string> result)
        {
            var selectedCard = await result;
            var type         = "";
            await context.PostAsync("You have selected " + selectedCard);

            switch (selectedCard)
            {
            case Temples: type = "temple";
                break;

            case Churches: type = "church";
                break;

            case Mosques: type = "mosque";
                break;
            }
            TextSearch ts         = new TextSearch();
            var        attachment = ts.makeRequest(placename, type);
            Activity   msg        = (Activity)context.MakeMessage();

            msg.Recipient        = msg.Recipient;
            msg.Type             = "message";
            msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
            msg.Attachments      = attachment;
            await context.PostAsync(msg);

            context.Wait(MessageReceived);
        }
Example #3
0
        public async Task SuggestPlaces(IDialogContext context, LuisResult result)
        {
            if (placename != "" && category != "")
            {
                TextSearch ts          = new TextSearch();
                var        attachments = ts.makeRequest(placename, category);
                if (attachments.Count == 0)
                {
                    context.PostAsync("Sorry!!! No " + category + " available..." + Environment.NewLine + Environment.NewLine +
                                      "You can try some of these...");
                    PromptCategories(context, result);
                    return;
                }

                Activity msg = (Activity)context.MakeMessage();
                msg.Recipient        = msg.Recipient;
                msg.Type             = "message";
                msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                msg.Attachments      = attachments;

                await context.PostAsync(msg);
            }
            else if (placename != "" && category == "")
            {
                PromptCategories(context, result);
                return;
            }
            else
            {
                await context.PostAsync("Please enter your place");
            }
            context.Wait(MessageReceived);
        }
Example #4
0
        public async Task DisplaySelectedCard(IDialogContext context, IAwaitable <string> result)
        {
            var selectedCard = await result;
            var type         = "";
            await context.PostAsync("You have selected " + selectedCard);

            switch (selectedCard)
            {
            case DevotionalPlaces: DevotionalPrompt(context);
                break;

            case Education: EducationPrompt(context);
                break;

            case Shopping: ShoppingPrompt(context);
                break;

            case Spa: SpaPrompt(context);
                break;

            case TouristPlaces: TourismPrompt(context);
                break;

            case FoodCourts:
                TextSearch ts         = new TextSearch();
                var        attachment = ts.makeRequest(placename, "restaurants");
                Activity   msg        = (Activity)context.MakeMessage();
                msg.Recipient        = msg.Recipient;
                msg.Type             = "message";
                msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                msg.Attachments      = attachment;
                await context.PostAsync(msg);

                context.Wait(MessageReceived);
                break;

            case Hospitals:
                TextSearch tsh         = new TextSearch();
                var        attachmenth = tsh.makeRequest(placename, "hospitals");
                Activity   msgh        = (Activity)context.MakeMessage();
                msgh.Recipient        = msgh.Recipient;
                msgh.Type             = "message";
                msgh.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                msgh.Attachments      = attachmenth;
                await context.PostAsync(msgh);

                context.Wait(MessageReceived);
                break;
            }
            //context.Wait(MessageReceived);
        }
Example #5
0
        public async Task GetEducationPlaces(IDialogContext context, IAwaitable <string> result)
        {
            var selectedCard = await result;
            var type         = "";
            await context.PostAsync("You have selected " + selectedCard);

            switch (selectedCard)
            {
            case Schools:
                type = "schools";
                break;

            case Inter:
                type = "intermediate colleges";
                break;

            case Engineering:
                type = "engineering colleges";
                break;

            case Medical:
                type = "medical colleges";
                break;

            case Polytechnic:
                type = "polytehnic colleges";
                break;

            case Library:
                type = "libraries";
                break;

            case BookStores:
                type = "book stores";
                break;
            }
            TextSearch ts         = new TextSearch();
            var        attachment = ts.makeRequest(placename, type);
            Activity   msg        = (Activity)context.MakeMessage();

            msg.Recipient        = msg.Recipient;
            msg.Type             = "message";
            msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
            msg.Attachments      = attachment;
            await context.PostAsync(msg);

            context.Wait(MessageReceived);
        }
Example #6
0
        public async Task GetTourismPlaces(IDialogContext context, IAwaitable <string> result)
        {
            var selectedCard = await result;
            var type         = "";
            await context.PostAsync("You have selected " + selectedCard);

            switch (selectedCard)
            {
            case Museums:
                type = "museums";
                break;

            case Zoos:
                type = "zoos";
                break;

            case ArtGalleries:
                type = "art galleries";
                break;

            case Parks:
                type = "parks";
                break;

            case Resorts:
                type = "resorts";
                break;

            case FamousPlaces:
                type = "famous places";
                break;
            }
            TextSearch ts         = new TextSearch();
            var        attachment = ts.makeRequest(placename, type);
            Activity   msg        = (Activity)context.MakeMessage();

            msg.Recipient        = msg.Recipient;
            msg.Type             = "message";
            msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
            msg.Attachments      = attachment;
            await context.PostAsync(msg);

            context.Wait(MessageReceived);
        }
Example #7
0
        public async Task GetShoppingPlaces(IDialogContext context, IAwaitable <string> result)
        {
            var selectedCard = await result;
            var type         = "";
            await context.PostAsync("You have selected " + selectedCard);

            switch (selectedCard)
            {
            case ShoppingMalls:
                type = "shopping malls";
                break;

            case JewelryStores:
                type = "jewelry stores";
                break;

            case MobileStores:
                type = "mobile stores";
                break;

            case CarLeasing:
                type = "car leasing";
                break;
            }
            TextSearch ts         = new TextSearch();
            var        attachment = ts.makeRequest(placename, type);
            Activity   msg        = (Activity)context.MakeMessage();

            msg.Recipient        = msg.Recipient;
            msg.Type             = "message";
            msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
            msg.Attachments      = attachment;
            await context.PostAsync(msg);

            context.Wait(MessageReceived);
        }