예제 #1
0
        private void YakitTuru_FormClosing(object sender, FormClosingEventArgs e)
        {
            ayarlar ayar = new ayarlar();

            this.Hide();
            ayar.Show();
        }
예제 #2
0
        private void aracuretimyili_FormClosing(object sender, FormClosingEventArgs e)
        {
            ayarlar ayar = new ayarlar();

            this.Hide();
            ayar.Show();
        }
예제 #3
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            ayarlar ayarlarimiz = new ayarlar();

            //    this.Hide();
            ayarlarimiz.Show();
        }
예제 #4
0
        private void markaekle_FormClosing(object sender, FormClosingEventArgs e)
        {
            ayarlar ayar = new ayarlar();

            this.Hide();
            ayar.Show();
        }
예제 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox2.Text == "" && comboBox1.Text == "")
            {
                MessageBox.Show("Lütfen ilgili alanları doldurunuz..");
            }

            else
            {
                if (baglanti.State == ConnectionState.Closed)
                {
                    baglanti.Open();
                }
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = baglanti;

                cmd.CommandText = "SELECT ID FROM AracMarka WHERE AracMarka='" + comboBox1.Text + "' and AracModel ='" + comboBox2.Text + "'";
                okuyucubey      = cmd.ExecuteReader();
                if (okuyucubey.Read())
                {
                    MessageBox.Show("Bu Marka ve Modelden Bulunmaktadır..");
                    okuyucubey.Close();
                }

                else
                {
                    okuyucubey.Close();
                    SqlCommand ekle = new SqlCommand();
                    ekle.Connection  = baglanti;
                    ekle.CommandText = "INSERT INTO AracMarka(AracMarka,AracModel)VALUES(@AracMarka,@AracModel)";
                    ekle.Parameters.AddWithValue("@AracMarka", comboBox1.Text);
                    ekle.Parameters.AddWithValue("@AracModel", comboBox2.Text);
                    ekle.ExecuteNonQuery();
                    DialogResult cevap = MessageBox.Show("Ekleme işlemi başarılı. Kayıt Yapmaya Devam Etmek İster Misiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (cevap == DialogResult.No)
                    {
                        ayarlar ayar = new ayarlar();
                        this.Hide();
                        ayar.Show();
                    }

                    baglanti.Close();
                    doldur();
                }
            }
        }
예제 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "")
            {
                MessageBox.Show("Lütfen Bir Değer Giriniz..");
            }
            else
            {
                if (baglanti.State == ConnectionState.Closed)
                {
                    baglanti.Open();
                }
                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = baglanti;
                cmd.CommandText = "SELECT ID FROM UretimYili WHERE UretimYili = '" + comboBox1.Text + "'";
                okuyucubey      = cmd.ExecuteReader();
                if (okuyucubey.Read())
                {
                    MessageBox.Show("Bu Araç Üretim Yılından Bulunmaktadır");
                    okuyucubey.Close();
                }

                else
                {
                    okuyucubey.Close();
                    SqlCommand ekle = new SqlCommand();
                    ekle.Connection  = baglanti;
                    ekle.CommandText = "INSERT INTO UretimYili(UretimYili)VALUES(@UretimYili)";
                    ekle.Parameters.AddWithValue("@UretimYili", comboBox1.Text);
                    ekle.ExecuteNonQuery();
                    DialogResult cevap = MessageBox.Show("Ekleme işlemi başarılı. Kayıt Yapmaya Devam Etmek İster Misiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (cevap == DialogResult.No)
                    {
                        ayarlar ayar = new ayarlar();
                        this.Hide();
                        ayar.Show();
                    }


                    baglanti.Close();
                    doldur();
                }
            }
        }
예제 #7
0
        private void button2_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand komut = new SqlCommand();

            komut.Connection  = baglanti;
            komut.CommandText = "DELETE FROM YakitTuru WHERE AracYakitTuru = '" + comboBox1.SelectedItem + "'";
            komut.ExecuteNonQuery();
            komut.Dispose();
            DialogResult cevap = MessageBox.Show("Silme işlemi başarılı. Kayıt Yapmaya Devam Etmek İster Misiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (cevap == DialogResult.No)
            {
                ayarlar ayar = new ayarlar();
                this.Hide();
                ayar.Show();
            }
            baglanti.Close();
            doldur();
        }
예제 #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            baglanti.Open();
            SqlCommand ekle = new SqlCommand();

            ekle.Connection  = baglanti;
            ekle.CommandText = "INSERT INTO AracModel(AracMdodel)VALUES(@AracMdodel)";
            ekle.Parameters.AddWithValue("@UretimYili", comboBox1.Text);
            ekle.ExecuteNonQuery();
            DialogResult cevap = MessageBox.Show("Ekleme işlemi başarılı.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (cevap == DialogResult.OK)
            {
                ayarlar ayar = new ayarlar();
                this.Hide();
                ayar.Show();
            }

            //     comboBox1.Items.Clear();
            baglanti.Close();
        }
예제 #9
0
        private void button2_Click(object sender, EventArgs e) //MARKA VE MODEL SİLME
        {
            baglanti.Open();
            SqlCommand komut = new SqlCommand();

            komut.Connection  = baglanti;
            komut.CommandText = "DELETE FROM AracMarka WHERE AracMarka = '" + comboBox1.SelectedItem + "' and AracModel ='" + comboBox2.SelectedItem + "'";
            komut.ExecuteNonQuery();
            komut.Dispose();
            DialogResult cevap = MessageBox.Show("Silme işlemi başarılı.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (cevap == DialogResult.OK)
            {
                ayarlar ayar = new ayarlar();
                this.Hide();
                ayar.Show();
            }
            comboBox1.Refresh();

            baglanti.Close();
            doldur();
        }