示例#1
0
 public MainWindow()
 {
     InitializeComponent();
     QueryBD.window = this;
     gr.Children.Add(QueryBD.fr);
     QueryBD.Navigate(QueryBD.log);
 }
示例#2
0
 void Reset_Click(object sender, RoutedEventArgs e)
 {
     if (QueryBD.res == null)
     {
         QueryBD.res = new Reset();
     }
     QueryBD.Navigate(QueryBD.res);
 }
示例#3
0
 void WindowCtrl_Click(object o, RoutedEventArgs e)
 {
     if (QueryBD.wCtrl == null)
     {
         QueryBD.wCtrl = new WIndowCtrl();
     }
     QueryBD.Navigate(QueryBD.wCtrl);
 }
示例#4
0
 void Tat_Click(object o, RoutedEventArgs e)
 {
     if (QueryBD.tat == null)
     {
         QueryBD.tat = new Татами();
     }
     QueryBD.Navigate(QueryBD.tat);
 }
示例#5
0
 void GU_Click(object o, RoutedEventArgs e)
 {
     if (QueryBD.гручастник == null)
     {
         QueryBD.гручастник = new ГруппаУчастников();
     }
     QueryBD.Navigate(QueryBD.гручастник);
 }
示例#6
0
 void Uch_Click(object o, RoutedEventArgs e)
 {
     if (QueryBD.участник == null)
     {
         QueryBD.участник = new Участники();
     }
     QueryBD.Navigate(QueryBD.участник);
 }
示例#7
0
 void Reg_Click(object sender, RoutedEventArgs e)
 {
     if (QueryBD.reg == null)
     {
         QueryBD.reg = new Registration();
     }
     QueryBD.Navigate(QueryBD.reg);
 }
示例#8
0
 void Button_Click(object o, RoutedEventArgs e)
 {
     QueryBD.user       = null;
     QueryBD.tat        = null;
     QueryBD.гручастник = null;
     QueryBD.участник   = null;
     QueryBD.Navigate(QueryBD.log);
 }
示例#9
0
        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);
        }
示例#10
0
        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);
            }
        }
示例#11
0
 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);
 }
示例#12
0
 void Login_Click(object sender, RoutedEventArgs e) => QueryBD.Navigate(QueryBD.log);