Esempio n. 1
0
        private void uzatTimePicker_ValueChanged(object sender, EventArgs e)
        {
            double   uyeucreti   = BLL_Arac.UyeUcretiGetir(uzatPlakaLabel.Text);
            TimeSpan GunHesapla  = uzatTimePicker.Value - Convert.ToDateTime(UzatBaslangicLabel.Text);
            int      Gun         = Convert.ToInt32(GunHesapla.TotalDays);
            double   Toplamucret = uyeucreti * Gun;
            double   ekucret     = Toplamucret - Convert.ToDouble(uzatOdenenLabel.Text);

            uzatEkUcretLabel.Text = ekucret.ToString();
        }
Esempio n. 2
0
        private void AracGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0)
            {
                if (AracGridView.Rows[e.RowIndex].Cells["Durum"].Value.ToString() == "Kirada")
                {
                    MessageBox.Show("Seçtiğiniz araç kirada olduğundan işlem yapılamaz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (AracGridView.Rows[e.RowIndex].Cells["Durum"].Value.ToString() == "Teslim Bekliyor")
                {
                    MessageBox.Show("Seçtiğiniz araç henüz teslim edilmediğinden işlem yapılamaz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    AracBilgiGroupBox.Enabled = true;
                    string plaka = AracGridView.Rows[e.RowIndex].Cells["Plaka"].Value.ToString();
                    PlakaLabel.Text      = plaka;
                    KategoriLabel.Text   = AracGridView.Rows[e.RowIndex].Cells["Kategori"].Value.ToString();
                    MarkaLabel.Text      = AracGridView.Rows[e.RowIndex].Cells["Marka"].Value.ToString();
                    ModelLabel.Text      = AracGridView.Rows[e.RowIndex].Cells["Model"].Value.ToString();
                    ModelYilLabel.Text   = AracGridView.Rows[e.RowIndex].Cells["ModelYili"].Value.ToString();
                    MotorHacmiLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Hacim"].Value.ToString();
                    MotorGucuLabel.Text  = AracGridView.Rows[e.RowIndex].Cells["Guc"].Value.ToString();
                    YakitLabel.Text      = AracGridView.Rows[e.RowIndex].Cells["Yakit"].Value.ToString();
                    SanzimanLabel.Text   = AracGridView.Rows[e.RowIndex].Cells["Sanziman"].Value.ToString();
                    KilometreLabel.Text  = AracGridView.Rows[e.RowIndex].Cells["Kilometre"].Value.ToString();
                    RenkLabel.Text       = AracGridView.Rows[e.RowIndex].Cells["Renk"].Value.ToString();
                    DonanimLabel.Text    = AracGridView.Rows[e.RowIndex].Cells["Donanim"].Value.ToString();
                    if (Session.Yetki == 1)
                    {
                        GunlukUcretLabel.Text = BLL_Arac.UyeUcretiGetir(plaka).ToString();
                    }
                    else
                    {
                        GunlukUcretLabel.Text = AracGridView.Rows[e.RowIndex].Cells["Ucret"].Value.ToString();
                    }

                    byte[] resim = BLL_Arac.AracResimGetir(plaka);
                    if (resim != null)
                    {
                        MemoryStream mem = new MemoryStream(resim);
                        AracPictureBox.Image = Image.FromStream(mem);
                    }
                    else
                    {
                        AracPictureBox.Image = null;
                    }
                }
            }
        }
 private void uzatTimePicker_ValueChanged(object sender, EventArgs e)
 {
     if (KiradakilerGridView.CurrentRow.Cells["Uyelik"].Value.ToString() == "Var")
     {
         double   uyeucreti   = BLL_Arac.UyeUcretiGetir(uzatPlakaLabel.Text);
         TimeSpan GunHesapla  = uzatTimePicker.Value - Convert.ToDateTime(UzatBaslangicLabel.Text);
         int      Gun         = Convert.ToInt32(GunHesapla.TotalDays);
         double   Toplamucret = uyeucreti * Gun;
         double   ekucret     = Toplamucret - Convert.ToDouble(uzatOdenenLabel.Text);
         uzatEkUcretLabel.Text = ekucret.ToString();
     }
     else
     {
         double   uyeolmayanucreti = Convert.ToDouble(KiradakilerGridView.CurrentRow.Cells["GunlukUcret"].Value);
         TimeSpan GunHesapla       = uzatTimePicker.Value - Convert.ToDateTime(UzatBaslangicLabel.Text);
         int      Gun         = Convert.ToInt32(GunHesapla.TotalDays);
         double   Toplamucret = uyeolmayanucreti * Gun;
         double   ekucret     = Toplamucret - Convert.ToDouble(uzatOdenenLabel.Text);
         uzatEkUcretLabel.Text = ekucret.ToString();
     }
 }