예제 #1
0
        // GET: EczaneNobet/Monitor
        public ActionResult Index()
        {
            var user            = _userService.GetByUserName(User.Identity.Name);
            var monitorDetaylar = _monitorService.GetDetaylarListByUser(user);
            var rolId           = _userRoleService.GetListByUserId(user.Id).FirstOrDefault().RoleId;
            List <UserRoleDetay> userRoleDetaylar = _userRoleService.GetDetaylarByUserId(user.Id).ToList();

            if (rolId == 2)
            {
                monitorDetaylar = _monitorService.GetDetaylar();
            }

            var model = new MonitorDetayViewModel()
            {
                MonitorDetaylar  = monitorDetaylar,
                UserRoleDetaylar = userRoleDetaylar
            };

            return(View(model));
        }