Beispiel #1
0
 public ActionResult Guncelle(Kategori model, int number, string OldMedia)
 {
     if (model.MediaPath == null)
     {
         model.MediaPath = OldMedia;
     }
     using (KategoriRepository repo = new KategoriRepository())
     {
         model.KategoriId = number;
         bool result = repo.Update(model);
         TempData["Message"] = result == true ? new TempDataDictionary {
             { "class", "alert alert-success" }, { "msg", "Kategroi eklendi." }
         } : new TempDataDictionary {
             { "class", "alert alert-danger" }, { "msg", "Kategroi eklenemedi." }
         };
         return(RedirectToAction("Liste"));
     }
 }