예제 #1
0
        /// <summary>
        /// Calls the Approve operation method in the LeaveWorkflowService.
        /// </summary>
        /// <param name="leave">A leave value.</param>
        public Leave Approve(Leave leave)
        {
            LeaveWorkflowServiceClient proxy = new LeaveWorkflowServiceClient();

            try
            {
                return(proxy.Approve(leave));
            }
            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();
            }
        }
예제 #2
0
        /// <summary>
        /// Calls the Apply operation method in the LeaveWorkflowService.
        /// </summary>
        /// <param name="leave">A leave value.</param>
        public Leave Apply(Leave leave)
        {
            LeaveWorkflowServiceClient proxy = new LeaveWorkflowServiceClient();

            Validations.ValidateLeaveDates(leave);

            try
            {
                leave.CorrelationID = Guid.NewGuid();
                return(proxy.Apply(leave));
            }
            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();
            }
        }