Esempio n. 1
0
        public ActionResult Detail(int id)
        {
            var response = _kpiService.GetKpiDetail(new GetKpiRequest {
                Id = id
            });
            var viewModel = response.MapTo <DetailKpiViewModel>();

            return(View(viewModel));
        }
Esempio n. 2
0
        private bool ValidateAuthorizeKPI(int kpiId)
        {
            var response = new DSLNG.PEAR.Services.Responses.Kpi.GetKpiDetailResponse();

            if (this.UserProfile().IsSuperAdmin)
            {
                return(true);
            }
            response = _kpiService.GetKpiDetail(new Services.Requests.Kpi.GetKpiRequest {
                Id = kpiId
            });
            if (response.IsSuccess)
            {
                if (response.RoleGroup == this.UserProfile().RoleName)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(false);
        }