Beispiel #1
0
 private void btnEkle_Click(object sender, EventArgs e)
 {
     if (txtAracAdi.Text==""  || txtModel.Text=="" || txtPlaka.Text=="" || txtUcret.Text=="")
     {
         MessageBox.Show("Lutfen Boşlukları Doldurunuz", "Uyarı");
     }
     else
     {
         DialogResult sonuc = MessageBox.Show("Emin misiniz ?", "Uyarı", MessageBoxButtons.YesNo);
         if (sonuc==DialogResult.Yes)
         {
             try
             {
                 Arac a = new Arac();
                 a.AracAdi = txtAracAdi.Text;
                 a.Marka = Convert.ToInt32(cbModel.SelectedValue.ToString());
                 a.Model = Convert.ToInt32(txtModel.Text);
                 a.Plaka = txtPlaka.Text;
                 a.Yakıt = cbYakit.SelectedItem.ToString();
                 a.Ucret = Convert.ToInt32(txtUcret.Text);
                 a.Durum = "Uygun";
                 content.Aracs.InsertOnSubmit(a);
                 content.SubmitChanges();
                 MessageBox.Show("Eklendi ", "Uyarı");
             }
             catch (Exception)
             {
                 MessageBox.Show("Hata !", "Uyarı");
             }
         }
         else
         {
             MessageBox.Show("İşleminiz İptal Edildi");
         }
     }
     txtAracAdi.Clear();
     txtModel.Clear();
     txtPlaka.Clear();
     txtUcret.Clear();
     cbModel.Text = "";
     cbYakit.Text = "";
     txtAracAdi.Focus();
     AracListele();
 }
Beispiel #2
0
 private void btnEkle_Click(object sender, EventArgs e)
 {
     if (txtAracAdi.Text == "" || txtModel.Text == "" || txtPlaka.Text == "" || txtUcret.Text == "")
     {
         MessageBox.Show("Lutfen Boşlukları Doldurunuz", "Uyarı");
     }
     else
     {
         DialogResult sonuc = MessageBox.Show("Emin misiniz ?", "Uyarı", MessageBoxButtons.YesNo);
         if (sonuc == DialogResult.Yes)
         {
             try
             {
                 Arac a = new Arac();
                 a.AracAdi = txtAracAdi.Text;
                 a.Marka   = Convert.ToInt32(cbModel.SelectedValue.ToString());
                 a.Model   = Convert.ToInt32(txtModel.Text);
                 a.Plaka   = txtPlaka.Text;
                 a.Yakıt   = cbYakit.SelectedItem.ToString();
                 a.Ucret   = Convert.ToInt32(txtUcret.Text);
                 a.Durum   = "Uygun";
                 content.Aracs.InsertOnSubmit(a);
                 content.SubmitChanges();
                 MessageBox.Show("Eklendi ", "Uyarı");
             }
             catch (Exception)
             {
                 MessageBox.Show("Hata !", "Uyarı");
             }
         }
         else
         {
             MessageBox.Show("İşleminiz İptal Edildi");
         }
     }
     txtAracAdi.Clear();
     txtModel.Clear();
     txtPlaka.Clear();
     txtUcret.Clear();
     cbModel.Text = "";
     cbYakit.Text = "";
     txtAracAdi.Focus();
     AracListele();
 }
 partial void DeleteArac(Arac instance);
 partial void UpdateArac(Arac instance);
 partial void InsertArac(Arac instance);
 private void detach_Aracs(Arac entity)
 {
     this.SendPropertyChanging();
     entity.Marka1 = null;
 }
 private void attach_Aracs(Arac entity)
 {
     this.SendPropertyChanging();
     entity.Marka1 = this;
 }
 partial void DeleteArac(Arac instance);
 partial void UpdateArac(Arac instance);
 partial void InsertArac(Arac instance);
		private void detach_Aracs(Arac entity)
		{
			this.SendPropertyChanging();
			entity.Marka1 = null;
		}
		private void attach_Aracs(Arac entity)
		{
			this.SendPropertyChanging();
			entity.Marka1 = this;
		}