Ejemplo n.º 1
0
        public ActionResult Center_Read([DataSourceRequest] DataSourceRequest request)
        {
            CenterHomePageView centerHomePageView = new CenterHomePageView();

            centerHomePageView.EmployeeView = GetEmployee();

            #region Access Check
            bool hasPermission = GetEmployee().IsGuaranteed("Center_Read");
            if (!hasPermission)
            {
                ModelState.AddModelError("", "AccessDenied");
                return(Json(centerHomePageView.CenterViews.ToDataSourceResult(request)));
            }
            #endregion

            centerHomePageView.CenterViews = this._centerService.GetCenters().CenterViews;

            return(Json(centerHomePageView.CenterViews.ToDataSourceResult(request)));
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            CenterHomePageView centerHomePageView = new CenterHomePageView();

            centerHomePageView.EmployeeView = GetEmployee();

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


            centerHomePageView.CenterViews = this._centerService.GetCenters().CenterViews;

            return(View(centerHomePageView));
        }