private void StopMethodAnimation(object sender, EventArgs e) { Storyboard sb = this.FindResource("ShowPage") as Storyboard; sb.Begin(); loadedControl.StopAnimation(); ScrollViewerSheldue.Opacity = 1; StopAnimation.Stop(); }
//MouseClick Auth and Click Panel //Mouse Click Autorization private void ButtonAuth_Click(object sender, RoutedEventArgs e) { if (!String.IsNullOrWhiteSpace(TextBoxLogin.Text) && !String.IsNullOrWhiteSpace(PasswordBoxPassword.Password)) { if (CreateLoadAnimation(MainAuthRegGrid)) { try { ReferenseDALClass user = new ReferenseDALClass(); if (user.SetConnectionDBCheckUser(TextBoxLogin.Text, PasswordBoxPassword.Password)) { userInfoList = user.userListInformantion; if (!ToggleButtonYesNo.StateClosed) { SerializeToggleButtonCheck(userInfoList); } else { try { using (StreamWriter sw = new StreamWriter("SET_COOKIEUSER.xml")) { sw.WriteLine(string.Empty); } } catch { } } loadedControl.StopAnimation(); new MainWindow(userInfoList).Show(); this.Close(); } else { loadedControl.StopAnimation(); ErrorReg("Неверный логин или пароль!"); } } catch { loadedControl.StopAnimation(); ErrorReg("Ошибка авторизации!"); } } } else { if (String.IsNullOrWhiteSpace(TextBoxLogin.Text)) { BorderLoginTextBox.Background = Brushes.Red; } if (String.IsNullOrWhiteSpace(PasswordBoxPassword.Password)) { BorderPasswordPasswordBox.Background = Brushes.Red; } } }
public void ClickRightArrow(object sender, RoutedEventArgs e) { switch (stepNumber) { case 1: if (checkValidate.IsValidateEmail(TextBoxLogin.Text)) { CreateLoadAnimation(MainGridResetPassword); bool userExcl = refDALClass.SetConnectionDBCheckExcluziveUser(TextBoxLogin.Text); if (!userExcl) { refDALClass.SetConnectionDBCollectionInformationUser(TextBoxLogin.Text); Storyboard sb1 = this.FindResource("Step2") as Storyboard; sb1.Begin(); KindStep1.Foreground = Brushes.White; KindStep2.Foreground = Brushes.Chartreuse; KindStep3.Foreground = Brushes.White; ButtonArrowLeft.Visibility = Visibility.Visible; ButtonArrowRight.IsEnabled = false; stepNumber++; loadedControl.StopAnimation(); } else { BorderLoginTextBox.Background = Brushes.Red; loadedControl.StopAnimation(); } } else { BorderLoginTextBox.Background = Brushes.Red; } break; case 2: switch (ComboBoxPerson.SelectedIndex) { case 0: if (ComboBoxPerson.Text == refDALClass.userListInformantion.Status && ComboBoxNameOrGroup.Text == refDALClass.userListInformantion.Department) { Storyboard sb2 = this.FindResource("Step3") as Storyboard; sb2.Begin(); KindStep1.Foreground = Brushes.White; KindStep2.Foreground = Brushes.White; KindStep3.Foreground = Brushes.Chartreuse; stepNumber++; ButtonArrowRight.Visibility = Visibility.Hidden; ButtonresetPassword.Visibility = Visibility.Visible; ButtonresetPassword.IsEnabled = false; } else { ComboBoxPerson.Foreground = Brushes.Red; ComboBoxNameOrGroup.Foreground = Brushes.Red; } break; case 1: if (ComboBoxPerson.Text == refDALClass.userListInformantion.Status && ComboBoxNameOrGroup.Text == refDALClass.userListInformantion.Name) { Storyboard sb2 = this.FindResource("Step3") as Storyboard; sb2.Begin(); KindStep1.Foreground = Brushes.White; KindStep2.Foreground = Brushes.White; KindStep3.Foreground = Brushes.Chartreuse; stepNumber++; ButtonArrowRight.Visibility = Visibility.Hidden; ButtonresetPassword.Visibility = Visibility.Visible; ButtonresetPassword.IsEnabled = false; } else { ComboBoxPerson.Foreground = Brushes.Red; ComboBoxNameOrGroup.Foreground = Brushes.Red; } break; } break; } }