Exemple #1
0
 private void button_Login_Click(object sender, EventArgs e)
 {
     // юзер не найден
     try
     {
         var             name            = textBox_NameInput.Text;
         var             userId          = Data.userService.Login(name);
         PersonalAccount personalAccount = new PersonalAccount(userId, name);
         personalAccount.Owner = this;
         personalAccount.Show();
         Hide();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #2
0
 private void button_Register_Click(object sender, EventArgs e)
 {
     // Не удалось зарег.
     try
     {
         var             name            = textBox_nameInput.Text;
         var             userId          = Data.userService.Registrate(name);
         PersonalAccount personalAccount = new PersonalAccount(userId, name);
         personalAccount.Owner = this;
         personalAccount.Show();
         Hide();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }