private void Button_Click(object sender, RoutedEventArgs e) { Realtors re = new Realtors(); this.Hide(); re.Show(); }
private void Back_Click(object sender, RoutedEventArgs e) { if (SecurityContext.autovxod == 3) //realtor { Realtors re = new Realtors(); this.Hide(); re.Show(); } if (SecurityContext.autovxod == 2) //realtor { FormsRealtors re = new FormsRealtors(); this.Hide(); re.Show(); } }
private void Button_Click(object sender, RoutedEventArgs e) { if (SecurityContext.autovxod == 1) //клиент { ClientsForms re = new ClientsForms(); this.Hide(); re.Show(); } if (SecurityContext.autovxod == 3) { Realtors re = new Realtors(); this.Hide(); re.Show(); } }
private void aut_Click(object sender, RoutedEventArgs e) { try { RealtorEntities db = new RealtorEntities(); var rol = db.Manager.Where(us => us.Login == login.Text && us.Password == password.Text).FirstOrDefault().rol; if (rol == "Manager") { Realtors realtor = new Realtors(); this.Hide(); realtor.Show(); } else { MessageBox.Show("Логин или пароль неверны"); } } catch { MessageBox.Show("Данный логин уже существует"); } }
private void aut_Click(object sender, RoutedEventArgs e) //авторизация { try { if (SecurityContext.autovxod == 1) //клиент { RealtorEntities db = new RealtorEntities(); if (password.Password != "") { if (login.Text != "") { var rol = db.Client.Where(us => us.Login == login.Text && us.Password == password.Password).FirstOrDefault().id; ClientsForms cli = new ClientsForms(); this.Hide(); cli.Show(); SecurityContext.idClient = rol; } else { MessageBox.Show("Поле логин не введено"); } } else { MessageBox.Show("Поле пароль не введено"); } } if (SecurityContext.autovxod == 2) //realtor { RealtorEntities db = new RealtorEntities(); if (password.Password != "") { if (login.Text != "") { var rol = db.Realtor.Where(us => us.Login == login.Text && us.Password == password.Password).FirstOrDefault().id; FormsRealtors realtor = new FormsRealtors(); this.Hide(); realtor.Show(); SecurityContext.idRealtor = rol; } else { MessageBox.Show("Поле логин не введено"); } } else { MessageBox.Show("Поле пароль не введено"); } } if (SecurityContext.autovxod == 3) //менеджер { RealtorEntities db = new RealtorEntities(); if (password.Password != "") { if (login.Text != "") { var rol = db.Manager.Where(us => us.Login == login.Text && us.Password == password.Password).FirstOrDefault().rol; if (rol == "Manager") { Realtors realtor = new Realtors(); this.Hide(); realtor.Show(); } } else { MessageBox.Show("Поле логин не введено"); } } else { MessageBox.Show("Поле пароль не введено"); } } } catch { MessageBox.Show("Логин или пароль не верны"); } }