Пример #1
0
        private void btnKirala_Click(object sender, EventArgs e)
        {
            if (txtAd.Text=="" || txtSoyad.Text=="" || txtTC.Text=="")
            {
                MessageBox.Show("Lutfen Boşlukları Doldurunuz", "Uyarı");
            }
            else
            {
                DialogResult sonuc = MessageBox.Show("Emin misiniz ?", "Uyarı", MessageBoxButtons.YesNo);
                if (sonuc==DialogResult.Yes)
                {
                    var AracUygun=(from a in content.Aracs where a.AracID==aracID select a).First();
                    string durum=AracUygun.Durum;

                    if (durum=="Uygun")
                    {
                        try
                        {
                            Kirala k = new Kirala();
                            k.MusteriAd = txtAd.Text;
                            k.MusteriSoyad = txtSoyad.Text;
                            k.MusteriTc = txtTC.Text;
                            k.AracID = aracID;
                            k.Alim = dateTimePicker1.Value;
                            k.Teslim = dateTimePicker2.Value;
                            TimeSpan time = dateTimePicker2.Value - dateTimePicker1.Value;
                            k.Toplam = Convert.ToInt32(time.TotalDays)*fiyat;
                            content.Kiralas.InsertOnSubmit(k);
                            content.SubmitChanges();
                            MessageBox.Show("Araç Kiralandı", "Uyarı");
                            label6.Text = (Convert.ToInt32(time.TotalDays)*fiyat).ToString();

                        }
                        catch (Exception)
                        {

                            MessageBox.Show("Hata !", "Uyarı");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Araç Kiralamaya Uygun Degil");
                    }
                }
                else
                {
                    MessageBox.Show("İşlem İptal Edildi");
                }
            }

            txtAd.Clear();
            txtSoyad.Clear();
            txtTC.Clear();
            txtAd.Focus();
            AracListele();
            KiraYenile();
        }
Пример #2
0
        private void btnKirala_Click(object sender, EventArgs e)
        {
            if (txtAd.Text == "" || txtSoyad.Text == "" || txtTC.Text == "")
            {
                MessageBox.Show("Lutfen Boşlukları Doldurunuz", "Uyarı");
            }
            else
            {
                DialogResult sonuc = MessageBox.Show("Emin misiniz ?", "Uyarı", MessageBoxButtons.YesNo);
                if (sonuc == DialogResult.Yes)
                {
                    var    AracUygun = (from a in content.Aracs where a.AracID == aracID select a).First();
                    string durum     = AracUygun.Durum;

                    if (durum == "Uygun")
                    {
                        try
                        {
                            Kirala k = new Kirala();
                            k.MusteriAd    = txtAd.Text;
                            k.MusteriSoyad = txtSoyad.Text;
                            k.MusteriTc    = txtTC.Text;
                            k.AracID       = aracID;
                            k.Alim         = dateTimePicker1.Value;
                            k.Teslim       = dateTimePicker2.Value;
                            TimeSpan time = dateTimePicker2.Value - dateTimePicker1.Value;
                            k.Toplam = Convert.ToInt32(time.TotalDays) * fiyat;
                            content.Kiralas.InsertOnSubmit(k);
                            content.SubmitChanges();
                            MessageBox.Show("Araç Kiralandı", "Uyarı");
                            label6.Text = (Convert.ToInt32(time.TotalDays) * fiyat).ToString();
                        }
                        catch (Exception)
                        {
                            MessageBox.Show("Hata !", "Uyarı");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Araç Kiralamaya Uygun Degil");
                    }
                }
                else
                {
                    MessageBox.Show("İşlem İptal Edildi");
                }
            }

            txtAd.Clear();
            txtSoyad.Clear();
            txtTC.Clear();
            txtAd.Focus();
            AracListele();
            KiraYenile();
        }
Пример #3
0
 private void detach_Kiralas(Kirala entity)
 {
     this.SendPropertyChanging();
     entity.Arac = null;
 }
Пример #4
0
 private void attach_Kiralas(Kirala entity)
 {
     this.SendPropertyChanging();
     entity.Arac = this;
 }
Пример #5
0
 partial void DeleteKirala(Kirala instance);
Пример #6
0
 partial void UpdateKirala(Kirala instance);
Пример #7
0
 partial void InsertKirala(Kirala instance);
Пример #8
0
		private void detach_Kiralas(Kirala entity)
		{
			this.SendPropertyChanging();
			entity.Arac = null;
		}
Пример #9
0
		private void attach_Kiralas(Kirala entity)
		{
			this.SendPropertyChanging();
			entity.Arac = this;
		}
Пример #10
0
 partial void DeleteKirala(Kirala instance);
Пример #11
0
 partial void UpdateKirala(Kirala instance);
Пример #12
0
 partial void InsertKirala(Kirala instance);