예제 #1
0
파일: secim.cs 프로젝트: yldzkenan/VeriVeri
        private void button1_Click(object sender, EventArgs e)
        {
            siparis siparis = new siparis();

            siparis.Show();
            this.Hide();
        }
예제 #2
0
파일: siparis.cs 프로젝트: canndurmazz/Veri
        private void button2_Click(object sender, EventArgs e)
        {
            siparis kayitlimüsteri = new siparis();

            kayitlimüsteri.Show();
            this.Close();
        }
예제 #3
0
파일: istek.cs 프로젝트: yldzkenan/VERVER
        private void button1_Click(object sender, EventArgs e)
        {
            if (istekcombo.SelectedIndex == 0)
            {
                baglanti.Open();

                try
                {
                    if (baglanti.State == ConnectionState.Closed)
                    {
                        baglanti.Open();
                    }
                    string     kayit = "insert into Istek(ileti,departman_ad,departman_id) values (@ileti,@departman_ad,@departman_id)";
                    SqlCommand komut = new SqlCommand(kayit, baglanti);
                    komut.Parameters.AddWithValue("@ileti", ileti.Text);
                    komut.Parameters.AddWithValue("@departman_id", 1);
                    komut.Parameters.AddWithValue("@departman_ad", istekcombo.Text);
                    komut.ExecuteNonQuery();
                    baglanti.Close();
                    MessageBox.Show("Mesaj Başarıyla Gönderildi !");


                    this.Hide();
                }
                catch (Exception hata)
                {
                    MessageBox.Show("İşlem Sırasında Hata Oluştu." + hata.Message);
                }
                baglanti.Close();
            }
            if (istekcombo.SelectedIndex == 1)
            {
                baglanti.Open();

                try
                {
                    if (baglanti.State == ConnectionState.Closed)
                    {
                        baglanti.Open();
                    }
                    string     kayit = "insert into Istek(ileti,departman_ad,departman_id) values (@ileti,@departman_ad,@departman_id)";
                    SqlCommand komut = new SqlCommand(kayit, baglanti);
                    komut.Parameters.AddWithValue("@ileti", ileti.Text);
                    komut.Parameters.AddWithValue("@departman_id", 2);
                    komut.Parameters.AddWithValue("@departman_ad", istekcombo.Text);
                    komut.ExecuteNonQuery();
                    baglanti.Close();
                    MessageBox.Show("Mesaj Başarıyla Gönderildi !");

                    this.Hide();
                }
                catch (Exception hata)
                {
                    MessageBox.Show("İşlem Sırasında Hata Oluştu." + hata.Message);
                }
                baglanti.Close();
            }
            if (istekcombo.SelectedIndex == 2)
            {
                baglanti.Open();

                try
                {
                    if (baglanti.State == ConnectionState.Closed)
                    {
                        baglanti.Open();
                    }
                    string     kayit = "insert into Istek(ileti,departman_ad,departman_id) values (@ileti,@departman_ad,@departman_id)";
                    SqlCommand komut = new SqlCommand(kayit, baglanti);
                    komut.Parameters.AddWithValue("@ileti", ileti.Text);
                    komut.Parameters.AddWithValue("@departman_id", 3);
                    komut.Parameters.AddWithValue("@departman_ad", istekcombo.Text);
                    komut.ExecuteNonQuery();
                    baglanti.Close();
                    MessageBox.Show("Mesaj Başarıyla Gönderildi !");

                    this.Hide();
                }
                catch (Exception hata)
                {
                    MessageBox.Show("İşlem Sırasında Hata Oluştu." + hata.Message);
                }
                baglanti.Close();
            }
            if (istekcombo.SelectedIndex == 3)
            {
                baglanti.Open();

                try
                {
                    if (baglanti.State == ConnectionState.Closed)
                    {
                        baglanti.Open();
                    }
                    string     kayit = "insert into Istek(ileti,departman_ad,departman_id) values (@ileti,@departman_ad,@departman_id)";
                    SqlCommand komut = new SqlCommand(kayit, baglanti);
                    komut.Parameters.AddWithValue("@ileti", ileti.Text);
                    komut.Parameters.AddWithValue("@departman_id", 4);
                    komut.Parameters.AddWithValue("@departman_ad", istekcombo.Text);
                    komut.ExecuteNonQuery();
                    baglanti.Close();
                    MessageBox.Show("Mesaj Başarıyla Gönderildi !");

                    siparis siparis = new siparis();
                    siparis.Show();
                    this.Hide();
                }
                catch (Exception hata)
                {
                    MessageBox.Show("İşlem Sırasında Hata Oluştu." + hata.Message);
                }
                baglanti.Close();
            }
            if (istekcombo.SelectedIndex == 4)
            {
                baglanti.Open();
                try
                {
                    if (baglanti.State == ConnectionState.Closed)
                    {
                        baglanti.Open();
                    }


                    string     kayit = "insert into Istek(ileti,departman_ad,departman_id) values (@ileti,@departman_ad,@departman_id)";
                    SqlCommand komut = new SqlCommand(kayit, baglanti);
                    komut.Parameters.AddWithValue("@ileti", ileti.Text);
                    komut.Parameters.AddWithValue("@departman_id", 5);
                    komut.Parameters.AddWithValue("@departman_ad", istekcombo.Text);
                    komut.ExecuteNonQuery();
                    baglanti.Close();
                    MessageBox.Show("Mesaj Başarıyla Gönderildi !");
                    siparis siparis = new siparis();
                    siparis.Show();
                    this.Hide();
                }
                catch (Exception hata)
                {
                    MessageBox.Show("İşlem Sırasında Hata Oluştu." + hata.Message);
                }
            }
            baglanti.Close();
        }