예제 #1
0
        public List <Object[]> getReviweData(int projectId, int year, int quarter, int employeeId)
        {
            List <Object[]> returnData = new List <object[]>();
            bool            rights     = authRepo.getAdminRights() || authRepo.getTeamLeadRights(projectId);
            bool            b          = authRepo.getLoggedInUserAuthentication(employeeId);

            Debug.WriteLine("Rights " + authRepo.getAdminRights() + " " + authRepo.getTeamLeadRights(projectId));
            if (rights)
            {
                returnData = repo.getReviweData(projectId, year, quarter, employeeId);
            }
            else if (b)
            {
                returnData = repo.getReviweData(projectId, year, quarter, employeeId);
            }
            return(returnData);
        }
예제 #2
0
        public HttpResponseMessage getReviweData(int projectId, int year, int quarter, int employeeId)
        {
            List <Object[]> returnData = new List <object[]>();
            bool            rights     = authRepo.getAdminRights() || authRepo.getTeamLeadRights(projectId);
            bool            b          = authRepo.getLoggedInUserAuthentication(employeeId);

            Debug.WriteLine("Rights " + authRepo.getAdminRights() + " " + authRepo.getTeamLeadRights(projectId));
            if (rights)
            {
                returnData = repo.getReviweData(projectId, year, quarter, employeeId);
                return(Request.CreateResponse(HttpStatusCode.OK, returnData));
            }
            else if (b)
            {
                returnData = repo.getReviweData(projectId, year, quarter, employeeId);
                return(Request.CreateResponse(HttpStatusCode.OK, returnData));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.Forbidden));
            }
        }