Exemplo n.º 1
0
        public virtual async Task MessageRecievedAsync(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var CategoryName = await result;

            try
            {
                PeopeAppService searchService = new PeopeAppService();
                Holiday         holiday       = await searchService.GetRRHHHolidays(login);

                holiday.Nombres = Session.Nombre;
                if (CategoryName != null)
                {
                    switch (CategoryName.Text)
                    {
                    case SettingsCardDialog.RRHHHolidays:
                        CardUtil.ShowRRHHHolidaysCard(CategoryName, holiday);
                        Thread.Sleep(4000);
                        await SelectedConfirm(context);

                        break;

                    case SettingsCardDialog.RRHHvoucher:
                        CardUtil.ShowRRHHvoucherCard(CategoryName, holiday);
                        Thread.Sleep(4000);
                        await SelectedConfirm(context);

                        break;

                    default:
                        await context.PostAsync(string.Format(CultureInfo.CurrentCulture, "La opción {0} no es válida. Por favor intente de nuevo", CategoryName));
                        await StartAsync(context);

                        break;
                    }
                }
                else
                {
                    await context.PostAsync(string.Format(CultureInfo.CurrentCulture, "La opción {0} no es válida. Por favor intente de nuevo", CategoryName));

                    context.Wait(this.MessageRecievedAsync);
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine($"Error when searching for people: {e.Message}");
            }
            //   context.Done<object>(null);
        }