コード例 #1
0
 // GET: api/LeaveRequests
 public HttpResponseMessage GetLeaveRequests()
 {
     try
     {
         var message = Request.CreateErrorResponse(HttpStatusCode.NotFound, "404 : Data Not Found");
         var result  = iLeaveRequestService.Get();
         if (result != null)
         {
             message = Request.CreateResponse(HttpStatusCode.OK, result);
         }
         return(message);
     }
     catch (Exception e)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "500 : Internal Server Error"));
     }
 }
コード例 #2
0
 private void LoadGrid()
 {
     if (_employee.Role == "1")
     {
         HistoryDataGrid.ItemsSource = iLeaveRequestService.GetbyUser(_employee.Id);
     }
     else if (_employee.Role == "2")
     {
         HistoryDataGrid.ItemsSource = iLeaveRequestService.GetByManager();
     }
     else
     {
         HistoryDataGrid.ItemsSource = iLeaveRequestService.Get();
     }
 }