private void signInButton_Click(object sender, RoutedEventArgs e) { if (LoginTextBox.Text == "" || PasswordPasswordBox.Password == "") return; _loading = new Loading(this); _loading.Show(); ConnectionSocket = Functions.ReturnNewSocket(ConnectionSocket); Functions.SerializeAndSend(new Authorization(LoginTextBox.Text, PasswordPasswordBox.Password), ConnectionSocket); object obj; { byte[] byteBuffer = new byte[1024]; if (ConnectionSocket.Receive(byteBuffer) == 0) { MessageBox.Show("Получено 0 байт"); } obj = Functions.Deserialize(byteBuffer); } if (!(obj is AccountInformation)) return; AccountInformation accountInf = obj as AccountInformation; if(accountInf.IsNull) { MessageBox.Show("Ошибка в логине или пароле!", "Ошибка!", MessageBoxButton.OK, MessageBoxImage.Error); _loading.Close(); LoginTextBox.Focus(); } else { _whetherToCreate = true; _ai = accountInf; Close(); } }
public Registration(Window parent) { InitializeComponent(); Loaded += (wv, ve) => { loading = new Loading(this); }; Owner = parent; dateDatePicker.SelectedDate = DateTime.Now; }