|
@@ -15,7 +15,7 @@ using System.Windows.Shapes;
|
|
namespace CopyCenter
|
|
namespace CopyCenter
|
|
{
|
|
{
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// Логика взаимодействия для RegistrationWindow.xaml
|
|
|
|
|
|
+ /// Interaction logic for RegistrationWindow.xaml
|
|
/// </summary>
|
|
/// </summary>
|
|
public partial class RegistrationWindow : Window
|
|
public partial class RegistrationWindow : Window
|
|
{
|
|
{
|
|
@@ -23,13 +23,14 @@ namespace CopyCenter
|
|
public RegistrationWindow()
|
|
public RegistrationWindow()
|
|
{
|
|
{
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
|
|
+ db = new gr672_liiEntities();
|
|
}
|
|
}
|
|
|
|
|
|
private void Registration_Click(object sender, RoutedEventArgs e)
|
|
private void Registration_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
if (login.Text == "" || password.Password == "" || lastname.Text == "" || firstname.Text == "" || middlename.Text == "" || contactnumber.Text == "")
|
|
if (login.Text == "" || password.Password == "" || lastname.Text == "" || firstname.Text == "" || middlename.Text == "" || contactnumber.Text == "")
|
|
{
|
|
{
|
|
- MessageBox.Show("Пустые поля");
|
|
|
|
|
|
+ MessageBox.Show("Введено неверное значение");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (db.User.Select(item => item.Login).Contains(login.Text))
|
|
if (db.User.Select(item => item.Login).Contains(login.Text))
|
|
@@ -48,11 +49,12 @@ namespace CopyCenter
|
|
};
|
|
};
|
|
db.User.Add(newUser);
|
|
db.User.Add(newUser);
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
- MessageBox.Show("Вы успешно зарегистрировались!");
|
|
|
|
|
|
+ MessageBox.Show("Вы успешно зарегистрировались");
|
|
AuthorizationWindow aw = new AuthorizationWindow();
|
|
AuthorizationWindow aw = new AuthorizationWindow();
|
|
aw.Show();
|
|
aw.Show();
|
|
this.Close();
|
|
this.Close();
|
|
}
|
|
}
|
|
|
|
+
|
|
private void Cancel(object sender, RoutedEventArgs e)
|
|
private void Cancel(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
AuthorizationWindow aw = new AuthorizationWindow();
|
|
AuthorizationWindow aw = new AuthorizationWindow();
|