public ApprovalAttendanceScheduleProxy GetItem(decimal id) { try { var item = ApprovalAttendanceScheduleBusiness.GetByID(id); var proxy = ApprovalAttendanceScheduleBusiness.ConvertToProxy(item); return(proxy); } catch (Exception ex) { this.exceptionHandler.ApiHandleException("ApprovalScheduleController", ex); throw ex; } }
public HttpResponseMessage Edit(decimal id, ApprovalAttendanceScheduleProxy viewModel) { try { viewModel.ID = id; ApprovalAttendanceScheduleBusiness.UpdateApprovalAttendanceScheduleProxy(viewModel); return(Request.CreateResponse(HttpStatusCode.OK, viewModel)); } catch (UIValidationExceptions ex) { this.exceptionHandler.ApiHandleException("ApprovalScheduleController", ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.ExceptionList.Count > 0 ? ex.ExceptionList[0].Message : ex.Message)); } catch (Exception ex) { this.exceptionHandler.ApiHandleException("ApprovalScheduleController", ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }