Exemplo n.º 1
0
        public ActionResult Code_Read(string id, [DataSourceRequest] DataSourceRequest request)
        {
            CodeHomePageView CodeHomePageView = new CodeHomePageView();

            CodeHomePageView.EmployeeView = GetEmployee();

            #region Access Check
            bool hasPermission = GetEmployee().IsGuaranteed("Code_Read");
            if (!hasPermission)
            {
                ModelState.AddModelError("", "AddcessDenied");
                return(Json(CodeHomePageView.CodeViews.ToDataSourceResult(request)));
            }
            #endregion

            CodeHomePageView.CodeViews = this._codeService.GetCodes(Guid.Parse(id)).CodeViews;

            return(Json(CodeHomePageView.CodeViews.ToDataSourceResult(request)));
        }
Exemplo n.º 2
0
        public ActionResult Index(string id)
        {
            CodeHomePageView codeHomePageView = new CodeHomePageView();

            codeHomePageView.EmployeeView = GetEmployee();

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

            codeHomePageView.CodeViews = _codeService.GetCodes(Guid.Parse(id)).CodeViews;

            GetRequest getCenterRequest = new GetRequest();
            getCenterRequest.ID          = Guid.Parse(id);
            codeHomePageView.CenterView  = _centerService.GetCenter(getCenterRequest).CenterView;
            codeHomePageView.CenterViews = _centerService.GetCenters().CenterViews;

            return(View(codeHomePageView));
        }