示例#1
0
        public async Task DeleteAmi()
        {
            await AmiService.DeleteAmi(ViewModel.Ami.Id);

            ViewModel.Ami    = null;
            ViewModel.Source = NavigationServices.GetPage <Amis, AmisViewModel>(ViewModel);
        }
        private ShopFloorModel CreateShopFloorModel(int id, string stocknumber)
        {
            ShopFloorModel model = new ShopFloorModel();

            if (id > 0)
            {
                model.Invoice = InvoiceServices.GetInvoice(id);
                if (model.Invoice == null)
                {
                    model.NoDataMessage = string.Format("We could not find an invoice with an id = {0}", id);
                }
            }
            else if (!string.IsNullOrEmpty(stocknumber))
            {
                model.Invoice = InvoiceServices.GetInvoice(stocknumber);
                if (model.Invoice == null)
                {
                    model.NoDataMessage = string.Format("We could not find an invoice with a stock number = {0}", stocknumber);
                }
            }
            else
            {
                model.NoDataMessage = "There are no vehicles logged into the shop at this time";
            }

            model.Services          = InvoiceServices.GetServices(base.LocationId, model.Invoice);
            model.VehiclesInShop    = NavigationServices.GetVehiclesInShop(base.LocationId).OrderBy(o => o.Id).ToList();
            model.VehiclesCompleted = NavigationServices.GetVehiclesCompletedToday(base.LocationId).OrderBy(o => o.Id).ToList();

            return(model);
        }
示例#3
0
 private async void OnBackCommand()
 {
     ContactToEdit.Name            = OldName;
     ContactToEdit.PhoneNumber     = OldPhoneNumber;
     ContactToEdit.FirstLetterName = FirstLetterOldName;
     await NavigationServices.ModalPop();
 }
        public void TestGpsOutagesDatesAndPrn()
        {
            var outages = NavigationServices.GetGpsOutages(
                new DateTime(2019, 01, 01), new DateTime(2019, 03, 22)).Result;

            Assert.That(!string.IsNullOrEmpty(outages));
        }
示例#5
0
        public async Task DeleteFilm()
        {
            await FilmService.DeleteFilm(ViewModel.Film.Id);

            ViewModel.Film   = null;
            ViewModel.Source = NavigationServices.GetPage <Films, FilmsViewModel>(ViewModel);
        }
示例#6
0
 public MainWindow()
 {
     InitializeComponent();
     view             = new MainViewModel();
     view.Source      = NavigationServices.GetPage <Home, HomeViewModel>(view);
     this.DataContext = view;
 }
示例#7
0
 public CadastroViewModel()
 {
     navigationServices = new NavigationServices(); //nv tela
     dialogServices     = new DialogServices();     //iniciando servico de alerta
     apiService         = new APIService();
     dataService        = new DataService();
 }
示例#8
0
 public void GoToSource()
 {
     if (!String.IsNullOrEmpty(SelectedItem.ExternalUrl) && Uri.IsWellFormedUriString(SelectedItem.ExternalUrl, UriKind.Absolute))
     {
         NavigationServices.NavigateTo(new Uri(SelectedItem.ExternalUrl, UriKind.Absolute));
     }
 }
示例#9
0
 virtual public void ImageTap(string url)
 {
     if (!String.IsNullOrEmpty(url))
     {
         NavigationServices.NavigateToPage("ImageViewer", "url=" + HttpUtility.UrlEncode(url));
     }
 }
        public ActionResult DeleteInvoice(int invoiceId)
        {
            var invoice = InvoiceServices.DeleteInvoice(invoiceId);

            NavigationServices.ClearCache(base.LocationId);

            return(Json("ok"));
        }
示例#11
0
 public LoginViewModel()
 {
     navigationServices = new NavigationServices(); //nv tela
     dialogServices     = new DialogServices();     //iniciando servico de alerta
     Remenbered         = true;                     // lembrar senha marcado
     apiService         = new APIService();
     dataService        = new DataService();
 }
 protected override void OnBackKeyPress(CancelEventArgs e)
 {
     if (_isDeepLink)
     {
         _isDeepLink = false;
         NavigationServices.NavigateToPage("MainPage");
     }
 }
