コード例 #1
0
        // GET: User
        public ActionResult Detail(string id)
        {
            var model = _taiKhoanRepo.getTaiKhoanInfo(id);

            List <QuyenModel>     listQuyen = _quyenRepo.GetQuyenById(model.Data.FirstOrDefault().MaQuyen).Data;
            List <SelectListItem> quyen     = new List <SelectListItem>();

            quyen.AddRange(from a in listQuyen
                           select new SelectListItem
            {
                Text     = a.TenQuyen,
                Value    = a.MaQuyen,
                Selected = a.MaQuyen == model.Data.FirstOrDefault().MaQuyen
            });
            if (listQuyen.Count != 0)
            {
                ViewBag.Quyen = quyen;
            }

            return(View(model.Data.FirstOrDefault()));
        }
コード例 #2
0
        public ActionResult Edit(string id)
        {
            var model = _quyenRepo.GetQuyenById(id);

            return(View(model.Data.FirstOrDefault()));
        }