Exemple #1
0
 public IHttpActionResult ApplyForSickLeave(LeaveRequest sickLeaveRequest)
 {
     if (sickLeaveRequest.EmployeeId == null)
     {
         return(NotFound());
     }
     try
     {
         if (ModelState.IsValid)
         {
             _leaveRequestRepository.ApplySickLeave(sickLeaveRequest);
         }
         return(Ok(sickLeaveRequest));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }