Exemplo n.º 1
0
        private void SetBindings()
        {
            _currentDate = App.BaseClass.GetDateFromSqlServer();
            _timeTimer.Start();
            TimeTimer_Tick(null, null);

            if (App.AppArguments[0] == "-m")
            {
                MenuListBox.ItemsSource = AdministrationClass.GetAvailableModulesForWorker().DefaultView;
                AdministrationClass.GetFavoritesModulesIdsForWorker();

                MenuGroupsListBox.SelectedIndex = 0;
                MenuGroupsListBox_SelectionChanged(null, null);

                LoadPersonalInformation();

                SetDefaultViewWorkingDayGrid();
                CalculateWorkerTime();
            }
            else if (App.AppArguments[0] == "-w")
            {
                //GoHomeButton_Click(null, null);

                UserGrid.Visibility = Visibility.Collapsed;
                MinimazeMenu();

                _newsFeed.ShowNews();

                WorkerLoginGrid.Visibility = Visibility.Visible;
            }
            //GetWorkerStat();
        }
Exemplo n.º 2
0
        private void EnterButton_Click(object sender, RoutedEventArgs e)
        {
            if (WorkersNamesListBox.SelectedItems.Count == 0)
            {
                return;
            }

            if (WorkerPasswordBox.Password == string.Empty)
            {
                MessageBox.Show("Необходимо ввести пароль", "Информация", MessageBoxButton.OK,
                                MessageBoxImage.Information);
                WorkerPasswordBox.Focus();
                return;
            }

            //if (!_sc.CheckPassword(WorkerPasswordBox.Password, Convert.ToInt32(WorkersNamesListBox.SelectedValue)))
            //{
            //    MessageBox.Show("Неверный пароль!", "Информация", MessageBoxButton.OK,
            //        MessageBoxImage.Information);
            //    WorkerPasswordBox.Password = string.Empty;
            //    WorkerPasswordBox.Focus();
            //    return;
            //}


            //LoadPageForWorker(Convert.ToInt32(WorkersNamesListBox.SelectedValue));

            AdministrationClass.OpenNewProgramEntry(Convert.ToInt32(WorkersNamesListBox.SelectedValue));
            AdministrationClass.OpenNewModuleEntry(AdministrationClass.Modules.NewsFeed);

            MenuListBox.ItemsSource = AdministrationClass.GetAvailableModulesForWorker().DefaultView;
            AdministrationClass.GetFavoritesModulesIdsForWorker();


            MenuGroupsListBox.SelectedIndex = 0;
            MenuGroupsListBox_SelectionChanged(null, null);

            LoadPersonalInformation();

            SetDefaultViewWorkingDayGrid();
            CalculateWorkerTime();

            var lastExit = AdministrationClass.LastModuleExit(AdministrationClass.Modules.NewsFeed);

            _newsFeed.ShowNews(lastExit);
            NotificationManager.ShowNotifications(AdministrationClass.CurrentWorkerId);

            WorkerLoginGrid.Visibility = Visibility.Collapsed;
            UserGrid.Visibility        = Visibility.Visible;

            if (MenuPopupBorder.Child != null)
            {
                MenuPopupBorder.Child = null;
                MainGrid.Children.Add(MenuGrid);
            }

            MenuListBox.SelectedItems.Clear();


            WorkersNamesListBox.SelectedIndex = 0;
            WorkerPasswordBox.Password        = string.Empty;


            ClearModules();
            //HideLoginGrid();
        }