Example #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();
        }
Example #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();
        }
 private void detach_Kiralas(Kirala entity)
 {
     this.SendPropertyChanging();
     entity.Arac = null;
 }
 private void attach_Kiralas(Kirala entity)
 {
     this.SendPropertyChanging();
     entity.Arac = this;
 }
 partial void DeleteKirala(Kirala instance);
 partial void UpdateKirala(Kirala instance);
 partial void InsertKirala(Kirala instance);
		private void detach_Kiralas(Kirala entity)
		{
			this.SendPropertyChanging();
			entity.Arac = null;
		}
		private void attach_Kiralas(Kirala entity)
		{
			this.SendPropertyChanging();
			entity.Arac = this;
		}
 partial void DeleteKirala(Kirala instance);
 partial void UpdateKirala(Kirala instance);
 partial void InsertKirala(Kirala instance);