public async Task StockInStore(IDialogContext context, LuisResult result) { FilterIntentScore(context, result); var idx = result.Query.LastIndexOf(":"); string id = result.Query.Remove(0, idx + 1).Replace(" ", ""); await StoreDialog.ShowStores(context, id); context.Done(new CODE(DIALOG_CODE.DONE)); }
private async Task EventHandler(IDialogContext context, Activity activity) { JObject json = activity.Value as JObject; List <InputData> data = getReplyData(json); //have mandatory info if (data.Count >= 2) { //json structure is correct if (data[0].attribute == REPLY_ATR && data[1].attribute == DIALOG_ATR) { ClickType event_click = getClickType(data[0].value); DialogType event_dialog = getDialogType(data[1].value); if (event_dialog == DialogType.MENU && event_click == ClickType.MENU) { switch (data[0].value) { case "menu_session": context.Call(new AccountDialog(AccountDialog.State.INIT), ResumeAfterDialogCall); break; case "menu_filter": context.Call(new FilterDialog(FilterDialog.State.INIT), ResumeAfterDialogCall); break; case "menu_comparator": context.Call(new CompareDialog(CompareDialog.State.INIT), ResumeAfterDialogCall); break; case "menu_recommendations": context.Call( new RecommendationDialog(RecommendationDialog.State.INIT), ResumeAfterDialogCall); break; case "menu_wishlist": context.Call( new WishListDialog(WishListDialog.State.INIT), ResumeAfterDialogCall); break; case "menu_stores": await StoreDialog.ShowClosestStores(context); context.Done(new CODE(DIALOG_CODE.DONE)); break; case "menu_help": //Add call to help context.Wait(InputHandler); break; case "menu_info": var reply = context.MakeMessage(); reply.Attachments.Add(await getCardAttachment(CardType.INFO_MENU)); await context.PostAsync(reply); context.Wait(InputHandler); break; } } else { context.Done(new CODE(DIALOG_CODE.PROCESS_EVENT, activity, event_dialog)); } } else { context.Done(new CODE(DIALOG_CODE.DONE)); } } else { context.Done(new CODE(DIALOG_CODE.DONE)); } }
public async Task ClosestStores(IDialogContext context, LuisResult result) { await StoreDialog.ShowClosestStores(context); context.Done(new CODE(DIALOG_CODE.DONE)); }