Exemplo n.º 1
0
 private void newPassOkButton_Click(object sender, EventArgs e)
 {
     try
     {
         isNotEquals();
         if (resetLock == false)
         {
             DbConnector.connSelector.Open();
             MySqlCommand mysql_query = DbConnector.connSelector.CreateCommand();
             mysql_query.CommandText = $"UPDATE accounts SET Password = '******' Where Email = '{emailBox.Text}'";
             MySqlDataReader mysql_result;
             mysql_result = mysql_query.ExecuteReader();
             MessageBox.Show("Passowrd has been reset");
             mysql_result.Close();
             DbConnector.conn.Close();
             this.Close();
             AuthForm form = new AuthForm();
             form.Show();
         }
         else
         {
             MessageBox.Show("Password is not valid");
         }
     }
     catch
     {
         MessageBox.Show("Connection error");
     }
 }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var formm = new AuthForm();

            formm.Show();
            this.Close();
        }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != "")
     {
         if (int.Parse(textBox1.Text) == Account.verificationCode)
         {
             try
             {
                 string      query  = $"INSERT INTO accounts (Nickname,Name,Surname,Email,Password,Gender,Date,Admin,Online) VALUES ('{Account.nickname}','{Account.name}','{Account.surname}','{Account.email}','{Account.password}','{Account.gender}','{Account.date}','User','Offline')";
                 MySqlScript script = new MySqlScript(DbConnector.conn, query);
                 int         count  = script.Execute();
                 MessageBox.Show("Account has been Registered!");
                 DbConnector.conn.Close();
                 var auth = new AuthForm();
                 auth.Show();
                 this.Close();
             }
             catch
             {
                 MessageBox.Show("Registration Error");
             }
         }
         else
         {
             MessageBox.Show("Incorrect verification code");
         }
     }
     else
     {
         MessageBox.Show("Fill the code");
     }
 }
Exemplo n.º 4
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var signForm = new AuthForm();

            signForm.Show();
            this.Close();
        }
Exemplo n.º 5
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     try
     {
         MySqlCommand mysql_query = DbConnector.connSelector.CreateCommand();
         mysql_query.CommandText = $"SELECT ID,Nickname,Text FROM globalchat";
         MySqlDataReader mysql_result;
         mysql_result = mysql_query.ExecuteReader();
         while (mysql_result.Read())
         {
             if (int.Parse(mysql_result.GetString(0).ToString()) > Account.id)
             {
                 Account.id                 = int.Parse(mysql_result.GetString(0).ToString());
                 chatRichBox.Text          += mysql_result.GetString(1).ToString() + ": " + mysql_result.GetString(2).ToString() + '\n';
                 chatRichBox.SelectionStart = chatRichBox.TextLength;
                 chatRichBox.ScrollToCaret();
             }
         }
         mysql_result.Close();
     }
     catch
     {
         MessageBox.Show("Connection interrupted");
         var ff = new AuthForm();
         ff.Show();
         this.Close();
     }
 }
Exemplo n.º 6
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         var ff = new AuthForm();
         ff.Show();
         this.Hide();
     }
     catch
     {
     }
 }