Example #1
0
 internal bool RafDuzenle(Rafs model)
 {
     try
     {
         var duzen = _db.Rafs.First(x => x.ID == model.ID);
         duzen.RafAdi = model.RafAdi.Trim();
         _db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #2
0
 internal bool RafSil(Rafs model)
 {
     try
     {
         var sil = _db.Rafs.First(x => x.ID == model.ID);
         _db.Rafs.Remove(sil);
         _db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #3
0
 public ActionResult RafSil(Rafs model)
 {
     if (ModelState.IsValid)
     {
         bool kontrol = _film.RafSil(model);
         if (kontrol)
         {
             return(RedirectToAction("RafListesi"));
         }
         else
         {
             return(RedirectToAction("HataBildirimi", new { Bilgi = "Raf Silinirken Bir Hata Oluştu" }));
         }
     }
     return(View(model));
 }
Example #4
0
 public ActionResult RafDuzenle(Rafs model)
 {
     if (ModelState.IsValid)
     {
         bool kontrol = _film.RafDuzenle(model);
         if (kontrol)
         {
             return(RedirectToAction("RafListesi"));
         }
         else
         {
             return(RedirectToAction("HataBildirimi", new { Bilgi = "Raf Düzenleme İşleminde Hata Oluştu" }));
         }
     }
     return(View(model));
 }
Example #5
0
 internal bool RafEkle(Rafs model)
 {
     try
     {
         model.RafAdi      = model.RafAdi.Trim();
         model.KayitTarihi = DateTime.Today;
         var raf = _db.Rafs.SingleOrDefault(x => x.RafAdi == model.RafAdi);
         if (raf != null)
         {
             return(true);
         }
         _db.Rafs.Add(model);
         _db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }