Example #1
0
 private void NaviViewMain_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
 {
     if (FirstClick)
     {
         FirstClick = false;
         FrameMain.Navigate(typeof(PageZajiao));
         FrameMain.Navigate(typeof(PageParent));
         if (NaviViewItemZajiao == sender.SelectedItem)
         {
             FrameMain.GoBack();
         }
     }
     else
     {
         if (sender.SelectedItem == CurrentItem)
         {
             return;
         }
         if (NaviViewItemZajiao == sender.SelectedItem)
         {
             FrameMain.GoBack();
         }
         if (NaviViewItemParent == sender.SelectedItem)
         {
             FrameMain.GoForward();
         }
     }
     CurrentItem = (NavigationViewItem)sender.SelectedItem;
 }
Example #2
0
        /// <summary>
        /// 菜单栏点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            var mySender = sender as MenuItem;

            switch (mySender.Name)
            {
            case "MenuItemAbout":
                GlobalTool.OpenDialogButton
                    (this,
                    "Flower\nAnimal Crossing : New Horizons\n"
                    + Application.ResourceAssembly.GetName().Version.ToString()
                    + "\n\n作者 FunJoo\n开源 https://gitee.com/funjoo/ACNHFlower/ "
                    );
                break;

            case "MenuItemExit":
                GlobalTool.CloseApp();
                break;

            case "MenuItemZajiao":
                FrameMain.Navigate(new PageZajiao());
                break;

            case "MenuItemParent":
                FrameMain.Navigate(new PageParent());
                break;
            }
        }
Example #3
0
        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            string cofigFilePath = Infoscreen.Logging.ASSEMBLY_DIRECTORY + "InfoscreenConfig.xml";

            TextBlockMain.Text = "Считывание файла конфигурации: " + cofigFilePath;

            Infoscreen.Configuration configuration = null;
            await Task.Run(() => {
                Infoscreen.Configuration.LoadConfiguration(
                    cofigFilePath, out configuration);
            });

            TextBlockMain.Visibility = Visibility.Hidden;
            FrameMain.Visibility     = Visibility.Visible;

            if (configuration.IsConfigReadedSuccessfull)
            {
                PageConfigView pageConfigView = new PageConfigView(configuration);
                FrameMain.Navigate(pageConfigView);
            }
            else
            {
                PageConfigNotFound pageConfigNotFound = new PageConfigNotFound();
                FrameMain.Navigate(pageConfigNotFound);
            }
        }
Example #4
0
        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            InfoKiosk.Services.Config configuration = InfoKiosk.Services.Config.Instance;
            if (!configuration.IsConfigReadedSuccessfull)
            {
                TextBlockMessage.Text = "Не удалось считать конфигурацию." + Environment.NewLine +
                                        "Убедитесь, что существует файл: " + configuration.ConfigFilePath + Environment.NewLine +
                                        Environment.NewLine + "Если это первый запуск ПО InfoKiosk, то воспользуйтесь сначала утилитой для управления настройками: InfoKioskConfigManager.exe";
                return;
            }

            TextBlockMessage.Text = "Получение данных из БД \"МИС Инфоклиника\"";

            bool   result       = false;
            string errorMessage = string.Empty;

            await Task.Run(() => {
                result = result = InfoKiosk.Services.DataProvider.LoadServicesInGui(out errorMessage);
            });

            if (!result)
            {
                TextBlockMessage.Text = "Не удалось получить список услуг." + Environment.NewLine +
                                        Environment.NewLine + " Текст ошибки:" + Environment.NewLine + errorMessage;
                return;
            }
            ;

            TextBlockMessage.Visibility = Visibility.Hidden;
            FrameMain.Visibility        = Visibility.Visible;
            FrameMain.Navigate(new Pages.PageSelectSpeciality());
        }
Example #5
0
        public MainWindow()
        {
            InitializeComponent();
            BindGlobal();

            FrameMain.Navigate(new PageZajiao());
        }
Example #6
0
        private void ButtonLogin_Click(object sender, RoutedEventArgs e)
        {
            if (TextBoxEmail.Text.Length == 0)
            {
                ErrorMessage.Text = "Enter an email.";
                TextBoxEmail.Focus();
            }
            else if (!Regex.IsMatch(TextBoxEmail.Text, @"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"))
            {
                ErrorMessage.Text = "Enter a valid email.";
                TextBoxEmail.Select(0, TextBoxEmail.Text.Length);
                TextBoxEmail.Focus();
            }
            else
            {
                string email    = TextBoxEmail.Text;
                string password = passwordBox1.Password;

                if (_loginController.AuthenticateUser(email, password) == true)
                {
                    string welcomeMessage = _loginController.GetCurrentUser();
                    MessageBox.Show(welcomeMessage);
                    Reset();
                    FrameMain.Navigate(new ShowItemsView());
                }
                else
                {
                    ErrorMessage.Text = "Sorry! Please enter existing emailid/password.";
                }
            }
        }
Example #7
0
        public MenuView(string profissaoUsuario)
        {
            InitializeComponent();
            if (profissaoUsuario == "Recepcionista")
            {
                BtnFuncionarios.Visibility  = Visibility.Hidden;
                BtnProcedimentos.Visibility = Visibility.Hidden;
                BtnProdutos.Visibility      = Visibility.Hidden;
            }

            else if (profissaoUsuario == "Estoquista")
            {
                BtnFuncionarios.Visibility  = Visibility.Hidden;
                BtnProcedimentos.Visibility = Visibility.Hidden;
                BtnClientes.Visibility      = Visibility.Hidden;
                BtnAgenda.Visibility        = Visibility.Hidden;
            }

            else if (profissaoUsuario == "ProfissionalBeleza")
            {
                BtnFuncionarios.Visibility  = Visibility.Hidden;
                BtnProcedimentos.Visibility = Visibility.Hidden;
                BtnClientes.Visibility      = Visibility.Hidden;
                BtnAgenda.Visibility        = Visibility.Hidden;
            }

            FrameMain.Navigate(new PrincipalView());
        }
        private void LbMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!this.IsInitialized)
            {
                return;
            }

            if (LbMenu.SelectedItem is ListBoxItem item)
            {
                switch (item.Name)
                {
                case "LbItemHome":
                    FrameMain.Navigate(new Uri("Screens/Dashboard.xaml", UriKind.Relative));
                    break;

                case "LbItemUsers":
                    FrameMain.Navigate(new Uri("Screens/Users.xaml", UriKind.Relative));
                    break;

                case "LbItemConfig":
                    FrameMain.Navigate(new Uri("Screens/Config.xaml", UriKind.Relative));
                    break;

                case "LbItemParty":
                    FrameMain.Navigate(new Uri("Screens/Party.xaml", UriKind.Relative));
                    break;

                default:
                    FrameMain.Navigate(new Uri("Screens/Dashboard.xaml", UriKind.Relative));
                    break;
                }

                DrawerMenuLeft.IsLeftDrawerOpen = false;
            }
        }
Example #9
0
        async void ShowLogin()
        {
            MessageDialog message = new MessageDialog();
            var           res     = await message.ShowAsync();

            if (res == ContentDialogResult.Secondary)
            {
                Application.Current.Exit();
            }
            else if (res == ContentDialogResult.Primary)
            {
                if (await message.IsLogin())
                {
                    this.InitializeComponent();
                    HomeView home = new HomeView();
                    FrameMain.Navigate(home.GetType());
                }
                else
                {
                    ContentDialog Error = new ContentDialog();
                    Error.Title = "Sai mật khẩu";
                    Error.SecondaryButtonText = "OK";
                    var contentResult = await Error.ShowAsync();

                    if (contentResult == ContentDialogResult.Secondary)
                    {
                        ShowLogin();
                    }
                }
            }
        }
Example #10
0
 private void MenuSkyscraperGenerator_Click(object sender, RoutedEventArgs e)
 {
     if (!PageList.ContainsKey("SkyscraperGenerator"))
     {
         PageList.Add("SkyscraperGenerator", new PageSkyscraperGenerator());
     }
     FrameMain.Navigate(PageList["SkyscraperGenerator"]);
 }
Example #11
0
 private void OpenItem(Bookshelf2NavigationItemViewModel vm)
 {
     if (vm.Tag is not kurema.FileExplorerControl.Models.FileItems.IFileItem file)
     {
         return;
     }
     FrameMain.Navigate(typeof(BookshelfPageFileItem), file);
 }
