Esempio n. 1
0
        public ActionResult Update(Guid id)
        {
            RestorantKategori guncelrk = rks.GetbyID(id);

            ViewBag.RestaurantID = new SelectList(rs.GetActive(), "ID", "Name", guncelrk.RestaurantID);
            ViewBag.CategoryID   = new SelectList(cs.GetActive(), "ID", "Name", guncelrk.CategoryID);

            return(View(rks.GetbyID(id)));
        }
Esempio n. 2
0
 public ActionResult Update(RestorantKategori item)
 {
     ViewBag.RestaurantID = new SelectList(rs.GetActive(), "ID", "Name", item.RestaurantID);
     ViewBag.CategoryID   = new SelectList(cs.GetActive(), "ID", "Name", item.CategoryID);
     if (ModelState.IsValid)
     {
         bool sonuc = rks.Update(item);
         if (sonuc)
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             ViewBag.Mesaj = "Kategori Ekleme işlemi Sirasinda bir hata olustu.Lütfen daha sonra tekrar deneyin.";
         }
     }
     else
     {
         ViewBag.Mesaj = "Girmiş oldugunuz bilgiler hatali formattta veya eksiktir.Lütfen girmeye çaliştiğiniz verileri kontrol edin.";
     }
     return(View());
 }