示例#13
0
 public MainViewModel()
 {
     navigationService = new Orders.Services.NavigationServices();
     apiService        = new ApiService();
     Orders            = new ObservableCollection <OrderViewModel>();
     LoadMenu();
     //LoadData();
 }
 //Переход на страницу редактирования упражнения (TrainPage)
 private async Task CheckExercise(object obj)
 {   //приводим полученный объект к типу "OneExercise"
     OneExercise exercise = (OneExercise)obj;
     //cоздаем объект для последующей конвертации в нужный нам тип "OneExerciseViewModel"
     OneExsToViewModelConverter oneExsTo = new OneExsToViewModelConverter();
     //открываем страницу редактирования и передаем в нее объкт нужного типа
     await NavigationServices.NavigateToAsync(new TrainPage(oneExsTo.ConvertTooneexsVM(exercise)));
 }
示例#15
0
 public Rank()
 {
     dataService        = new DataService();
     navigationServices = new NavigationServices();
     RankList           = new ObservableCollection <Model.Rank>();
     LoadBarraca();
     InitializeComponent();
 }
示例#16
0
        public RecuperarPage()
        {
            RecuperarViewModel recuperarViewModel = new RecuperarViewModel();

            BindingContext     = recuperarViewModel;
            navigationServices = new NavigationServices();
            InitializeComponent();
        }
示例#17
0
        public ActionResult Invoice()
        {
            var invoice             = NavigationServices.GetVehiclesInShop(base.LocationId).FirstOrDefault();
            InvoiceParamModel model = new InvoiceParamModel();

            model.InvoiceId = (invoice == null) ? string.Empty : invoice.Id.ToString();

            return(View("Invoice", model));
        }
示例#18
0
        override protected void NavigateToSelectedItem()
        {
            var currentItem = GetCurrentItem();

            if (currentItem != null)
            {
                NavigationServices.NavigateTo(new Uri(currentItem.GetValue("Link")));
            }
        }
 private static void NavigateTo(string protocol, string param)
 {
     if (!String.IsNullOrEmpty(param))
     {
         string url = String.Format("{0}:{1}", protocol, param);
         var    uri = new Uri(url);
         NavigationServices.NavigateTo(uri);
     }
 }
示例#20
0
        public RankPop()
        {
            dataService        = new DataService();
            navigationServices = new NavigationServices();
            RankList           = new ObservableCollection <Model.Rank>();
            LoadBarraca();

            InitializeComponent();
            ListClassificacao.ItemsSource = RankList;
        }
示例#21
0
        override protected void NavigateToSelectedItem()
        {
            var currentItem = GetCurrentItem();

            if (currentItem != null)
            {
                PhoneApplicationService.Current.State["videoObject"] = GetVideo(currentItem);
                NavigationServices.NavigateToPage("YouTubeViewer");
            }
        }
示例#22
0
 private void AppBarButton_Click(object sender, RoutedEventArgs e)
 {
     if (Common.CurrentUser.isAuthorized)
     {
         NavigationServices.NavigateToPage("AddEventPage");
     }
     else
     {
         NavigationServices.NavigateToPage("LoginPage");
     }
 }
示例#23
0
        public CadastroPage(Usuario usuario)
        {
            // NavigationPage.SetHasNavigationBar(this, false);
            CadastroViewModel cadastroViewModel = new CadastroViewModel();

            BindingContext     = cadastroViewModel;
            navigationServices = new NavigationServices(); //nv tela
            InitializeComponent();
            TxtEmail.Text = usuario.email;
            TxtSenha.Text = usuario.senha;
        }
示例#24
0
        //Проверка логина на корректность
        async void OpenCooseWorcoutPageAsync()
        {
            await NavigationServices.NavigateToAsync(new ChooseWorkout());

            Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");

            if (regex.IsMatch(_login))
            {
                await NavigationServices.NavigateToAsync(new ChooseWorkout());
            }
        }
        public ActionResult Index()
        {
            var id      = 0;
            var vehicle = NavigationServices.GetVehiclesInShop(base.LocationId).FirstOrDefault();

            if (vehicle != null)
            {
                id = vehicle.Id;
            }

            return(RedirectToAction("GetInvoice", new { id = id }));
        }
        public ActionResult RecallVehicle(int invoiceId)
        {
            var invoice = InvoiceServices.RecallInvoice(invoiceId);

            NavigationServices.AddVehicleToInShopList(base.LocationId, invoice);
            if (invoice.CompleteDate > DateTime.Today)
            {
                NavigationServices.RemoveVehicleFromCompletedTodayList(base.LocationId, invoice);
            }

            return(Json("ok"));
        }
