Exemple #1
0
 private void nowCreateNewUserAccount()
 {
     if (metroTextBox5.Text.Length < 3)
     {
         MetroMessageBox.Show(this, "Name must be minimum 3 character long..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (metroTextBox4.Text.Length < 8)
     {
         MetroMessageBox.Show(this, "password must be minimum 8 character long..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (metroTextBox3.Text != metroTextBox3.Text)
     {
         MetroMessageBox.Show(this, "password does not matched..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         saveFileDialog1.Title = "Store at a safe place";
         if (saveFileDialog1.ShowDialog() == DialogResult.OK)
         {
             StreamWriter sw = new StreamWriter(saveFileDialog1.FileName);
             sw.WriteLine(key);
             sw.Close();
         }
         SavingFeatures sf = new SavingFeatures();
         sf.NewUserAccount(metroTextBox5.Text, metroTextBox4.Text);
         Application.Restart();
     }
 }
 private void materialRaisedButton1_Click(object sender, EventArgs e)
 {
     if (metroTextBox1.Text.Length < 3)
     {
         MetroMessageBox.Show(this, "Name must be minimum 3 character long..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (metroTextBox2.Text.Length < 8)
     {
         MetroMessageBox.Show(this, "password must be minimum 8 character long..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (metroTextBox2.Text != metroTextBox3.Text)
     {
         MetroMessageBox.Show(this, "password does not matched..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         SavingFeatures sf = new SavingFeatures();
         sf.NewUserAccount(metroTextBox1.Text, metroTextBox2.Text);
         this.Hide();
         MainWindow mw = new MainWindow();
         mw.ShowDialog();
     }
 }