public MainWindow() { InitializeComponent(); QueryBD.window = this; gr.Children.Add(QueryBD.fr); QueryBD.Navigate(QueryBD.log); }
void Reset_Click(object sender, RoutedEventArgs e) { if (QueryBD.res == null) { QueryBD.res = new Reset(); } QueryBD.Navigate(QueryBD.res); }
void WindowCtrl_Click(object o, RoutedEventArgs e) { if (QueryBD.wCtrl == null) { QueryBD.wCtrl = new WIndowCtrl(); } QueryBD.Navigate(QueryBD.wCtrl); }
void Tat_Click(object o, RoutedEventArgs e) { if (QueryBD.tat == null) { QueryBD.tat = new Татами(); } QueryBD.Navigate(QueryBD.tat); }
void GU_Click(object o, RoutedEventArgs e) { if (QueryBD.гручастник == null) { QueryBD.гручастник = new ГруппаУчастников(); } QueryBD.Navigate(QueryBD.гручастник); }
void Uch_Click(object o, RoutedEventArgs e) { if (QueryBD.участник == null) { QueryBD.участник = new Участники(); } QueryBD.Navigate(QueryBD.участник); }
void Reg_Click(object sender, RoutedEventArgs e) { if (QueryBD.reg == null) { QueryBD.reg = new Registration(); } QueryBD.Navigate(QueryBD.reg); }
void Button_Click(object o, RoutedEventArgs e) { QueryBD.user = null; QueryBD.tat = null; QueryBD.гручастник = null; QueryBD.участник = null; QueryBD.Navigate(QueryBD.log); }
void Reset_Click(object sender, RoutedEventArgs e) { if (Login.Text == "" || Password.Password == "" || TryPassword.Password == "" || Password.Password != TryPassword.Password) { Error.Content = "Error: Entry login, password, email, trypassword, password != trypassword"; return; } var users = QueryBD.bd.User.Where(u => u.Login == Login.Text && u.Email == Email.Text); if (users.Count() == 0) { Error.Content = "Error: неверные данные."; return; } QueryBD.user = users.First(); QueryBD.user.Password = QueryBD.GetMd5Hash(Password.Password); QueryBD.bd.SaveChanges(); QueryBD.Navigate(QueryBD.log); }
void Login_Click(object o, RoutedEventArgs e) { if (login.Text == "" || Password.Password == "") { return; } var pass = QueryBD.GetMd5Hash(Password.Password); if (QueryBD.bd.User.Where(u => u.Login == login.Text && u.Password == pass).Count() != 0) { if (QueryBD.mainctrl == null) { QueryBD.mainctrl = new MainCtrl(); } QueryBD.Navigate(QueryBD.mainctrl); } }
void Reg_Click(object sender, RoutedEventArgs e) { if (Login.Text == "" || Email.Text == "" || Password.Password == "" || TryPassword.Password == "" || Password.Password != TryPassword.Password) { Error.Content = "Error: Entry login, email, password, trypassword, password != trypassword"; return; } if (QueryBD.bd.User.Where(u => u.Login == Login.Text).Count() != 0) { Error.Content = "Error: такой логин существует."; return; } QueryBD.user = new User() { Login = Login.Text, Email = Email.Text, Password = QueryBD.GetMd5Hash(Password.Password) }; QueryBD.bd.User.Add(QueryBD.user); QueryBD.bd.SaveChanges(); QueryBD.Navigate(QueryBD.log); }
void Login_Click(object sender, RoutedEventArgs e) => QueryBD.Navigate(QueryBD.log);