Esempio n. 1
0
        private static void AssistantRentDatesResponse(String txt)
        {
            string[]    words       = txt.Split(' ');
            RentDates   page        = (RentDates)Current.Instance.Page;
            Reservation reservation = Reservation.Instance;
            DateTime    dateTime;

            if ((txt.IndexOf("Od") >= 0) && !(txt.IndexOf("Rezerwacja") >= 0) && (speechOn == true))
            {
                pTTS.SpeakAsync("Rezerwacja od daty " + words[1] + words[2]);
                page.FromDate.Text   = words[1] + words[2];
                reservation.FromDate = page.FromDate.Text;
            }
            else if (DateTime.TryParse(page.FromDate.Text, out dateTime))
            {
                if ((txt.IndexOf("Do") >= 0) && !(txt.IndexOf("Rezerwacja") >= 0) && (speechOn == true))
                {
                    pTTS.SpeakAsync("Rezerwacja do daty " + words[1] + words[2]);
                    page.ToDate.Text   = words[1] + words[2];
                    reservation.ToDate = page.ToDate.Text;
                    PersonalData newPage = new PersonalData();
                    page.NavigationService.Navigate(newPage);
                    Current.Instance.Page = newPage;
                }
            }
        }
Esempio n. 2
0
        private static void AssistantPersonalDataResponse(String txt)
        {
            string[]    words       = txt.Split(' ');
            Reservation reservation = Reservation.Instance;

            PersonalData p = (PersonalData)Current.Instance.Page;

            if (((txt.IndexOf("Jędrzej") >= 0) ||
                 (txt.IndexOf("Adrian") >= 0) ||
                 (txt.IndexOf("Tomasz") >= 0) ||
                 (txt.IndexOf("Jan") >= 0) ||
                 (txt.IndexOf("Krzysztof") >= 0) ||
                 (txt.IndexOf("Adam") >= 0) ||
                 (txt.IndexOf("Maciej") >= 0)) &&
                ((txt.IndexOf("Piasecki") >= 0) ||
                 (txt.IndexOf("Stefaniak") >= 0) ||
                 (txt.IndexOf("Pałys") >= 0) ||
                 (txt.IndexOf("Nowak") >= 0) ||
                 (txt.IndexOf("Kowalski") >= 0) ||
                 (txt.IndexOf("Małysz") >= 0) ||
                 (txt.IndexOf("Kononowicz") >= 0) ||
                 (txt.IndexOf("Roszkowski") >= 0)) &&
                (speechOn = true))
            {
                p.PersonalName.Text    = words[0];
                p.PersonalSurname.Text = words[1];

                reservation.PersonalName = words[0];
                reservation.Surname      = words[1];
                Summary summary = new Summary();
                p.NavigationService.Navigate(summary);
                Current.Instance.Page = summary;
            }
        }
        private void Next_Click(object sender, RoutedEventArgs e)
        {
            Reservation reservation = Reservation.Instance;

            reservation.FromDate = FromDate.Text;
            reservation.ToDate   = ToDate.Text;
            PersonalData personalData = new PersonalData();

            this.NavigationService.Navigate(personalData);
            Current current = Current.Instance;

            current.Page = personalData;
        }