private void button2_Click(object sender, EventArgs e) { try { Ilce ilce = db.ilce.Find(secilenId); ilce.IlceAdi = txtBxIlce.Text; db.SaveChanges(); Listele(); } catch (Exception) { MessageBox.Show("İL Seçmeniz Gerekmektedir."); } }
private void button3_Click(object sender, EventArgs e) { try { Ilce ilce = db.ilce.Find(secilenId); db.ilce.Remove(ilce); db.SaveChanges(); Listele(); } catch (Exception) { MessageBox.Show("İLÇE Seçmeniz Gerekmektedir."); } }
private void button2_Click(object sender, EventArgs e) { try { Ilce ilce = db.ilceler.Find(secilenId); db.ilceler.Remove(ilce); db.SaveChanges(); Listele(); } catch { MessageBox.Show("Ilce secin"); } }
private void button3_Click(object sender, EventArgs e) { try { Ilce ilce = db.ilceler.Find(secilenId); ilce.IlceAdi = txtilceAdi.Text; ilce.ILId = int.Parse(comboBox1.SelectedValue.ToString()); db.SaveChanges(); Listele(); } catch (Exception) { MessageBox.Show("Ilce secmeniz gerekiyor!"); } }
private void button1_Click(object sender, EventArgs e) { try { Ilce ilce = new Ilce(); ilce.IlceAdi = txtBxIlce.Text; ilce.ILId = (int)comboBox1.SelectedValue; db.ilce.Add(ilce); db.SaveChanges(); } catch (Exception ex) { string str = ex.Message; } Listele(); }
private void button1_Click(object sender, EventArgs e) { try { Ilce ilce = new Ilce(); ilce.IlceAdi = txtilceAdi.Text; ilce.ILId = int.Parse(comboBox1.SelectedValue.ToString()); db.ilceler.Add(ilce); db.SaveChanges(); Listele(); } catch (Exception) { throw; } }