Beispiel #1
0
        [Route("api/v1/leave/fullhistoryby/{reportingto_id?}")] // pending approval in hr manager
        public HttpResponseMessage GetPendingApprovedList(int reportingto_id = 0)
        {
            HttpResponseMessage response = null;

            try
            {
                //Project_role project_role = ProjectRepo.GetProjectIdRoleId(employee.id);
                //string role_name = ProjectRepo.GetRoleNameById(project_role.role_id);
                //if (role_name == "HR")
                //{
                List <LeavehistoryModel> leave_history = LeaveRepo.GetApprovedRejectedCancelledLeave(reportingto_id);
                response = Request.CreateResponse(HttpStatusCode.OK, new EMSResponseMessage("EMS_001", "Success", leave_history));
                //}
            }
            catch (Exception exception)
            {
                Debug.WriteLine(exception.Message);
                Debug.WriteLine(exception.GetBaseException());
                response = Request.CreateResponse(HttpStatusCode.OK, new EMSResponseMessage("EMS_101", "Application Error", exception.Message));
            }
            return(response);
        }