示例#1
0
        public ListLeavesResponse ListLeavesByEmployee(int maximumRows       = 10, int startRowIndex = 1,
                                                       string sortExpression = null, string employee = null, LeaveCategories?category = null,
                                                       LeaveStatuses?status  = null)
        {
            int totalRowCount = 0;
            var response      = new ListLeavesResponse();

            try
            {
                LeaveComponent bc = new LeaveComponent();
                response.Leaves = bc.ListLeavesByEmployee(maximumRows, startRowIndex, sortExpression,
                                                          employee, category, status, out totalRowCount);
                response.TotalRowCount = totalRowCount;
            }
            catch (Exception ex)
            {
                // Repack to Http error.
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422, // Unprocessable Entity
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }

            return(response);
        }
示例#2
0
        /// <summary>
        /// Calls the ListLeavesByEmployee business method of the LeaveComponent.
        /// </summary>
        /// <param name="maximumRows"> A maximumRows value.</param>
        /// <param name="startRowIndex"> A startRowIndex value.</param>
        /// <param name="sortExpression"> A sortExpression value.</param>
        /// <param name="employee"> A employee value.</param>
        /// <param name="category"> A category value.</param>
        /// <param name="status"> A status value.</param>
        /// <param name="int"> A int value.</param>
        /// <returns>Returns a List<Leave> object.</returns>
        public List <Leave> ListLeavesByEmployee(int maximumRows, int startRowIndex,
                                                 string sortExpression, string employee, LeaveCategories?category,
                                                 LeaveStatuses?status, out int totalRowCount)
        {
            LeaveComponent bc = new LeaveComponent();

            return(bc.ListLeavesByEmployee(maximumRows, startRowIndex, sortExpression,
                                           employee, category, status, out totalRowCount));
        }
示例#3
0
        //[Route("{action}/{maximumRows}/{startRowIndex}sortExpression={sortExpression}&employee={employee}&category={category=}&status={status=}")]
        public ListLeavesResponse ListLeavesByEmployee(int maximumRows, int startRowIndex,
                                                       string sortExpression, string employee, LeaveCategories?category,
                                                       LeaveStatuses?status)
        {
            int totalRowCount = 0;
            var response      = new ListLeavesResponse();

            LeaveComponent bc = new LeaveComponent();

            response.Leaves = bc.ListLeavesByEmployee(maximumRows, startRowIndex, sortExpression,
                                                      employee, category, status, out totalRowCount);
            response.TotalRowCount = totalRowCount;

            return(response);
        }