Ejemplo n.º 1
0
        /// <summary>
        /// Calls the GetLeaveById operation method in the LeaveService.
        /// </summary>
        /// <param name="leaveID">A leaveID value.</param>
        /// <returns>Returns a Leave object.</returns>
        public Leave GetLeaveById(long leaveID)
        {
            Leave result             = default(Leave);
            LeaveServiceClient proxy = new LeaveServiceClient();

            try
            {
                result = proxy.GetLeaveById(leaveID);
            }
            catch (FaultException fex)
            {
                // TODO: Handle your exception here or raise it to the UI.
                //		 Do not display sensitive information to the UI.
                throw new ApplicationException(fex.Message);
            }
            finally
            {
                proxy.Close();
            }
            return(result);
        }