public ActionResult TurDuzenle(TurTip tur) { try { var _turDuzenle = ent.TurTip.Where(x => x.TurTipID == tur.TurTipID).FirstOrDefault(); _turDuzenle.Ad = tur.Ad; ent.SaveChanges(); return(RedirectToAction("Tur", "Admin")); } catch (Exception ex) { throw new Exception("Güncellerken hata oluştu " + ex.Message); } }
public ActionResult TurEkle(TurTip t) { try { TurTip _turTip = new TurTip(); _turTip.Ad = t.Ad; ent.TurTip.Add(_turTip); ent.SaveChanges(); return(RedirectToAction("Tur", "Admin")); } catch (Exception ex) { throw new Exception("Eklerken hata oluştu" + ex.InnerException); } }