Example #12
0
 private void MenuNonogramSolver_Click(object sender, RoutedEventArgs e)
 {
     if (!PageList.ContainsKey("NonogramSolver"))
     {
         PageList.Add("NonogramSolver", new PageNonogramSolver());
     }
     FrameMain.Navigate(PageList["NonogramSolver"]);
 }
Example #13
0
 public WinAdmin()
 {
     InitializeComponent();
     BtnClose.Click    += (sender, e) => { ActionWindowClass.CloseStateButton(); };
     BtnMinimize.Click += (sender, e) => { ActionWindowClass.MinimizedStateButton(this); };
     FrameMain.Navigate(new PageUser());
     ActionWindowClass.MainFrame = FrameMain;
 }
Example #14
0
        private void ButtonLogout_Click(object sender, RoutedEventArgs e)
        {
            EndCurrentUser();

            MessageBoxResult result = MessageBox.Show("You have logged out", "Logout");

            _yourSpace.GetCurrentItems();
            FrameMain.Navigate(new YourSpace());
        }
Example #15
0
        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            string configFilePath        = Path.Combine(configPath, "InfoscreenConfig.xml");
            string advertisementFilePath = Path.Combine(configPath, "Advertisement.xml");
            string fullScreenAdPath      = Path.Combine(configPath, "FullScreenAdvertisements");

            Logging.ToLog("App - путь к файлу настроек: " + configFilePath);
            Logging.ToLog("App - путь к файлу информационных сообщений: " + advertisementFilePath);
            Logging.ToLog("App - путь к файлам полноэкранных информационных изображений: " + fullScreenAdPath);

            Configuration configuration = new Configuration();
            Advertisement advertisement = new Advertisement();

            await Task.Run(() => {
                Configuration.LoadConfiguration(configFilePath, out configuration);
            });

            await Task.Run(() => {
                Advertisement.LoadAdvertisement(advertisementFilePath, out advertisement);
            });

            if (configuration.IsSystemWorkAsTimetable() && Debugger.IsAttached)
            {
                WindowState = WindowState.Maximized;
            }

            pageChairsRoot   = new PageChairsRoot(configuration, advertisement);
            fullScreenAdList = FullScreenAd.GetAdItems(fullScreenAdPath, true);

            Logging.ToLog("Список изображений для показа: " + Environment.NewLine +
                          string.Join(Environment.NewLine, fullScreenAdList));

            if (fullScreenAdList.Count > 0)
            {
                secondsRoomStatus   = 30;
                secondsFullscreenAd = 10;
                Random random = new Random();
                currentAdId = random.Next(0, fullScreenAdList.Count - 1);

                if (Debugger.IsAttached)
                {
                    secondsRoomStatus   = 5;
                    secondsFullscreenAd = 5;
                }

                Logging.ToLog("Запуск таймера отображения полноэкранных информационных сообщений");
                Logging.ToLog("Значения длительности отображения в секундах, статус кабинета - " +
                              secondsRoomStatus + ", полноэкранные информационные сообщения - " + secondsFullscreenAd);

                timerMain          = new DispatcherTimer();
                timerMain.Interval = TimeSpan.FromSeconds(random.Next(0, secondsRoomStatus));
                timerMain.Tick    += TimerMain_Tick;
                timerMain.Start();
            }

            FrameMain.Navigate(pageChairsRoot);
        }
 private void ButtonNext_OnClick(object sender, RoutedEventArgs e)
 {
     if (FrameMain.Content is Page1)
     {
         FrameMain.Navigate(_page2);
     }
     else if (FrameMain.Content is Page2)
     {
         FrameMain.Navigate(_page3);
     }
     //NavigationService?.Navigate(new Uri("Page2.xaml", UriKind.Relative));
 }
Example #17
0
        public MainPage()
        {
            this.InitializeComponent();

            SetTitleBar();
            BindGlobal();

            BindData();
            BindFlower();

            FrameMain.Navigate(typeof(PageStartup));
        }
        public void ShowErrorPage()
        {
            TextBlockTitle.Visibility = Visibility.Hidden;
            isErrorPageShowing        = true;

            if (FrameMain.Content is PageError)
            {
                return;
            }

            FrameMain.Navigate(new PageError());
        }
