Ejemplo n.º 1
0
        public async Task Scan()
        {
            try
            {
                QrHandler qr  = new QrHandler();
                string    res = await qr.Scan();

                res = res.Replace("<Part>", "");
                Part Part = await Keeper.GetByToken(res);

                if (Part != null)
                {
                    await Application.Current.MainPage.Navigation.PushAsync(new PartPage(Part));
                }
                else
                {
                    DependencyService.Get <IToaster>().ShortAlert($"Nie znaleziono części oznaczonej kodem {res}..");
                }
            }
            catch (Exception ex)
            {
                await App.Current.MainPage.DisplayAlert(RuntimeSettings.ConnectionErrorTitle, RuntimeSettings.ConnectionErrorText, "OK");
            }
        }