예제 #1
0
        public Page<File> GetInvoicesForVendor(VendorInvoiceCriteria criteria)
        {
            var sql = new Sql(@"SELECT f.* FROM vwFiles f
                        inner join vwWorkItemDetail wi on wi.WorkItemID = f.ParentId
                        where f.FileUse = 3 AND wi.VendorGUID = @0", criteria.VendorId);

            var files = _repository.PagedQuery<File>(criteria.PageNumber, criteria.ItemsPerPage, sql.SQL, sql.Arguments);

            return files;
        }
예제 #2
0
        public JsonResult ListInvoices(VendorInvoiceCriteria criteria)
        {
            var page = _fileQueries.GetInvoicesForVendor(criteria);

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