Exemplo n.º 1
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Close();
            singin_frm frm = new singin_frm();

            frm.Show();
        }
Exemplo n.º 2
0
        private void singup_btn_Click(object sender, EventArgs e)
        {
            string name, surname, gsm, email, password, password2;

            name      = name_txtbx.Text;
            surname   = surname_txtbx.Text;
            gsm       = gsm_txtbx.Text;
            email     = email_txtbx.Text;
            password  = password__txtbx.Text;
            password2 = password2_txtbx.Text;

            if ((password == password2) && Utils.is_email(email) && gsm.Length == 11)
            {
                MessageBox.Show("Test");
                string   hash  = Utils.get_hash(password);
                string   tel   = gsm.Replace(" ", "");
                DateTime date  = DateTime.Now;
                string   query = "INSERT INTO User(id,name,surname,singup_date,gsm,email,password)" +
                                 " values(new_id,'new_name','new_surname',NOW(),'new_tel','new_email','new_password');";
                query = query.Replace("new_name", name);
                query = query.Replace("new_surname", surname);
                query = query.Replace("new_tel", tel);
                query = query.Replace("new_email", email);
                query = query.Replace("new_password", hash);

                Boolean a = DatabaseProcess.insert(query, "User");
                if (a == true)
                {
                    MessageBox.Show("Kayıt işleminiz başarıyla tamamlandı.\n     Artık giriş yapabilirsiniz.");
                    this.Close();
                    singin_frm singin_form = new singin_frm();
                    singin_form.Show();
                }
                else
                {
                    error_lbl.Text = DatabaseProcess.error_msg;
                }
            }
            else
            {
                if (password != password2)
                {
                    error_lbl.Text       = "Şifreler aynı değil!";
                    password__txtbx.Text = password2_txtbx.Text = "";
                }
                else if (!Utils.is_email(email))
                {
                    error_lbl.Text = "Girdiğiniz email hatalı!";
                }
            }
        }