Example #1
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            int CALISAN_ID;

            try
            {
                CALISAN_ID = Convert.ToInt32((dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value).ToString());

                DialogResult a = MessageBox.Show("Kayıt Silinecek! İşlemi onaylıyormusunuz ?", "UYARI", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (a == DialogResult.Yes)
                {
                    //messagebox da evet butonuna basılırsa sorguyu calıstıyoruz
                    VeriTabani vt = new VeriTabani();
                    vt.CalısanSil(CALISAN_ID);

                    string sorgu = "select * from CALISAN,CALISAN_BILGI where CALISAN.CALISAN_ID=CALISAN_BILGI.CALISAN_ID";
                    vt.baglan(sorgu, dataGridView1, "CALISAN");
                    dataGridView1.Columns[5].Visible = false;
                }
            }
            catch (FormatException)
            {
                MessageBox.Show("Listeden Kayıt Seçmelisiniz", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            VeriTabani vt  = new VeriTabani();
            int        rol = vt.KullanıcıGiris(textKullaniciAdi.Text, textSifre.Text);

            //MessageBox.Show(rol.ToString());
            if (rol == -1)
            {
                MessageBox.Show("Şifre Veya Parola Yanlış", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //textKullaniciAdi.Text = "";
                textSifre.Text = "";
                textKullaniciAdi.Focus();
            }
            else if (rol == 0 || rol == 1)
            {
                AdminAnaSayfa form    = new AdminAnaSayfa();
                int           GElenID = vt.CalısanIDAL(textKullaniciAdi.Text, textSifre.Text);
                form.CalısanID = GElenID;
                form.Rol       = rol;
                form.Show();
                this.Hide();
            }
            else
            {
                //çalışan ana sayfası açılacak
            }
        }
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            VeriTabani vt = new VeriTabani();

            if (tc && textTc.Text.Length == 11)
            {
                try
                {
                    vt.MusteriEkle(textTc.Text, textAdi.Text, textSoyad.Text, Convert.ToDateTime(textDogumTar.Text), textAdres.Text, textTel.Text, textMail.Text, false);
                    Temizle();
                }
                catch (FormatException)
                {
                    MessageBox.Show("Hatalı Doğum Tarihi Girişi Yaptınız.\n 'dd/mm/yyyy' şeklinde Yapınız. ", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    textDogumTar.Focus();
                }
                catch (SqlException)
                {
                    MessageBox.Show("Bu TC Sisteme Kayıtlı", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    textTc.Text = "";
                    textTc.Focus();
                }
                catch (Exception)
                {
                    MessageBox.Show("Hatalı Doğum Tarihi Girişi Yaptınız.\n 'dd/mm/yyyy' şeklinde Yapınız. ", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    textDogumTar.Focus();
                }
                TumListe();
            }
            else
            {
                MessageBox.Show("Hatalı Veya Eksik TC no girişi", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textTc.Focus();
            }
        }
        public void TumListe()
        {
            string     sorgu = "select * from MUSTERI";
            VeriTabani vt    = new VeriTabani();

            vt.baglan(sorgu, dataGridView1, "MUSTERI");
        }
        private void comboMarka_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (a)
            {
                if (comboMarka.SelectedIndex == comboMarka.Items.Count - 1)
                {
                    comboSeri.Items.Clear();
                    comboModel.Items.Clear();
                    comboModel.Text = "";
                    comboSeri.Text  = "";

                    AracEkle form = new AracEkle();

                    try
                    {
                        form.EklenecekMarkaID = MARKA_ID[MARKA_ID.Length - 1] + 1;
                        form.Guncellemi       = true;
                    }
                    catch (IndexOutOfRangeException)
                    {
                        form.EklenecekMarkaID = 1;//ilk araba kayıtında bos deger alamayacagı ıcın 1 gonderıyoruz
                    }
                    form.Show();
                }
                else
                {
                    comboModel.Text = "";
                    comboSeri.Text  = "";
                    VeriTabani vt = new VeriTabani();
                    MODEL_ID = vt.ModelCek(comboModel, MARKA_ID[comboMarka.SelectedIndex]);
                    comboModel.Items.Add("Aradığınız Model Yokmu ?");
                    comboSeri.Items.Clear();
                }
            }
        }
Example #6
0
        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            //AraçHareketleri
            try
            {
                DataSet    ds        = new DataSet();
                int        secılenıd = SecilenArabaID = Convert.ToInt32((dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value).ToString());
                string     sorgu     = "select A.PLAKA_NO,M.TC_NO,M.ADI,M.SOYADI,K.ALIS_TARIHI,K.TESLIM_TARIHI,K.KIRA_TOPLAM_TUTAR from ARABALAR A,KIRALAMA_EMRI K,MUSTERI M,MARKALAR MA,MODEL MO,SERI SE where A.ARABA_ID=K.ARABA_ID and K.MUSTERI_ID=M.MUSTERI_ID and MA.MARKA_ID=A.MARKA_ID and MO.MODEL_ID=A.MODEL_ID and SE.SERI_ID=A.SERI_ID and A.ARABA_ID=" + secılenıd;
                VeriTabani vt        = new VeriTabani();
                ds = vt.SorguCekDataSetGonder(sorgu, "ARABALAR");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    vt.ExcellDoldur(ds, "ARABALAR");
                }
                else
                {
                    MessageBox.Show("Seçilen Arabanın Hareketi Bulunmamaktadır !!!", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                //TümListe();
            }
            catch (Exception)
            {
                MessageBox.Show("Listeden Kayıt Seçiniz !!!", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            // Kira Kaydetme İşlemi Yapılacak
            if (RezerveKiraDurum == 0)
            {
                //normal kira işlemi çalışacak
                int      ARABA_ID, MUSTERI_ID;
                DateTime ALIS_TARIHI, TESLIM_TARIHI;
                ARABA_ID      = int.Parse(dataArac.Rows[dataArac.CurrentRow.Index].Cells[0].Value.ToString());
                MUSTERI_ID    = int.Parse(dataMusteri.Rows[dataMusteri.CurrentRow.Index].Cells[0].Value.ToString());
                ALIS_TARIHI   = Convert.ToDateTime(dateTimeAlıs.Text);
                TESLIM_TARIHI = Convert.ToDateTime(dateTimeTeslim.Text);

                VeriTabani vt = new VeriTabani();
                vt.KiraEmriEkle(CALISAN_ID, ARABA_ID, MUSTERI_ID, ALIS_TARIHI, TESLIM_TARIHI, int.Parse(txtToplamGun.Text), false, int.Parse(TextKiloMetre.Text), 0, 0, int.Parse(textToplamTutar.Text), false);
                vt.AracDurumGuncelle(ARABA_ID, "KIRADA");
                MessageBox.Show("Kiralama Emriniz Başarıyla Oluşturulmuştur...", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                // rezerve emir işlemi çalışacak
                int      ARABA_ID, MUSTERI_ID;
                DateTime ALIS_TARIHI, TESLIM_TARIHI;
                ARABA_ID      = int.Parse(dataArac.Rows[dataArac.CurrentRow.Index].Cells[0].Value.ToString());
                MUSTERI_ID    = int.Parse(dataMusteri.Rows[dataMusteri.CurrentRow.Index].Cells[0].Value.ToString());
                ALIS_TARIHI   = Convert.ToDateTime(dateTimeAlıs.Text);
                TESLIM_TARIHI = Convert.ToDateTime(dateTimeTeslim.Text);
                VeriTabani vt = new VeriTabani();
                vt.RezerveEkle(CALISAN_ID, ARABA_ID, MUSTERI_ID, ALIS_TARIHI, TESLIM_TARIHI, false);
                vt.AracDurumGuncelle(ARABA_ID, "REZERVE");
                MessageBox.Show("Araç Rezerve İşleminiz Başarıyla Oluşturulmuştur...", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
        }
Example #8
0
 private void OdemeYap_Load(object sender, EventArgs e)
 {
     if (KIRA_ID != 0)
     {
         //tc alanına göre arama yapılıyor
         string     sorgu = "select K.KIRA_ID,M.TC_NO,M.ADI,M.SOYADI,K.ALIS_TARIHI,K.TESLIM_TARIHI,K.KM_START,K.KIRA_TOPLAM_TUTAR from KIRALAMA_EMRI K,ARABALAR A,MUSTERI M WHERE K.MUSTERI_ID=M.MUSTERI_ID AND A.ARABA_ID=K.ARABA_ID AND K.KIRA_ID=" + KIRA_ID;
         VeriTabani vt    = new VeriTabani();
         DataSet    ds    = vt.KiraEmriCek(sorgu);
         if (ds.Tables[0].Rows.Count == 0)
         {
             lblDurum.Visible = true;
         }
         else
         {
             lblSonuc.Text = "Plaka No :";
             //TeslimTarihi = (ds.Tables[0].Rows[0].ItemArray[5].ToString());
             //toplam = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[7].ToString());
             KIRA_ID = int.Parse(ds.Tables[0].Rows[0].ItemArray[0].ToString());
             //MessageBox.Show(KIRA_ID.ToString());
             textSonuc.Text         = ds.Tables[0].Rows[0].ItemArray[1].ToString();
             textAd.Text            = ds.Tables[0].Rows[0].ItemArray[2].ToString();
             textSoyad.Text         = ds.Tables[0].Rows[0].ItemArray[3].ToString();
             textAlisTar.Text       = DateTime.Parse(ds.Tables[0].Rows[0].ItemArray[4].ToString()).ToShortDateString();
             dateTimeTeslimTar.Text = ds.Tables[0].Rows[0].ItemArray[5].ToString();
             // textKmStart.Text = ds.Tables[0].Rows[0].ItemArray[6].ToString();
             textTopTutar.Text = ds.Tables[0].Rows[0].ItemArray[7].ToString();
             groupBox2.Enabled = false;
         }
     }
 }
Example #9
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     if (KIRA_ID != 0)
     {
         if (comboOdemeSekli.Text != "")
         {
             //Ödeme İşlemi Yapılacak !!
             int        ODENME_DURUM;
             VeriTabani vt = new VeriTabani();
             ODENME_DURUM = vt.KiraOdenmeDurumCek(KIRA_ID);
             if (ODENME_DURUM == 0)
             {
                 vt.ODEMEEKLE(KIRA_ID, DateTime.Now, comboOdemeSekli.SelectedItem.ToString(), int.Parse(textTopTutar.Text), CALISAN_ID);
                 lblOnay.Visible = true;
             }
             else
             {
                 MessageBox.Show("Bu Kira Emrinin Ödemesi Mevcuttur Tekrardan Ödeme Yapamassınız !", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
         else
         {
             MessageBox.Show("Lütfen Bir Ödeme Türü Seçiniz !!", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
     }
 }
Example #10
0
        private void comboMarka_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboMarka.SelectedIndex == comboMarka.Items.Count - 1)
            {
                comboSeri.Items.Clear();
                comboModel.Items.Clear();
                comboModel.Text = "";
                comboSeri.Text  = "";

                AracEkle form = new AracEkle();
                try
                {
                    form.EklenecekMarkaID = MARKA_ID[MARKA_ID.Length - 1] + 1;
                }
                catch (IndexOutOfRangeException)
                {
                    form.EklenecekMarkaID = 1;
                }
                form.Show();
            }
            else
            {
                comboModel.Text = "";
                comboSeri.Text  = "";
                VeriTabani vt = new VeriTabani();
                MODEL_ID = vt.ModelCek(comboModel, MARKA_ID[comboMarka.SelectedIndex]);
                comboModel.Items.Add("Aradığınız Model Yokmu ?");
                comboSeri.Items.Clear();
            }
        }
        private void KiralamaEmri_Load(object sender, EventArgs e)
        {
            if (RezerveKiraDurum == 1)
            {
                label8.Visible        = false;
                TextKiloMetre.Visible = false;
                this.Text             = "Araç Rezerve :";
            }
            string     sorgu = "select MUSTERI_ID,TC_NO,ADI,SOYADI from MUSTERI";
            VeriTabani vt    = new VeriTabani();

            vt.baglan(sorgu, dataMusteri, "MUSTERI");
            dataMusteri.Columns[0].Visible    = false;
            dataMusteri.Columns[1].HeaderText = "Kimlik No";
            sorgu = "select A.ARABA_ID,A.PLAKA_NO,M.MARKA_ADI,MO.MODEL,S.SERI,A.YAKIT,A.VITES,A.KASA_TIPI,A.GUNLUK_UCRET,A.KULLANIM_DURUM from ARABALAR A,MARKALAR M, MODEL MO,SERI S where A.MARKA_ID=M.MARKA_ID and A.MODEL_ID=MO.MODEL_ID and A.SERI_ID=S.SERI_ID and A.KULLANIM_DURUM='BOŞTA'";

            vt.baglan(sorgu, dataArac, "ARABALAR");
            dataArac.Columns[1].HeaderText = "PLAKA";
            dataArac.Columns[2].HeaderText = "MARKA";

            dataArac.Columns[7].HeaderText = "TİP";
            dataArac.Columns[8].HeaderText = "G.UCRET";
            dataArac.Columns[9].HeaderText = "DURUM";

            dataArac.Columns[0].Visible = false;


            MARKA_ID = vt.markaCek(comboMarka);
        }
        private void AracGuncelle_Load(object sender, EventArgs e)
        {
            VeriTabani vt = new VeriTabani();

            MARKA_ID = vt.markaCek(comboMarka);
            comboMarka.SelectedItem = SeciliMarka;

            MODEL_ID = vt.ModelCek(comboModel, MARKA_ID[comboMarka.SelectedIndex]);
            comboModel.SelectedItem = SeciliModel;

            SERI_ID = vt.SeriCek(comboSeri, MODEL_ID[comboModel.SelectedIndex]);
            comboSeri.SelectedItem = SeciliSeri;

            comboMarka.Items.Add("Aradığınız Marka Yokmu ?");
            comboModel.Items.Add("Aradığınız Model Yokmu ?");
            comboSeri.Items.Add("Aradığınız Seri Yokmu ?");
            timer1.Enabled = true;
            //MessageBox.Show(GelenAraçID.ToString());
            a = true; // a yı doğu yapmamızın nedeni lood olayında kodlar yüklenirken sistemin karışması!!

            DataSet ds = new DataSet();

            ds                        = vt.ArabaCek(GelenAraçID);
            textPlaka.Text            = ds.Tables[0].Rows[0].ItemArray[0].ToString();
            comboYakıt.SelectedItem   = ds.Tables[0].Rows[0].ItemArray[1].ToString();
            comboVites.SelectedItem   = ds.Tables[0].Rows[0].ItemArray[2].ToString();
            comboKasaTip.SelectedItem = ds.Tables[0].Rows[0].ItemArray[3].ToString();
            comboCekis.SelectedItem   = ds.Tables[0].Rows[0].ItemArray[4].ToString();
            comboRenk.SelectedItem    = ds.Tables[0].Rows[0].ItemArray[5].ToString();
            textKiloMetre.Text        = ds.Tables[0].Rows[0].ItemArray[6].ToString();
            textGunlukUcret.Text      = ds.Tables[0].Rows[0].ItemArray[7].ToString();
        }
Example #13
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     if (textTc.Text.Length == 11)
     {
         try
         {
             VeriTabani vt = new VeriTabani();
             vt.MusteriGuncelle(textTc.Text, textAd.Text, textSoyad.Text, Convert.ToDateTime(textDogumTar.Text), textAdres.Text, textTel.Text, textEmail.Text, false, Gelen_ID);
             MessageBox.Show("Kaydınız Güncellenmiştir.", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
             MusteriIslemleri.deneme = 1;
             this.Close();
         }
         catch (SqlException)
         {
             MessageBox.Show("Bu TC Sisteme Kayıtlı", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             textTc.Text = "";
             textTc.Focus();
         }
     }
     else
     {
         MessageBox.Show("Hatalı Veya Eksik TC no girişi", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         textTc.Focus();
     }
 }
Example #14
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     if (textTC.Text.Length == 11)
     {
         try
         {
             VeriTabani vt = new VeriTabani();
             vt.CalısanEkle(textTC.Text, textAdi.Text, textSoyadi.Text, comboRol.SelectedIndex, textKullaniciAdi.Text, textSifre.Text);
             string sorgu = "select * from CALISAN,CALISAN_BILGI where CALISAN.CALISAN_ID=CALISAN_BILGI.CALISAN_ID";
             vt.baglan(sorgu, dataGridView1, "CALISAN");
             dataGridView1.Columns[5].Visible = false;
             temizle();
         }
         catch (SqlException)
         {
             MessageBox.Show("Bu TC Sisteme Kayıtlı", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             textTC.Text = "";
             textTC.Focus();
         }
     }
     else
     {
         MessageBox.Show("Hatalı Veya Eksik TC no girişi", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         textTC.Focus();
     }
 }
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (textKmEnd.Text == "")
            {
                MessageBox.Show("Aracın Teslim Kilometresini Giriniz !", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                TimeSpan b = Convert.ToDateTime(dateTimeTeslimTar.Text) - Convert.ToDateTime(textAlisTar.Text);
                TOPLAM_GUN = Convert.ToInt32(Math.Abs(b.TotalDays));
                //Araç Telim İşlemi Yapılacak !!
                VeriTabani vt = new VeriTabani();

                vt.KiraDurumGuncelle(KIRA_ID, true, Convert.ToDateTime(dateTimeTeslimTar.Text), TOPLAM_GUN, int.Parse(textKmEnd.Text), int.Parse(textKmFark.Text), int.Parse(textTopTutar.Text));//bazı alanlar daha güncellenecek !
                vt.AracDurumGuncelle(ARABA_ID, "BOŞTA");
                vt.AracKmGuncelle(ARABA_ID, Convert.ToInt32(textKmEnd.Text));

                int ODENME_DURUM = vt.KiraOdenmeDurumCek(KIRA_ID);
                if (ODENME_DURUM == 0)
                {
                    MessageBox.Show("Sistemde Kira Ödemesi Gözükmemektedir. \nSizi Ödeme Sayfasına Yönlendiriyorz.", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    OdemeYap form = new OdemeYap();
                    form.KIRA_ID    = KIRA_ID;
                    form.CALISAN_ID = CALISAN_ID;
                    form.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Araç Tesliminiz Başarıyla Gerçekleşmiştir.", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Example #16
0
 private void btnOnay_Click(object sender, EventArgs e)
 {
     try
     {
         VeriTabani vt = new VeriTabani();
         DateTime   ALIS_TAR, TESLIM_TAR;
         int        ARABA_ID, MUSTERI_ID, TOPLAM_GUN, KM_START, REZERVE_ID, TOPLAM_TUTAR;
         ARABA_ID   = int.Parse(dataRezList.Rows[dataRezList.CurrentRow.Index].Cells[0].Value.ToString());
         REZERVE_ID = int.Parse(dataRezList.Rows[dataRezList.CurrentRow.Index].Cells[1].Value.ToString());
         MUSTERI_ID = int.Parse(dataRezList.Rows[dataRezList.CurrentRow.Index].Cells[2].Value.ToString());
         ALIS_TAR   = DateTime.Parse(dataRezList.Rows[dataRezList.CurrentRow.Index].Cells[6].Value.ToString());
         TESLIM_TAR = DateTime.Parse(dataRezList.Rows[dataRezList.CurrentRow.Index].Cells[7].Value.ToString());
         TimeSpan fark = TESLIM_TAR - ALIS_TAR;
         TOPLAM_GUN   = Convert.ToInt32(fark.TotalDays.ToString());
         KM_START     = vt.AracKMCek(ARABA_ID);
         TOPLAM_TUTAR = vt.AracUcretCek(ARABA_ID) * TOPLAM_GUN;
         vt.KiraEmriEkle(CALISAN_ID, ARABA_ID, MUSTERI_ID, ALIS_TAR, TESLIM_TAR, TOPLAM_GUN, false, KM_START, 0, 0, TOPLAM_TUTAR, false);
         vt.AracDurumGuncelle(ARABA_ID, "KIRADA");
         vt.RezerveDurum(REZERVE_ID, true);
         MessageBox.Show("İşleminiz Onaylanmıştır !!", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
     }
     catch (Exception)
     {
         MessageBox.Show("Listeden Kayıt Seçiniz  !!", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (timerkontrol == 1)
            {
                VeriTabani vt = new VeriTabani();
                MARKA_ID        = vt.markaCek(comboMarka);
                comboMarka.Text = "";
                comboModel.Items.Clear();
                comboSeri.Items.Clear();
                comboMarka.Items.Add("Aradığınız Marka Yokmu ?");
                comboModel.Items.Add("Aradığınız Model Yokmu ?");
                comboSeri.Items.Add("Aradığınız Seri Yokmu ?");
                timerkontrol = 0;
            }
            else if (timerkontrol == 2)
            {
                comboModel.Text = "";
                comboSeri.Text  = "";

                VeriTabani vt = new VeriTabani();
                MODEL_ID = vt.ModelCek(comboModel, MARKA_ID[comboMarka.SelectedIndex]);
                comboModel.Items.Add("Aradığınız Model Yokmu ?");
                comboSeri.Items.Add("Aradığınız Seri Yokmu ?");
                timerkontrol = 0;
            }
            else if (timerkontrol == 3)
            {
                comboSeri.Text = "";
                VeriTabani vt = new VeriTabani();
                SERI_ID = vt.SeriCek(comboSeri, MODEL_ID[comboModel.SelectedIndex]);
                comboSeri.Items.Add("Aradığınız Seri Yokmu ?");
                timerkontrol = 0;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            //sorguya teslim alınan araçları dahil etmicez !!

            if (radioButton1.Checked == true)
            {
                //tc alanına göre arama yapılıyor
                string     sorgu = "select K.KIRA_ID,A.PLAKA_NO,M.ADI,M.SOYADI,K.ALIS_TARIHI,K.TESLIM_TARIHI,K.KM_START,K.KIRA_TOPLAM_TUTAR from KIRALAMA_EMRI K,ARABALAR A,MUSTERI M WHERE K.MUSTERI_ID=M.MUSTERI_ID AND A.ARABA_ID=K.ARABA_ID AND M.TC_NO='" + textTc.Text + "' and K.TESLIM_DURUMU=0";
                VeriTabani vt    = new VeriTabani();
                DataSet    ds    = vt.KiraEmriCek(sorgu);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    lblDurum.Visible = true;
                }
                else
                {
                    lblSonuc.Text = "Plaka No :";
                    TeslimTarihi  = (ds.Tables[0].Rows[0].ItemArray[5].ToString());
                    toplam        = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[7].ToString());
                    KIRA_ID       = int.Parse(ds.Tables[0].Rows[0].ItemArray[0].ToString());
                    //MessageBox.Show(KIRA_ID.ToString());
                    textSonuc.Text         = ds.Tables[0].Rows[0].ItemArray[1].ToString();
                    ARABA_ID               = vt.AracIDCek(textSonuc.Text);
                    textAd.Text            = ds.Tables[0].Rows[0].ItemArray[2].ToString();
                    textSoyad.Text         = ds.Tables[0].Rows[0].ItemArray[3].ToString();
                    textAlisTar.Text       = DateTime.Parse(ds.Tables[0].Rows[0].ItemArray[4].ToString()).ToShortDateString();
                    dateTimeTeslimTar.Text = ds.Tables[0].Rows[0].ItemArray[5].ToString();
                    textKmStart.Text       = ds.Tables[0].Rows[0].ItemArray[6].ToString();
                    textTopTutar.Text      = ds.Tables[0].Rows[0].ItemArray[7].ToString();
                }
            }
            else
            {
                //plakaya göre arama yapılıyor
                string     sorgu = "select K.KIRA_ID,M.TC_NO,M.ADI,M.SOYADI,K.ALIS_TARIHI,K.TESLIM_TARIHI,K.KM_START,K.KIRA_TOPLAM_TUTAR from KIRALAMA_EMRI K,ARABALAR A,MUSTERI M WHERE K.MUSTERI_ID=M.MUSTERI_ID AND A.ARABA_ID=K.ARABA_ID AND A.PLAKA_NO='" + textTc.Text + "' and K.TESLIM_DURUMU=0";
                VeriTabani vt    = new VeriTabani();
                DataSet    ds    = vt.KiraEmriCek(sorgu);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    lblDurum.Visible = true;
                }
                else
                {
                    ARABA_ID      = vt.AracIDCek(textTc.Text);
                    KIRA_ID       = int.Parse(ds.Tables[0].Rows[0].ItemArray[0].ToString());
                    lblSonuc.Text = "Tc Kimlik No:";
                    TeslimTarihi  = (ds.Tables[0].Rows[0].ItemArray[5].ToString());
                    toplam        = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[7].ToString());
                    //MessageBox.Show(KIRA_ID.ToString());
                    textSonuc.Text         = ds.Tables[0].Rows[0].ItemArray[1].ToString();
                    textAd.Text            = ds.Tables[0].Rows[0].ItemArray[2].ToString();
                    textSoyad.Text         = ds.Tables[0].Rows[0].ItemArray[3].ToString();
                    textAlisTar.Text       = DateTime.Parse(ds.Tables[0].Rows[0].ItemArray[4].ToString()).ToShortDateString();
                    dateTimeTeslimTar.Text = ds.Tables[0].Rows[0].ItemArray[5].ToString();
                    textKmStart.Text       = ds.Tables[0].Rows[0].ItemArray[6].ToString();
                    textTopTutar.Text      = ds.Tables[0].Rows[0].ItemArray[7].ToString();
                }
            }
        }
Example #19
0
        private void comboModel_SelectedIndexChanged(object sender, EventArgs e)
        {
            VeriTabani vt = new VeriTabani();

            SERI_ID = vt.SeriCek(comboSeri, MODEL_ID[comboModel.SelectedIndex]);
            MODEL   = MODEL_ID[comboModel.SelectedIndex];
            SERI    = 0;
        }
        private void dateTimeTeslimTar_ValueChanged(object sender, EventArgs e)
        {
            if (sayac == 1)
            {
                string PLAKA_NO;
                int    ucret, indirim, fark = 0, toplamtutar;

                if (radioButton1.Checked == true)
                {
                    PLAKA_NO = textSonuc.Text;
                }
                else
                {
                    PLAKA_NO = textTc.Text;
                }
                toplamtutar = toplam;
                VeriTabani vt = new VeriTabani();
                ucret = vt.GünlükUcretCek(PLAKA_NO);

                TimeSpan a = Convert.ToDateTime(textAlisTar.Text) - Convert.ToDateTime(dateTimeTeslimTar.Text);
                TimeSpan b = Convert.ToDateTime(dateTimeTeslimTar.Text) - Convert.ToDateTime(textAlisTar.Text);
                TOPLAM_GUN = Convert.ToInt32(Math.Abs(b.TotalDays));
                // MessageBox.Show(TOPLAM_GUN.ToString());
                if (a.TotalDays > 0)
                {
                    MessageBox.Show("Teslim Tarihini Alış Tarihinden Once giremessiniz!!", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    dateTimeTeslimTar.Text = Convert.ToDateTime(TeslimTarihi).ToShortDateString();
                }
                else
                {
                    DateTime TeslimTar    = Convert.ToDateTime(TeslimTarihi);
                    DateTime SecilenTarih = Convert.ToDateTime(dateTimeTeslimTar.Text);
                    TimeSpan Sonuc        = SecilenTarih - TeslimTar;
                    fark = Convert.ToInt32(Sonuc.TotalDays.ToString());
                    if (fark == 0)
                    {
                        textTopTutar.Text = toplamtutar.ToString();
                    }
                    else if (fark < 0)
                    {
                        indirim           = ucret * 2 / 3;
                        toplamtutar       = toplamtutar + fark * indirim;
                        textTopTutar.Text = toplamtutar.ToString();
                    }
                    else
                    {
                        toplamtutar       = toplamtutar + fark * ucret;
                        textTopTutar.Text = toplamtutar.ToString();
                    }
                }
            }
            else
            {
                sayac++;
            }
        }
Example #21
0
        private void comboMarka_SelectedIndexChanged(object sender, EventArgs e)
        {
            VeriTabani vt = new VeriTabani();

            MODEL_ID = vt.ModelCek(comboModel, MARKA_ID[comboMarka.SelectedIndex]);
            comboSeri.Items.Clear();
            MARKA = MARKA_ID[comboMarka.SelectedIndex];
            MODEL = 0;
            SERI  = 0;
        }
Example #22
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            VeriTabani vt = new VeriTabani();

            string sorgu = "select * from CALISAN,CALISAN_BILGI where CALISAN.CALISAN_ID=CALISAN_BILGI.CALISAN_ID";

            vt.baglan(sorgu, dataGridView1, "CALISAN");
            dataGridView1.Columns[5].Visible = false;
            textArama.Text = "";
        }
Example #23
0
        public void TümListe()
        {
            VeriTabani vt    = new VeriTabani();
            string     sorgu = "select A.ARABA_ID,A.PLAKA_NO,M.MARKA_ADI,MO.MODEL,S.SERI,A.YAKIT,A.VITES,A.KASA_TIPI,A.CEKIS,A.RENK,A.GUNLUK_UCRET,A.KULLANIM_DURUM from ARABALAR A,MARKALAR M, MODEL MO,SERI S where A.MARKA_ID=M.MARKA_ID and A.MODEL_ID=MO.MODEL_ID and A.SERI_ID=S.SERI_ID";

            vt.baglan(sorgu, dataGridView1, "ARABALAR");
            dataGridView1.Columns[0].Visible     = false;
            dataGridView1.Columns[10].HeaderText = "UCRET";
            dataGridView1.Columns[11].HeaderText = "DURUM";
        }
        private void btnTemizle_Click(object sender, EventArgs e)
        {
            string     sorgu = "select MUSTERI_ID,TC_NO,ADI,SOYADI from MUSTERI";
            VeriTabani vt    = new VeriTabani();

            vt.baglan(sorgu, dataMusteri, "MUSTERI");
            dataMusteri.Columns[0].Visible    = false;
            dataMusteri.Columns[1].HeaderText = "Kimlik No";
            textArama.Text = "";
        }
        private void MusteriIslemleri_Load(object sender, EventArgs e)
        {
            string     sorgu = "select * from MUSTERI";
            VeriTabani vt    = new VeriTabani();

            vt.baglan(sorgu, dataGridView1, "MUSTERI");
            toolTip1.SetToolTip(textDogumTar, "Doğum Tarihini dd.mm.yyy Şeklinde Giriniz");

            //Sonradan Uğraşılır
            // dataGridView1.Columns[1].HeaderText = "TC";
        }
Example #26
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (deneme == 1)
     {
         VeriTabani vt    = new VeriTabani();
         string     sorgu = "select * from CALISAN,CALISAN_BILGI where CALISAN.CALISAN_ID=CALISAN_BILGI.CALISAN_ID";
         vt.baglan(sorgu, dataGridView1, "CALISAN");
         dataGridView1.Columns[5].Visible = false;
         deneme = 0;
     }
 }
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            //araç güncelleme kısmı

            VeriTabani vt = new VeriTabani();

            vt.AracGuncelle(textPlaka.Text, MARKA_ID[comboMarka.SelectedIndex], MODEL_ID[comboModel.SelectedIndex], SERI_ID[comboSeri.SelectedIndex], comboYakıt.SelectedItem.ToString(), comboVites.SelectedItem.ToString(), comboKasaTip.SelectedItem.ToString(), comboCekis.SelectedItem.ToString(), comboRenk.SelectedItem.ToString(), int.Parse(textKiloMetre.Text), int.Parse(textGunlukUcret.Text), GelenAraçID);
            MessageBox.Show("Kaydınız Güncellenmiştir !", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
            ArabaIslemleri.timerkontrol = 4;
            this.Close();
        }
Example #28
0
        private void btnTemizle_Click(object sender, EventArgs e)
        {
            string sorgu = "select A.ARABA_ID,R.REZERVE_ID,M.MUSTERI_ID,M.TC_NO,M.ADI,M.SOYADI,R.ALIS_TAR,R.TESLIM_TAR from MUSTERI M,REZERVE R,ARABALAR A where M.MUSTERI_ID=r.MUSTERI_ID and A.ARABA_ID=R.ARABA_ID and R.REZERVE_DURUM=0";


            VeriTabani vt = new VeriTabani();

            vt.baglan(sorgu, dataRezList, "REZERVE");
            dataRezList.Columns[0].Visible = false;
            dataRezList.Columns[1].Visible = false;
            dataRezList.Columns[2].Visible = false;
        }
 private void dataArac_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         VeriTabani vt       = new VeriTabani();
         int        ARABA_ID = 0;
         ARABA_ID           = Convert.ToInt32((dataArac.Rows[dataArac.CurrentRow.Index].Cells[0].Value).ToString());
         TextKiloMetre.Text = vt.AracKMCek(ARABA_ID).ToString();
     }
     catch (Exception)
     {
     }
 }
Example #30
0
        private void btnAracArama_Click(object sender, EventArgs e)
        {
            VeriTabani vt = new VeriTabani();

            ARABA_ID = vt.AracIDCek(TextPlakaArama.Text);
            if (ARABA_ID == 0)
            {
                lblDurum.Visible = true;
            }
            else
            {
                lblDurum.Visible = false;
            }
        }