Beispiel #1
0
        private GrupKullaniciIzinViewModel GrupKullaniciVeIzinleriGetir(int grupId)
        {
            Grup grup = grupRepo.Gruplar.FirstOrDefault(x => x.GrupId == grupId);

            var tumIzinler = izinRepo.Izinler.Select(p => new SelectListItem {
                Text = p.IzinAdi, Value = p.IzinId.ToString()
            }).ToList();

            tumIzinler.Insert(0, new SelectListItem {
                Text = "Izin seçiniz", Value = "0"
            });

            var tumKullanicilar = kullaniciRepo.Kullanicilar.Select(p => new SelectListItem {
                Text = p.KullaniciAdi, Value = p.KullaniciId.ToString()
            }).ToList();

            tumKullanicilar.Insert(0, new SelectListItem {
                Text = "Kullanıcı seçiniz", Value = "0"
            });

            var model = new GrupKullaniciIzinViewModel
            {
                Grup                = grup,
                Kullanicilar        = grupRepo.GrupKullanicilariniGetir(grupId),
                Izinler             = grupRepo.GrupIzinleriniGetir(grupId),
                TumIzinler          = tumIzinler,
                TumKullanicilar     = tumKullanicilar,
                SelectedIzinId      = 0,
                SelectedKullaniciId = 0
            };

            return(model);
        }
Beispiel #2
0
        private ActionResult LoadToGrupView(int grupId)
        {
            ModelState.Clear();
            GrupKullaniciIzinViewModel model = GrupKullaniciVeIzinleriGetir(grupId);

            return(View("KullaniciVeIzinler", model));
        }
Beispiel #3
0
        public ViewResult KullaniciVeIzinler(int grupId)
        {
            GrupKullaniciIzinViewModel model = GrupKullaniciVeIzinleriGetir(grupId);

            return(View(model));
        }