Ejemplo n.º 1
0
        public ActionResult Agency_Read([DataSourceRequest] DataSourceRequest request)
        {
            AgencyHomePageView agencyHomePageView = new AgencyHomePageView();

            agencyHomePageView.EmployeeView = GetEmployee();

            #region Access Check
            bool hasPermission = GetEmployee().IsGuaranteed("Agency_Read");
            if (!hasPermission)
            {
                return(Json(agencyHomePageView.AgencyViews.ToDataSourceResult(request)));
            }
            #endregion

            agencyHomePageView.AgencyViews = this._agencyService.GetAgencies().data;
            return(Json(agencyHomePageView.AgencyViews.ToDataSourceResult(request)));
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            AgencyHomePageView agencyHomePageView = new AgencyHomePageView();

            agencyHomePageView.EmployeeView = GetEmployee();

            #region Access Check
            bool hasPermision = GetEmployee().IsGuaranteed("Agency_Read");
            if (!hasPermision)
            {
                ModelState.AddModelError("", "AccessDenied");
                return(View(agencyHomePageView));
            }
            #endregion

            agencyHomePageView.AgencyViews = this._agencyService.GetAgencies().data;
            return(View(agencyHomePageView));
        }