public Page<WorkItemVendorAssignment> GetAssignments(WorkItemVendorAssignmentsCriteria criteria)
        {
            var sql = Sql.Builder
               .OrderBy(criteria.OrderBy + " " + criteria.OrderByDirection)
               .Where("workOrderNumber=@0", criteria.WorkOrderNumber);

            if (criteria.Field.ToLower() != "all") sql.And("field=@0", criteria.Field);

            return _repository.PagedQuery<WorkItemVendorAssignment>(criteria.PageNumber, criteria.ItemsPerPage, sql.SQL, sql.Arguments);
        }
示例#2
0
        public JsonResult VendorAssignments(WorkItemVendorAssignmentsCriteria criteria)
        {
            var page = _workItemVendorAssignmentsQueries.GetAssignments(criteria);

            return Json(new
            {
                total = page.TotalPages,
                page = page.CurrentPage,
                records = page.TotalItems,
                rows = page.Items.Select(Mapper.Map<WorkItemVendorAssignmentViewModel>)
            });
        }