Exemplo n.º 1
0
        public ActionResult fuarDuzenle(fuar b)
        {
            try
            {
                using (sifaeczadposuEntities context = new sifaeczadposuEntities())
                {
                    var _fuarDuzenle = context.fuar.Where(x => x.ID == b.ID).FirstOrDefault();

                    _fuarDuzenle.fuaradi  = b.fuaradi;
                    _fuarDuzenle.aciklama = b.aciklama;
                    _fuarDuzenle.tarih    = DateTime.Now;
                    context.SaveChanges();
                    return(RedirectToAction("fuar", "Admin"));
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Güncellerken hata oluştu " + ex.Message);
            }
        }
Exemplo n.º 2
0
 public ActionResult fuarEkle(fuar b)
 {
     try
     {
         using (sifaeczadposuEntities context = new sifaeczadposuEntities())
         {
             fuar _fuar = new fuar();
             _fuar.fuaradi  = b.fuaradi;
             _fuar.aciklama = b.aciklama;
             _fuar.tarih    = DateTime.Now;
             context.fuar.Add(_fuar);
             context.SaveChanges();
             return(RedirectToAction("fuar", "Admin"));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Eklerken hata oluştu");
     }
 }