Example #19
0
 private void NavigationView_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args)
 {
     if (args.IsSettingsSelected)
     {
         FrameMain.Navigate(typeof(SettingPage));
         return;
     }
     if (args.SelectedItem is not Bookshelf2NavigationItemViewModel itemVM)
     {
         return;
     }
     itemVM.Open();
 }
 private void ButtonBack_OnClick(object sender, RoutedEventArgs e)
 {
     if (FrameMain.Content is Page3)
     {
         FrameMain.Navigate(_page2);
     }
     else if (FrameMain.Content is Page2)
     {
         FrameMain.Navigate(_page1);
     }
     //if (NavigationService != null && NavigationService.CanGoBack)
     //{
     //    NavigationService.GoBack();
     //}
 }
Example #21
0
        private void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            string name        = TextBoxName.Text;
            double price       = double.Parse(TextBoxPrice.Text);
            string description = TextBoxDescription.Text;
            string image       = TextBoxImage1.Text;

            _itemsManagerController.AddNewItem(name, price, description, image);
            MessageBox.Show("You have added an item!");

            this.Close();

            FrameMain.Navigate(_showItemsView);
            _showItemsView.PopulateAllItems();
            //_yourSpace.GetCurrentItems();
        }
Example #22
0
        private void ButtonSubmit_Click(object sender, RoutedEventArgs e)
        {
            if (TextBoxEmail.Text.Length == 0)
            {
                ErrorMessage.Text = "Enter an email.";
                TextBoxEmail.Focus();
            }
            else if (!Regex.IsMatch(TextBoxEmail.Text, @"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"))
            {
                ErrorMessage.Text = "Enter a valid email.";
                TextBoxEmail.Select(0, TextBoxEmail.Text.Length);
                TextBoxEmail.Focus();
            }
            else
            {
                string firstName = TextBoxFirstName.Text;
                string lastName  = TextBoxLastName.Text;
                string email     = TextBoxEmail.Text;
                string password  = PasswordBox1.Password;
                if (PasswordBox1.Password.Length == 0)
                {
                    ErrorMessage.Text = "Enter password.";
                    PasswordBox1.Focus();
                }
                else if (PasswordBoxConfirm.Password.Length == 0)
                {
                    ErrorMessage.Text = "Enter Confirm password.";
                    PasswordBoxConfirm.Focus();
                }
                else if (PasswordBox1.Password != PasswordBoxConfirm.Password)
                {
                    ErrorMessage.Text = "Confirm password must be same as password.";
                    PasswordBoxConfirm.Focus();
                }
                else
                {
                    ErrorMessage.Text = "";

                    _registerController.CreateNewUser(firstName, lastName, email, password);
                    ErrorMessage.Text = "You have Registered successfully.";
                    Reset();
                    FrameMain.Navigate(new ShowItemsView());
                }
            }
        }
Example #23
0
        public MainWindow()
        {
            InitializeComponent();

            #region ChangePage
            WindowHelper.ShowPageChoice = () =>
            {
                FrameMain.Navigate(new PageChoice());
            };

            WindowHelper.ShowPageDepartmentName = () =>
            {
                FrameMain.Navigate(new PageDepartmentName());
            };

            WindowHelper.ShowPageMonthSetting = () =>
            {
                FrameMain.Navigate(new PageMonthSetting());
            };

            WindowHelper.ShowPageEmployee = () =>
            {
            };

            WindowHelper.ShowPageEmployeeList = () =>
            {
                FrameMain.Navigate(new PageEmployeeList());
            };

            WindowHelper.ShowPageCreateDepartmentWorkDiary = () =>
            {
                FrameMain.Navigate(new PageCreateDepartmentWorkDiary());
            };

            WindowHelper.CloseWindow = () =>
            {
                this.Close();
            };
            #endregion

            FrameMain.Navigate(new PageChoice());
        }
        public MainWindow()
        {
            InitializeComponent();
            string path = Environment.CurrentDirectory + "\\watcher";

            Directory.CreateDirectory(path);
            FileSystemWatcher watcher = new FileSystemWatcher();

            int    index = Assembly.GetExecutingAssembly().Location.LastIndexOf("\\");
            string _path = Assembly.GetExecutingAssembly().Location.Substring(0, index);

            watcher.Path = _path;
            watcher.EnableRaisingEvents = true;
            watcher.Created            += new FileSystemEventHandler(watcher_Created);
            watcher.Deleted            += new FileSystemEventHandler(watcher_Deleted);
            watcher.Changed            += new FileSystemEventHandler(watcher_Changed);
            watcher.Renamed            += new RenamedEventHandler(watcher_Renamed);

            FrameMain.Navigate(new LoginPage());
        }
