示例#1
0
文件: Registry.cs 项目: jado11A/VS1
        private void btn_reg_send_Click(object sender, EventArgs e)
        {
            Form open_calendar = new wdw_calendar();

            open_calendar.Show();
            Close();
        }
示例#2
0
        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);
            }
        }
示例#3
0
 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);
     }
 }
示例#4
0
        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);
            }
        }