Example #1
0
        /// <summary>
        ///     Raises the login changed event.
        /// </summary>
        protected override void OnLoginChanged()
        {
            base.OnLoginChanged();

            SelectLocationCommand.ChangeCanExecute();
            SelectCheckListCommand.ChangeCanExecute();
            SelecClearCheckMarkCommand.ChangeCanExecute();

            OnPropertyChanged("UserName");
        }
Example #2
0
        /// <summary>
        ///     Executes the select user command.
        /// </summary>
        /// <returns>The select user command.</returns>
        private void ExecuteSelectLocationCommand()
        {
            if (IsBusy || !IsLoggedIn)
            {
                return;
            }

            IsBusy = true;
            Page.ShowProgressIndicator();
            SelectLocationCommand.ChangeCanExecute();

            Task.Run(() => {
                if (HaccpAppSettings.SharedInstance.SiteSettings.MenuId > 0 && _dataStore.CheckLocationsExist())
                {
                    Device.BeginInvokeOnMainThread(async() => {
                        await Page.NavigateTo(PageEnum.SelectLocations, true);
                        if (HaccpAppSettings.SharedInstance.IsWindows)
                        {
                            await Task.Delay(500);
                        }

                        IsBusy = false;
                        Page.DismissPopup();
                        SelectLocationCommand.ChangeCanExecute();
                    });
                }
                else
                {
                    Device.BeginInvokeOnMainThread(() => {
                        Page.DisplayAlertMessage(HACCPUtil.GetResourceString("NoLocationsFound"),
                                                 HACCPUtil.GetResourceString(
                                                     "NolocationsfoundPleasetapSelectChangeMenuintheWirelessTasksMenu"));
                        IsBusy = false;
                        Page.DismissPopup();
                        SelectLocationCommand.ChangeCanExecute();
                    });
                }
            });
        }