示例#27
0
        private async void OnSuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
        {
            if (sender.ItemsSource == _failedMessageItemSource)
            {
                sender.Text = string.Empty;
                return;
            }

            var suggestion = args.SelectedItem as LocationSuggestion;

            _currentRouteResult = await MapRouteFinder.GetDrivingRouteAsync(CurrentPosition,
                                                                            suggestion.Location.Point);

            switch (_currentRouteResult.Status)
            {
            case MapRouteFinderStatus.Success:
                FocusResult.Visibility = Visibility.Visible;
                NavigationLabel.Text   = suggestion.Location.Address.Town;
                DescriptionLabel.Text  = suggestion.Location.Description;
                var thing = await NavigationServices.GetPlaceMetaData(suggestion.Location.Address.Town);

                break;

            case MapRouteFinderStatus.UnknownError:
                break;

            case MapRouteFinderStatus.InvalidCredentials:
                break;

            case MapRouteFinderStatus.NoRouteFound:
                break;

            case MapRouteFinderStatus.NoRouteFoundWithGivenOptions:
                break;

            case MapRouteFinderStatus.StartPointNotFound:
                break;

            case MapRouteFinderStatus.EndPointNotFound:
                break;

            case MapRouteFinderStatus.NoPedestrianRouteFound:
                break;

            case MapRouteFinderStatus.NetworkFailure:
                sender.ItemsSource = "No internet connection";
                break;

            case MapRouteFinderStatus.NotSupported:
                break;
            }
        }
示例#28
0
        public ProfilesViewModel(IProfileLoader profileLoader, IGameStarter gameStarter, GlobalConfig globalConfig,
                                 IEventAggregator eventAggregator, IProfileAccountsGetter profileAccountsGetter, NavigationServices navigationServices)
        {
            _profileLoader         = profileLoader;
            _gameStarter           = gameStarter;
            GlobalConfig           = globalConfig;
            _profileAccountsGetter = profileAccountsGetter;
            _navigationServices    = navigationServices;

            gameStarter.OnProcessExit += GameStarterOnOnProcessExit;

            eventAggregator.SubscribeOnUIThread(this);
        }
示例#29
0
 private void Create_Click(object sender, RoutedEventArgs e)
 {
     if (!CurrentUser.isAuthorized)
     {
         NavigationServices.NavigateToPage("LoginPage");
     }
     else if (DescriptionBox.Text != "")
     {
         ErrorText.Text = "Событие создано";
         ServerAPI.AddEvent(DescriptionBox.Text, geoposition, EventDateTime);
         NavigationServices.NavigateToPage("MainPage");
     }
 }
示例#30
0
        private async void OnMore(Contact contact)
        {
            var optionSelected = await App.Current.MainPage.DisplayActionSheet("Select an option", null, null, new string[] { $"Call {contact.PhoneNumber}", "Edit" });

            if (optionSelected.ToString() == $"Call {contact.PhoneNumber}")
            {
                PhoneDialer.Open(contact.PhoneNumber);
            }
            else
            {
                await NavigationServices.ModalPush(new EditContactPage(Contacts, contact));
            }
        }
示例#31
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            
            Styles.Resources = this.Resources;
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Bacon-specific initialization, the static resources need this to exist but its not initialized yet
            InitializeBacon();

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            SystemServices._uiDispatcher = RootFrame.Dispatcher;

            // Bacon-specific initialization
            InitializeBacon();

            // Language display initialization
            InitializeLanguage();

			navigator = new NavigationServices();
			navigator.Init(RootFrame);

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
                //Application.Current.Host.Settings.EnableCacheVisualization = true;
                //Application.Current.Host.Settings.EnableRedrawRegions = true;
            }

        }