Пример #1
0
        private void BtnAddUser_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var winAddAdmin = new WinAddAdmin {
                PostTypeId = null
            };

            winAddAdmin.ShowDialog();
        }
Пример #2
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                _userData = await DUser.GetData();
            }
            catch
            {
                //
            }
            TxtUserName.Focus();
            DUserLogin.SetSecurityAccess();
            if (!(DUserLogin.SecurityAccess(ref _counter) >= 5))
            {
                _getDate                  = DUserLogin.Date();
                BtnLogin.IsEnabled        = false;
                _dispatcherTimer.Tick    += dispatcherTimer_Tick;
                _dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
                _dispatcherTimer.Start();
            }

            var adminRegistered = DUserLogin.ChekAdminRegistered();

            if (adminRegistered != null && (bool)adminRegistered)
            {
                return;
            }
            Hide();
            var winAddAdmin = new WinAddAdmin {
                PostTypeId = 1
            };

            winAddAdmin.ShowDialog();
            var chekAdminRegistered = DUserLogin.ChekAdminRegistered();

            if (chekAdminRegistered != null && (bool)chekAdminRegistered)
            {
                Show();
            }
            try
            {
                _userData = await DUser.GetData();
            }
            catch
            {
                //
            }
        }