private void buttonRegistrate_Click(object sender, EventArgs e) { if (textBoxPassword.Text != textBoxPasswordR.Text) { MessageBox.Show("Пароль введен неправильно."); return; } var au = new Authorization() { Login = textBoxLogin.Text, Password = textBoxPassword.Text, Role = 1 }; var cust = new Customer() { FirstName = textBoxFName.Text, LastName = textBoxLName.Text, Phone = textBoxPhone.Text }; if (Сlient.RegistrateCustomer(Parser.ParseCustomer(cust), Parser.ParseAuth(au)) == false) { MessageBox.Show("Такой логин уже используется"); } else { Program.userID = Сlient.Authorize(Parser.ParseAuth(au)); Program.formEnter.Show(); Hide(); } }
private void buttonEnter_Click(object sender, EventArgs e) { var au = new Authorization() { Login = textBoxLogin.Text, Password = textBoxPassword.Text, Role = 1 }; Program.userID = Сlient.Authorize(Parser.ParseAuth(au)); if (Program.userID == Guid.Empty) { MessageBox.Show("Логин или пароль введены неправильно."); } }