Ejemplo n.º 1
0
        public void RefreshTable(object sender, EventArgs e)//сбивается поиск тут
        {
            /*if ((ActiveUser.wnAddMenu == null) && (ActiveUser.wnDistribution == null) &&
             *  (ActiveUser.wnDeleteTransaction == null) && (ActiveUser.wnSettings == null))
             * {
             *  this.IsEnabled = true;
             * }*/
            //if (!search_start)
            //{
            lStatusBar.Content = "Обновление таблиц...";
            switch (ActiveUser.UserType)
            {
            case 1:
                dgUser1.ItemsSource = DataWork.GetInfoUser1();
                break;

            case 2:
                dgUser2.ItemsSource = DataWork.GetInfoUser2(ActiveUser.UserID);
                break;

            case 3:
                dgUser2.ItemsSource = DataWork.GetInfoUser2(ActiveUser.UserID);
                break;

            case 22:
                dgUser2.ItemsSource = DataWork.GetInfoUser2(ActiveUser.UserID);
                break;
            }
            lStatusBar.Content = "Таблицы обновлены";
            //}
        }
Ejemplo n.º 2
0
        private void ShowMeMainWindow()
        {
            ClearWorkSpace();
            WindowMode = (int)Mods.Main;
            //отобразить нужные элементы
            //bSearch.Visibility = Visibility.Visible;
            //bAdd.Visibility = Visibility.Visible;
            //bDelete.Visibility = Visibility.Visible;
            switch (ActiveUser.UserType)
            {
            case 1:
                //добавить, настройки пользователя, выход, обновить, поиск.
                bDReport.Visibility = Visibility.Collapsed;
                //bDelete.Visibility = Visibility.Collapsed;
                dgUser1.Visibility           = Visibility.Visible;
                dgUser1.ItemsSource          = DataWork.GetInfoUser1();
                Distribution_menu.Visibility = Visibility.Collapsed;
                break;

            case 2:
                dgUser2.Visibility  = Visibility.Visible;
                dgUser2.ItemsSource = DataWork.GetInfoUser2(ActiveUser.UserID);
                //все кнопки на панели(добавить, удалить, поиск, обновить, настройки пользователя, выход, оба отчета, печать) В окне "настройки пользователя" отсутствует кнопка "к настройкам администратора"
                break;

            case 3:
                dgUser2.Visibility       = Visibility.Visible;
                dgUser2.ItemsSource      = DataWork.GetInfoUser2(ActiveUser.UserID);
                AdminSettings.Visibility = Visibility.Visible;
                break;

            case 4:
                ShowMeBriefReport();
                bReport.Background = SystemColors.ControlLightLightBrush;
                //bAdd.Visibility = Visibility.Collapsed;
                bMain.Visibility = Visibility.Collapsed;
                bReport.Margin   = new Thickness(83, 0, 0, 0);
                bDReport.Margin  = new Thickness(203, 0, 0, 0);
                //bDelete.Visibility = Visibility.Collapsed;
                //bSearch.Visibility = Visibility.Collapsed;
                Distribution_menu.Visibility = Visibility.Collapsed;
                Transaction.Visibility       = Visibility.Collapsed;
                //оба отчета, обновить, печать, настройки пользователя, выход
                break;

            case 22:
                //Projects.Visibility = Visibility.Visible;
                bDReport.Visibility          = Visibility.Collapsed;
                bDReport.IsEnabled           = false;
                dgUser2.Visibility           = Visibility.Visible;
                dgUser2.ItemsSource          = DataWork.GetInfoUser2(ActiveUser.UserID);
                Distribution_menu.Visibility = Visibility.Collapsed;
                break;
            }
        }