|
@@ -1,5 +1,6 @@
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
+using System.Data.Entity.Validation;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
@@ -49,6 +50,7 @@ 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();
|
|
@@ -63,3 +65,24 @@ namespace CopyCenter
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// try
|
|
|
|
+// {
|
|
|
|
+
|
|
|
|
+// DB.DB.SaveChanges();
|
|
|
|
+
|
|
|
|
+// }
|
|
|
|
+// catch (DbEntityValidationException ex)
|
|
|
|
+// {
|
|
|
|
+// foreach (DbEntityValidationResult validationError in ex.EntityValidationErrors)
|
|
|
|
+// {
|
|
|
|
+// Response.Write("Object: "+validationError.Entry.Entity.ToString());
|
|
|
|
+// Response.Write("
|
|
|
|
+//");
|
|
|
|
+// foreach (DbValidationError err in validationError.ValidationErrors)
|
|
|
|
+// {
|
|
|
|
+// Response.Write(err.ErrorMessage + "
|
|
|
|
+//");
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|