public ActionResult Liste() { using (KullaniciRepository repo = new KullaniciRepository()) { return(View(repo.GetList())); } }
public ActionResult Index() { Kullanici user = Session["loginSU"] as Kullanici; KategoriMenuUrunKullaniciModel model = new KategoriMenuUrunKullaniciModel(); if (user.Yetki == (int)EnumYetki.Admin) { using (KategoriRepository repo = new KategoriRepository()) { model.KategoriList = repo.GetList(); } using (MenuRepository repo = new MenuRepository()) { model.MenuList = repo.GetList(); } using (UrunRepository repo = new UrunRepository()) { model.UrunList = repo.GetList(); } using (KullaniciRepository repo = new KullaniciRepository()) { model.KullaniciList = repo.GetList(); } return(View(model)); } else if (user.Yetki == (int)EnumYetki.Isletme) { using (IsletmeUrunRepository repo = new IsletmeUrunRepository()) { ViewBag.IsletmeUrunList = repo.IsletmeninUrunleri(user.KullaniciId); } } return(View()); }