Example #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                if ((textBox1.Text == parca[0]) && (textBox2.Text == parca[1]))
                {
                    frmYazilimGüvenlik.OnlineID = MAC();
                    baglan.Open();

                    SqlCommand command = new SqlCommand("delete  from OnlineAcenteler where ID='" + frmYazilimGüvenlik.OnlineID + "'", baglan);
                    command.ExecuteNonQuery();
                    baglan.Close();
                    ClsInsert.SistemeOnlineOl();

                    new frmAna().ShowDialog();
                    Hide();
                }
                else
                {
                    MessageBox.Show("Lütfen Kullanıcı Adı/Şifreyi kontrol ediniz !!!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch { MessageBox.Show("Veritabanı bağlantı hatası oluştu.Lütfen daha sonra tekrar deneyiniz.", "Hata !", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (this.binis.Text == "")
            {
                MessageBox.Show("L\x00fctfen Biniş Noktasını Belirleyiniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (this.inis.Text == "")
            {
                MessageBox.Show("L\x00fctfen İniş Noktasını Belirleyiniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (this.oto_plaka.Text == "")
            {
                MessageBox.Show("L\x00fctfen Ara\x00e7 Plakasını Belirleyiniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (this.kalkıs_saati.Text == "")
            {
                MessageBox.Show("L\x00fctfen Ara\x00e7 Kalkış Saatini Belirleyiniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (this.koltuk_no.Text == "")
            {
                MessageBox.Show("L\x00fctfen Koltuk Numarasını Belirleyiniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (this.bilet_islem.Text == "")
            {
                MessageBox.Show("L\x00fctfen Bilet İşlem B\x00f6l\x00fcm\x00fcn\x00fc Belirleyiniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if ((this.fiyat.Text == "") && (this.bilet_islem.Text.Trim() != "Ücretsiz") && (this.bilet_islem.Text.Trim() != "Rezerve Bilet"))
            {
                MessageBox.Show("L\x00fctfen Bilet Fiyatını Belirleyiniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if ((no_dznle(telefon.Text).Count() >= 1) & (no_dznle(telefon.Text).Count() <= 9))
            {
                MessageBox.Show("L\x00fctfen Telefon Numarasını eksiksiz giriniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if ((tc_no.Text.Count() >= 1) & (tc_no.Text.Count() <= 10))
            {
                MessageBox.Show("L\x00fctfen TC Kimlik Numarasını eksiksiz giriniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                int num2;
                if (this.cinsiyet.Text == "Bay")
                {
                    num2 = 1;
                }
                else
                {
                    num2 = 0;
                }

                ClsInsert.yolcu_ekle(label11.Text, no_dznle(this.telefon.Text.Trim().ToUpper()), num2, this.isim.Text.Trim(), this.soyadı.Text.Trim(), tc_no.Text, eposta.Text.Trim());

                SqlCommand command = new SqlCommand("update  TumIslemler set  bilet_islem=@islem,ucret=@ucret, koltuk_no=@koltuk ,saat=@saat,bindi=@binis,indi=@inis,plaka=@plaka,servis_bindi=@servis,tel=@tel where ID=@islemID", this.baglan);
                command.Parameters.AddWithValue("@koltuk", koltuk_no.Text.Trim());
                command.Parameters.AddWithValue("@binis", binis.Text.Trim());
                command.Parameters.AddWithValue("@inis", inis.Text.Trim());
                command.Parameters.AddWithValue("@tarih", this.rezervasyon_t.Text);
                command.Parameters.AddWithValue("@saat", kalkıs_saati.Text.Trim());
                command.Parameters.AddWithValue("@plaka", oto_plaka.Text.Trim());
                command.Parameters.AddWithValue("@tel", no_dznle(telefon.Text));
                command.Parameters.AddWithValue("@islem", bilet_islem.Text);
                command.Parameters.AddWithValue("@ucret", label16.Text);
                command.Parameters.AddWithValue("@comboplaka", oto_plaka.Text.Trim());
                command.Parameters.AddWithValue("@combosaat", this.kalkıs_saati.Text);
                command.Parameters.AddWithValue("@servis", servis_binis.Text.Trim());
                command.Parameters.AddWithValue("@islemID", frmAna.ID);

                SqlCommand command03 = new SqlCommand("update  ServerClientBaglanti set durum='True'  where durum='False'", this.baglan);
                command03.ExecuteNonQuery();
                command.ExecuteNonQuery();

                MessageBox.Show("İşleminiz Başarıyla Ger\x00e7ekleştirilmiştir");
            }
        }
        private void button3_Click_1(object sender, EventArgs e)
        {
            if (this.maskedTextBox2.Text.Count() < 9)
            {
                MessageBox.Show("L\x00fctfen Plakayı Boş Ge\x00e7meyiniz");
            }
            else if (this.comboBox3.Text.Trim() == "")
            {
                MessageBox.Show("L\x00fctfen Koltuk Sayısını Boş Ge\x00e7meyiniz");
            }
            else if (this.comboBox1.Text.Trim() == "")
            {
                MessageBox.Show("L\x00fctfen Araç Türünü Boş Ge\x00e7meyiniz");
            }
            else if (textBox4.Text.Trim() == "")
            {
                MessageBox.Show("L\x00fctfen Şoför Adını Boş Ge\x00e7meyiniz");
            }
            else
            {
                SqlConnection connection = new SqlConnection(ClsDatabase.data_base());
                SqlCommand    command    = new SqlCommand("select count(*) from Otobusler where  plaka='" + pkala_dznle(this.maskedTextBox2.Text.Trim().ToUpper()) + "'", connection);
                connection.Open();
                int num = Convert.ToInt16(command.ExecuteScalar());
                connection.Close();
                if (num == 0)
                {
                    try
                    {
                        ClsInsert.otobus_ekle(pkala_dznle(this.maskedTextBox2.Text.Trim().ToUpper()), Convert.ToInt16(this.comboBox3.Text), this.textBox4.Text, comboBox1.Text.Trim());
                        MessageBox.Show("Kayıt İşleminiz Başarıyla Ger\x00e7ekleştirilmiştir");
                        ListViewItem item = new ListViewItem(pkala_dznle(this.maskedTextBox2.Text.Trim().ToUpper()));
                        item.SubItems.Add(this.comboBox3.Text);
                        item.SubItems.Add(this.textBox4.Text.Trim());
                        item.SubItems.Add(this.comboBox1.Text);

                        this.listView1.Items.Add(item);
                        this.maskedTextBox2.Text = "";
                        this.comboBox3.Text      = "";
                        this.textBox4.Text       = "";
                    }
                    catch
                    {
                        MessageBox.Show("Kayıt İşleminiz Ger\x00e7ekleştirilememiştir");
                    }
                }
                else
                {
                    connection.Open();
                    SqlCommand update = new SqlCommand("update Otobusler set koltuk_sayisi=@s ,sofor_adi=@sf,tur=@tur where  plaka='" + pkala_dznle(this.maskedTextBox2.Text.Trim()) + "'", connection);
                    update.Parameters.AddWithValue("@sf", textBox4.Text);
                    update.Parameters.AddWithValue("@s", comboBox3.Text);
                    update.Parameters.AddWithValue("@tur", comboBox1.Text);
                    update.ExecuteNonQuery();
                    connection.Close();

                    for (int i = 0; i < listView1.Items.Count; i++)
                    {
                        if (listView1.Items[i].Text == pkala_dznle(this.maskedTextBox2.Text.Trim().ToUpper()))
                        {
                            listView1.Items[i].Remove();
                        }
                    }

                    ListViewItem item = new ListViewItem(pkala_dznle(this.maskedTextBox2.Text.Trim().ToUpper()));
                    item.SubItems.Add(this.comboBox3.Text);
                    item.SubItems.Add(this.textBox4.Text);
                    item.SubItems.Add(this.comboBox1.Text);
                    listView1.Items.Add(item);

                    MessageBox.Show("Güncelleme İşleminiz Ger\x00e7ekleştirilmiştir");
                }
            }
        }