Example #25
0
        private void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
        {
            string item = ((NavigationViewItem)args.SelectedItem).Tag as string;

            if (item == "StudentView")
            {
                StudentView student = new StudentView();
                FrameMain.Navigate(student.GetType());
            }
            else if (item == "HomeView")
            {
                HomeView home = new HomeView();
                FrameMain.Navigate(home.GetType());
            }
            else if (item == "ScoreView")
            {
                ScoreView score = new ScoreView();
                FrameMain.Navigate(score.GetType());
            }
        }
 /// <summary>
 /// Страница истории версий.
 /// </summary>
 private void FrameMainSwitchChangeLog()
 {
     if (_pageChangeLog == null)
     {
         _pageChangeLog = new PageChangeLog();
     }
     if (FrameMain.Content != null)
     {
         if (!(FrameMain.Content is PageChangeLog))
         {
             FrameMain.Navigate(_pageChangeLog);
         }
     }
     else
     {
         FrameMain.Navigate(_pageChangeLog);
     }
     // Обновить страницу.
     _pageChangeLog.Refresh();
     //FrameMain.Refresh();
 }
 /// <summary>
 /// Страница редактора.
 /// </summary>
 private void FrameMainSwitchEditor()
 {
     if (_pageEditor == null)
     {
         _pageEditor = new PageEditor();
     }
     if (FrameMain.Content != null)
     {
         if (!(FrameMain.Content is PageEditor))
         {
             FrameMain.Navigate(_pageEditor);
         }
     }
     else
     {
         FrameMain.Navigate(_pageEditor);
     }
     // Обновить страницу.
     _pageEditor.Refresh();
     //FrameMain.Refresh();
 }
        public MainWindow()
        {
            InitializeComponent();

            instance = this;

            KeyDown += (s, e) => {
                if (!e.Key.Equals(Key.Escape))
                {
                    return;
                }

                ShutdownApp("Закрытие по нажатию клавиши ESC");
            };

            StartCheckDbAvailability();
            _ = ExcelInterop.Instance;

            PageNotification pageNotification = new PageNotification(PageNotification.NotificationType.Welcome);

            FrameMain.Navigate(pageNotification);
            DataContext = BindingValues.Instance;

            autoCloseTimer = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(Properties.Settings.Default.AutoCloseTimerIntervalInSeconds)
            };

            autoCloseTimer.Tick += AutoCloseTimer_Tick;
            FrameMain.Navigated += FrameMain_Navigated;
            PreviewMouseDown    += MainWindow_PreviewMouseDown;

            if (Debugger.IsAttached)
            {
                Cursor      = Cursors.Arrow;
                WindowState = WindowState.Normal;
                Width       = 1280;
                Height      = 1024;
                Topmost     = false;
            }
        }
Example #29
0
        private async void TimerMain_Tick(object sender, EventArgs e)
        {
            timerMain.Interval = TimeSpan.FromSeconds(secondsRoomStatus);
            timerMain.Stop();

            Logging.ToLog("Переключение на страницу полноэкранных информационных сообщений");
            Logging.ToLog("Изображение: " + Path.GetFileName(fullScreenAdList[currentAdId].OptimalImage));
            pageAdvertisement = new PageAdvertisement(fullScreenAdList[currentAdId].OptimalImage);
            FrameMain.Navigate(pageAdvertisement);

            await PutTaskDelay();

            currentAdId++;
            if (currentAdId == fullScreenAdList.Count)
            {
                currentAdId = 0;
            }

            Logging.ToLog("Переключение на страницу статуса кабинета");
            FrameMain.Navigate(pageChairsRoot);
            timerMain.Start();
        }
 private void ChangeFrameEvents(Type newPage, MainWindowFrame parameter)
 {
     FrameMain.Navigate(newPage, parameter);
 }