예제 #1
0
        public HttpResponseMessage DeleteEmployeeProjectRoleAssignmnet(int employee_id, int project_id, int role_id)
        {
            HttpResponseMessage response = null;

            try
            {
                if (employee_id != 0 && project_id != 0 && role_id != 0)
                {
                    Project_role project_role = ProjectRepo.GetAssignedEmployeebyid(employee_id, project_id, role_id);
                    if (project_role != null)
                    {
                        ProjectRepo.DeleteEmployeeProjectRoleAssignmnet(project_role);
                        response = Request.CreateResponse(HttpStatusCode.OK, new EMSResponseMessage("EMS_001", "Employee deleted from the given project", "Employee deleted from the given project"));
                    }
                    else
                    {
                        response = Request.CreateResponse(HttpStatusCode.OK, new EMSResponseMessage("EMS_001", "Failure : check employe id, role id and project id", "Failure : check employe id, role id and project id"));
                    }
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.OK, new EMSResponseMessage("EMS_102", "Invalid Input", "Please check input Json, Project details and employee status"));
                }
            }
            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);
        }