Exemplo n.º 1
0
        public Leave GetLeaveById(long leaveID)
        {
            Leave result = null;

            try
            {
                LeaveComponent bc = new LeaveComponent();
                result = bc.GetLeaveById(leaveID);
            }
            catch (Exception ex)
            {
                // Repack to Http error.
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422, // Unprocessable Entity
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Calls the GetLeaveById business method of the LeaveComponent.
        /// </summary>
        /// <param name="leaveID"> A leaveID value.</param>
        /// <returns>Returns a Leave object.</returns>
        public Leave GetLeaveById(long leaveID)
        {
            LeaveComponent bc = new LeaveComponent();

            return(bc.GetLeaveById(leaveID));
        }