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);
            }
        }
Beispiel #2
0
        private void exportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (p_mode == 0)
            {
                FrameMain.SaveContentPlain(m_calendar);
            }
            else if (p_mode == 2)
            {
                SaveFileDialog sfd = new SaveFileDialog();

                string dir;
                string locationFileName = calLocation.GetNameAsFileName();
                sfd.Filter   = "PNG image - current month (*.png)|*.png|HTML pages - whole year (*.html)|*.html";
                sfd.FileName = locationFileName;

                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    dir = Path.GetDirectoryName(sfd.FileName);
                    switch (sfd.FilterIndex)
                    {
                    case 1:
                        CalendarTableDrawer.ExportPng(calLocation, dir, locationFileName, calendarTableView1.CurrentYear, calendarTableView1.CurrentMonth);
                        break;

                    case 2:
                        CalendarTableDrawer.ExportPngYear(calLocation, dir, locationFileName, calendarTableView1.CurrentYear);
                        break;
                    }
                }
            }
        }
Beispiel #3
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;
            }
        }
Beispiel #4
0
 public override void setNswe(short nswe)
 {
     if (FrameMain.getInstance().isSelectedGeoCell(this))
     {
         FrameMain.getInstance().setSelectedGeoCell(this);
     }
 }
 private void BtnBack_Click(object sender, RoutedEventArgs e)
 {
     if (FrameMain.CanGoBack == true)
     {
         FrameMain.GoBack();
     }
 }
Beispiel #6
0
        public MainWindow()
        {
            InitializeComponent();
            BindGlobal();

            FrameMain.Navigate(new PageZajiao());
        }
Beispiel #7
0
        public void checkDeselection(int minBlockX, int maxBlockX, int minBlockY, int maxBlockY)
        {
            GeoCell cell = FrameMain.getInstance().getSelectedGeoCell();
            //
            GeoBlock block;

            for (GeoBlockEntry e = getHead(), p; (e = e.getNext()) != getTail();)
            {
                block = e.getKey();
                if (block.getBlockX() < minBlockX || block.getBlockX() >= maxBlockX || block.getBlockY() < minBlockY || block.getBlockY() >= maxBlockY)
                {
                    if (cell != null && cell.getBlock() == block)
                    {
                        cell = null;
                        FrameMain.getInstance().setSelectedGeoCell(null);
                    }
                    //
                    setStateOf(block.getCells(), SelectionState.NORMAL);
                    p = e.getPrev();
                    e.remove();
                    e = p;
                }
            }
            //
            if (cell == null && hasSelected())
            {
                FrameMain.getInstance().setSelectedGeoCell(getTail().getPrev().getValue().getLastUnsafe());
            }
        }
Beispiel #8
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());
        }
Beispiel #9
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.";
                }
            }
        }
Beispiel #10
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;
            }
        }
Beispiel #12
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();
                    }
                }
            }
        }
Beispiel #13
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;
 }
Beispiel #14
0
 private void OpenItem(Bookshelf2NavigationItemViewModel vm)
 {
     if (vm.Tag is not kurema.FileExplorerControl.Models.FileItems.IFileItem file)
     {
         return;
     }
     FrameMain.Navigate(typeof(BookshelfPageFileItem), file);
 }
Beispiel #15
0
 private void MenuNonogramSolver_Click(object sender, RoutedEventArgs e)
 {
     if (!PageList.ContainsKey("NonogramSolver"))
     {
         PageList.Add("NonogramSolver", new PageNonogramSolver());
     }
     FrameMain.Navigate(PageList["NonogramSolver"]);
 }
Beispiel #16
0
 public WinAdmin()
 {
     InitializeComponent();
     BtnClose.Click    += (sender, e) => { ActionWindowClass.CloseStateButton(); };
     BtnMinimize.Click += (sender, e) => { ActionWindowClass.MinimizedStateButton(this); };
     FrameMain.Navigate(new PageUser());
     ActionWindowClass.MainFrame = FrameMain;
 }
Beispiel #17
0
 private void MenuSkyscraperGenerator_Click(object sender, RoutedEventArgs e)
 {
     if (!PageList.ContainsKey("SkyscraperGenerator"))
     {
         PageList.Add("SkyscraperGenerator", new PageSkyscraperGenerator());
     }
     FrameMain.Navigate(PageList["SkyscraperGenerator"]);
 }
Beispiel #18
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);
        }
Beispiel #19
0
 public override void setNswe(short nswe)
 {
     _heightAndNSWE = GeoEngine.updateNSWEOfHeightAndNSWE(_heightAndNSWE, nswe);
     //
     if (FrameMain.getInstance().isSelectedGeoCell(this))
     {
         FrameMain.getInstance().setSelectedGeoCell(this);
     }
 }
Beispiel #20
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());
        }
 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));
 }
        public void ShowErrorPage()
        {
            TextBlockTitle.Visibility = Visibility.Hidden;
            isErrorPageShowing        = true;

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

            FrameMain.Navigate(new PageError());
        }
Beispiel #23
0
        public override void addHeight(short height)
        {
            short oldHeight = getHeight();

            _height = GeoEngine.getGeoHeightOfHeight((short)(_height + height));
            getBlock().updateMinMaxHeight(_height, oldHeight);
            //
            if (FrameMain.getInstance().isSelectedGeoCell(this))
            {
                FrameMain.getInstance().setSelectedGeoCell(this);
            }
        }
Beispiel #24
0
        public MainPage()
        {
            this.InitializeComponent();

            SetTitleBar();
            BindGlobal();

            BindData();
            BindFlower();

            FrameMain.Navigate(typeof(PageStartup));
        }
Beispiel #25
0
        public override void addHeight(short height)
        {
            short oldHeight = getHeight();

            _heightAndNSWE = GeoEngine.updateHeightOfHeightAndNSWE(_heightAndNSWE, (short)(getHeight() + height));
            getBlock().updateLayerFor(this);
            getBlock().updateMinMaxHeight(getHeight(), oldHeight);
            //
            if (FrameMain.getInstance().isSelectedGeoCell(this))
            {
                FrameMain.getInstance().setSelectedGeoCell(this);
            }
        }
Beispiel #26
0
        public override void setHeightAndNSWE(short heightAndNSWE)
        {
            short oldHeight = getHeight();

            _heightAndNSWE = heightAndNSWE;
            getBlock().updateLayerFor(this);
            getBlock().updateMinMaxHeight(getHeight(), oldHeight);
            //
            if (FrameMain.getInstance().isSelectedGeoCell(this))
            {
                FrameMain.getInstance().setSelectedGeoCell(this);
            }
        }
Beispiel #27
0
        public override void setHeightAndNSWE(short heightAndNSWE)
        {
            short oldHeight = getHeight();

            _height = GeoEngine.getHeight(heightAndNSWE);
            //
            getBlock().updateMinMaxHeight(_height, oldHeight);
            //
            if (FrameMain.getInstance().isSelectedGeoCell(this))
            {
                FrameMain.getInstance().setSelectedGeoCell(this);
            }
        }
Beispiel #28
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();
     //}
 }
Beispiel #30
0
        public void unload()
        {
            for (GeoBlockEntry e = getHead(), p; (e = e.getNext()) != getTail();)
            {
                p = e.getPrev();
                e.remove();
                e = p;
            }
            //
            FrameMain f = FrameMain.getInstance();

            if (f != null)
            {
                f.setSelectedGeoCell(null);
            }
        }