コード例 #1
0
 // GET: api/LeaveTypes
 public HttpResponseMessage GetLeaveTypes()
 {
     try
     {
         var message = Request.CreateErrorResponse(HttpStatusCode.NotFound, "404 : Data Not Found");
         var result  = iLeaveTypesService.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 LoadData()
 {
     cmb_LeaveType.ItemsSource = iLeaveTypeService.Get();
     if (_employee.Role == "1")
     {
         Button_Approve.Visibility = Visibility.Collapsed;
         Button_Reject.Visibility  = Visibility.Collapsed;
     }
     else if (_employee.Role == "2")
     {
         Button_Approve.Visibility = Visibility.Visible;
     }
     else if (_employee.Role == "3")
     {
         Button_Approve.Visibility = Visibility.Visible;
     }
 }
コード例 #3
0
 private void LoadCombo()
 {
     cmb_LeaveType.ItemsSource = iLeaveTypeService.Get();
 }