private void btn_reg_send_Click(object sender, EventArgs e) { Form open_calendar = new wdw_calendar(); open_calendar.Show(); Close(); }
private void Btn_log_send_Click(object sender, EventArgs e) { try { bool containsSearchResult = tb_log_benutzername.ToString().Contains("#"); if (!containsSearchResult) { if (Int32.TryParse(tb_log_ID.Text, out int result)) { switch (clientLogic.LoginRemote(new User(tb_log_benutzername.Text, tb_log_passwort.Text, result))) { case Request.Success: Form open_calendar = new wdw_calendar(true); open_calendar.Show(); tb_log_benutzername.Text = ""; tb_log_passwort.Text = ""; break; default: tb_log_benutzername.Text = ""; tb_log_passwort.Text = ""; break; } } else { MessageBox.Show("Fehler beim ServerID, bitte überprüfen"); } } else { MessageBox.Show("Der Benutzername darf keine # enthalten."); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void BTN_offline_Click(object sender, EventArgs e) { try { if (clientLogic.LoginLocal(new User(tb_log_benutzername.Text, tb_log_passwort.Text))) { Form open_calendar = new wdw_calendar(false); open_calendar.Show(); tb_log_benutzername.Text = ""; tb_log_passwort.Text = ""; } else { tb_log_benutzername.Text = ""; tb_log_passwort.Text = ""; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Btn_reg_send_Click(object sender, EventArgs e) { try { User user = new User(rTB_benutzername.Text, rTB_passwort.Text); switch (clientLogic.RegisterRemote(user, rTB_passwort_bestaetigen.Text)) { case Request.Success: user = clientLogic.GetUser(); MessageBox.Show("Registrierung erfolgreich-Willkommen" + Environment.NewLine + "Es wurde folgendes eingetragen" + Environment.NewLine + "Username: "******"Passwort: " + user.password + Environment.NewLine + "ServerID: " + user.serverID); Form open_calendar = new wdw_calendar(true); open_calendar.Show(); Close(); break; case Request.UserExistent: MessageBox.Show("Nutzer existiert bereits." + Environment.NewLine + "Bitte wählen Sie einen anderen Nutzernamen."); Close(); break; default: rTB_benutzername.Text = ""; rTB_passwort.Text = ""; rTB_passwort_bestaetigen.Text = ""; break; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }