private void geriButton_Click(object sender, EventArgs e)
        {
            girisForm grsfrm = new girisForm();

            grsfrm.Show();
            this.Hide();
        }
예제 #2
0
        private void pictureBox5_Click(object sender, EventArgs e)
        {
            girisForm gr = new girisForm();

            gr.Show();
            this.Hide();
        }
예제 #3
0
 private void degistirButton_Click(object sender, EventArgs e)
 {
     if (label1.Text == "Bireysel Kullanıcı")
     {
         if (conn.State == ConnectionState.Closed)
         {
             conn.Open();
             if (kullanici_adiTextBox.Text != "" && eskiTextBox.Text != "" && yeniTextBox.Text != "" && yeni2TextBox.Text != "")
             {
                 var row = from x in database.BIREYSEL_KULLANICIs
                           where (x.kullanici_adi.ToString() == kullanici_adiTextBox.Text &&
                                  x.sifre.ToString() == eskiTextBox.Text)
                           select x.sifre;
                 if (row.Any())
                 {
                     if (yeni2TextBox.Text.ToString() == yeniTextBox.Text.ToString())
                     {
                         SqlCommand komut = new SqlCommand("update BIREYSEL_KULLANICI set sifre=@sifresi where sifre='" + eskiTextBox.Text + "'", conn);
                         komut.Parameters.AddWithValue("@sifresi", yeniTextBox.Text.ToString());
                         if (conn.State == ConnectionState.Closed)
                         {
                             conn.Open();
                         }
                         komut.ExecuteNonQuery();
                         MessageBox.Show("Şifreniz başarıyla değiştirilmiştir.", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         conn.Close();
                         girisForm gr = new girisForm();
                         gr.Show();
                         this.Hide();
                     }
                     else
                     {
                         label7.Text       = "Girdiğiniz şifreler birbirleriyle uyuşmamaktadır.";
                         yeni2TextBox.Text = "";
                         yeniTextBox.Text  = "";
                         conn.Close();
                     }
                 }
                 else
                 {
                     label7.Text               = "Kullanıcı adını veya eski şifreyi yanlış girdiniz.";
                     yeni2TextBox.Text         = "";
                     yeniTextBox.Text          = "";
                     eskiTextBox.Text          = "";
                     kullanici_adiTextBox.Text = "";
                     conn.Close();
                 }
             }
             else
             {
                 label7.Text = "Tüm alanları doldurmak zorunludur.";
                 conn.Close();
             }
         }
     }
     else if (label1.Text == "Kurumsal Kullanıcı")
     {
         if (conn.State == ConnectionState.Closed)
         {
             conn.Open();
             if (kullanici_adiTextBox.Text != "" && eskiTextBox.Text != "" && yeniTextBox.Text != "" && yeni2TextBox.Text != "")
             {
                 var row = from x in database.KURUMSAL_KULLANICIs
                           where (x.kullanici_adi.ToString() == kullanici_adiTextBox.Text &&
                                  x.sifre.ToString() == eskiTextBox.Text)
                           select x.sifre;
                 if (row.Any())
                 {
                     if (yeni2TextBox.Text.ToString() == yeniTextBox.Text.ToString())
                     {
                         SqlCommand komut = new SqlCommand("update KURUMSAL_KULLANICI set sifre=@sifresi where sifre='" + eskiTextBox.Text + "'", conn);
                         komut.Parameters.AddWithValue("@sifresi", yeniTextBox.Text.ToString());
                         if (conn.State == ConnectionState.Closed)
                         {
                             conn.Open();
                         }
                         komut.ExecuteNonQuery();
                         MessageBox.Show("Şifreniz başarıyla değiştirilmiştir.", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         conn.Close();
                         girisForm gr = new girisForm();
                         gr.Show();
                         this.Hide();
                     }
                     else
                     {
                         label7.Text       = "Girdiğiniz şifreler birbirleriyle uyuşmamaktadır.";
                         yeni2TextBox.Text = "";
                         yeniTextBox.Text  = "";
                         conn.Close();
                     }
                 }
                 else
                 {
                     label7.Text               = "Kullanıcı adını veya eski şifreyi yanlış girdiniz.";
                     yeni2TextBox.Text         = "";
                     yeniTextBox.Text          = "";
                     eskiTextBox.Text          = "";
                     kullanici_adiTextBox.Text = "";
                     conn.Close();
                 }
             }
             else
             {
                 label7.Text = "Tüm alanları doldurmak zorunludur.";
                 conn.Close();
             }
         }
     }
 }