Example #1
0
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            var product = _context.Product.Select(i => new {
                i.Id,
                i.StockCode,
                i.Name,
                i.SeoUrl,
                i.Model,
                i.Quantity,
                i.Image,
                i.TaxClassId,
                i.Description,
                i.Tag,
                i.MetaTitle,
                i.MetaDescription,
                i.MetaKeyword,
                i.Price
            });

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "Id" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(product, loadOptions)));
        }
Example #2
0
        public async Task <IActionResult> GetPostView(DataSourceLoadOptions loadOptions)
        {
            var query = from c in _context.Category
                        from p in _context.Post.Where(p => c.CategoryId == p.CategoryId && p.Status == PostStatus.Approved.ToString()).DefaultIfEmpty()
                        select new PostView
            {
                CategoryId       = c.CategoryId,
                ParentCategoryId = c.ParentId,
                CategoryName     = c.Name,
                CompanyId        = p == null? 0 : p.CompanyId,
                CompanyName      = p == null? "": p.Company.Name,
                Description      = p == null ? "" : p.Description,
                Img      = p == null ? "" : p.Img,
                MarkCode = p == null? "" : p.MarkCode,
                Price    = p == null? "" : p.Price,
                Title    = p == null? "" : p.Title,
                PostId   = p == null? 0 : p.PostId
            };

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "PostId" };
            // loadOptions.PaginateViaPrimaryKey = true;
            var data = await DataSourceLoader.LoadAsync(query, loadOptions);

            return(Json(data));
        }
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            var employee = _context.Employee.Select(i => new {
                i.EmployeeId,
                i.LastName,
                i.FirstName,
                i.Title,
                i.ReportsTo,
                i.BirthDate,
                i.HireDate,
                i.Address,
                i.City,
                i.State,
                i.Country,
                i.PostalCode,
                i.Phone,
                i.Fax,
                i.Email
            });

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "EmployeeId" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(employee, loadOptions)));
        }
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            var products = _context.Products
                           .Select(i => new
            {
                i.ProductId,
                i.ProductName,
                i.ProductDescription,
                i.ProductProductionStart,
                i.ProductAvailable,
                i.ProductSupportId,
                i.ProductEngineerId,
                i.ProductCurrentInventory,
                i.ProductBackorder,
                i.ProductManufacturing,
                i.ProductCost,
                i.ProductSalePrice,
                i.ProductRetailPrice,
                i.ProductConsumerRating,
                i.ProductCategory
            });

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "ProductId" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(products, loadOptions)));
        }
Example #5
0
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            var bewerbermodel = _context.uebersicht.Select(i => new {
                i.Id,
                i.Erstellt,
                i.Datum,
                i.NL,
                i.Vorname,
                i.Nachname,
                i.PLZ,
                i.Berufsgruppe,
                i.Berufdetail,
                i.Netzwerke,
                i.Netzwerkdetail,
                i.Status,
                i.Vorstellung,
                i.Erfolgt,
                i.Eingestellt,
                i.RefMail,
                i.Bearbeiter
            });

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "Id" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(bewerbermodel, loadOptions)));
        }
Example #6
0
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            var orders = _context.Orders.Select(i => new {
                i.OrderId,
                i.OrderInvoiceNumber,
                i.OrderCustomerId,
                i.OrderCustomerLocationId,
                i.OrderPoNumber,
                i.OrderEmployeeId,
                i.OrderDate,
                i.OrderSaleAmount,
                i.OrderShippingAmount,
                i.OrderTotalAmount,
                i.OrderShipDate,
                i.OrderShipMethod,
                i.OrderTerms,
                i.OrderComments
            });

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "OrderId" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(orders, loadOptions)));
        }
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            if (loadOptions.Filter is null)
            {
                loadOptions.Filter = new Object[] { "Pk_Empresa", "=", 0 };
            }

            var CatProdServ = _uow.Query <Cat_ProductosServicios>().Select(i => new CatProdServViewModel
            {
                Pk_ProductoServicio = i.Pk_ProductoServicio,
                Pk_Empresa          = i.Pk_Empresa,
                Clave_ProdServ_SAT  = i.Clave_ProdServ_SAT,
                Clave_Ident         = i.Clave_Ident,
                CodigoBarras        = i.CodigoBarras,
                Clave_Unidad_SAT    = i.Clave_Unidad_SAT,
                Unidad = i.Unidad,
                Descripcion_ProdServ_Base = i.Descripcion_ProdServ_Base,
                PrecioBase    = i.PrecioBase,
                IVAT          = i.IVAT,
                IEPST         = i.IEPST,
                IVAR          = i.IVAR,
                ISRR          = i.ISRR,
                IEstatal      = i.IEstatal,
                OtraRetencion = i.OtraRetencion
            });

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "Pk_Serie" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(CatProdServ, loadOptions)));
        }
Example #8
0
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            if (loadOptions.Filter is null)
            {
                loadOptions.Filter = new Object[] { "Pk_Empresa", "=", 0 };
            }

            var clientes = _uow.Query <Clientes>().Select(i => new ClientesViewModel
            {
                Pk_Cliente   = i.Pk_Cliente,
                Pk_Empresa   = i.Pk_Empresa, // probablemente se elimine
                RazonSocial  = i.RazonSocial,
                Denominacion = i.Denominacion,
                RFC          = i.RFC,
                Calle        = i.Calle,
                Interior     = i.Interior,
                Exterior     = i.Exterior,
                Colonia      = i.Colonia,
                CP           = i.CP
            });

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "Pk_Cliente" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(clientes, loadOptions)));
        }
Example #9
0
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            var customers = _context.Customers.Select(i => new {
                i.CustomerId,
                i.FirstName,
                i.LastName,
                i.Company,
                i.Address,
                i.City,
                i.State,
                i.Country,
                i.PostalCode,
                i.Phone,
                i.Fax,
                i.Email,
                i.SupportRepId
            });

            // If underlying data is a large SQL table, specify PrimaryKey and PaginateViaPrimaryKey.
            // This can make SQL execution plans more efficient.
            // For more detailed information, please refer to this discussion: https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "CustomerId" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(customers, loadOptions)));
        }
Example #10
0
        public async Task <object> LoadJobs(DataSourceLoadOptions loadOptions)
        {
            var Q     = _MyDbContext.Jobs.Include(j => j.Message);
            var query = await DataSourceLoader.LoadAsync(Q, loadOptions);

            return(query);
        }
        public async Task <LoadResult> Get(DataSourceLoadOptions loadOptions, [FromQuery] AccountingRecordsSearchRequest request)
        {
            var response =
                await _accountingRecordsService.Search(request) as WrappedResponse <IQueryable <AccountingRecord> >;

            return(await DataSourceLoader.LoadAsync(response?.Data, loadOptions));
        }
        public async Task <LoadResult> Get(DataSourceLoadOptions loadOptions, [FromQuery] CustomerDocumentSettingSearchRequest request)
        {
            var response = await _customerDocumentSettingsService
                           .Search(request) as WrappedResponse <IQueryable <CustomerDocumentSettings> >;

            return(await DataSourceLoader.LoadAsync(response?.Data, loadOptions));
        }
        public async Task <HttpResponseMessage> Get(DataSourceLoadOptions loadOptions)
        {
            var view_uebersicht = _context.view_uebersicht.Select(i => new
            {
                i.Id,
                i.Kennzeichen,
                i.Marke,
                i.Modell,
                i.Fahrzeughalter,
                i.Niederlassung,
                i.Kraftstoff,
                i.Neuwagen,
                i.Status,
                i.EinkaufId,
                i.ListenpreisB,
                i.EKPreisB,
                i.Erstzulassung,
                i.KMDatum,
                i.Kaufdatum,
                i.KMStand,
            });

            // If you work with a large amount of data, consider specifying the PaginateViaPrimaryKey and PrimaryKey properties.
            // In this case, keys and data are loaded in separate queries. This can make the SQL execution plan more efficient.
            // Refer to the topic https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
            // loadOptions.PrimaryKey = new[] { "Id" };
            // loadOptions.PaginateViaPrimaryKey = true;

            return(Request.CreateResponse(await DataSourceLoader.LoadAsync(view_uebersicht, loadOptions)));
        }
        public static async Task RunAsync <T>(IQueryable <T> data)
        {
            var loadOptions = new SampleLoadOptions {
                RequireTotalCount = true,
                Take           = 1,
                RemoteGrouping = true
            };

            {
                var loadResult = await DataSourceLoader.LoadAsync(data, loadOptions);

                Assert.Equal(3, loadResult.totalCount);
                Assert.Single(loadResult.data);
            }

            {
                loadOptions.TotalSummary = new[] {
                    new SummaryInfo {
                        SummaryType = "sum", Selector = nameof(IDataItem.Value)
                    }
                };

                var loadResult = await DataSourceLoader.LoadAsync(data, loadOptions);

                Assert.Equal(6m, loadResult.summary[0]);
            }

            Assert.Contains(loadOptions.ExpressionLog, i => i.EndsWith(".Count()"));
            Assert.Contains(loadOptions.ExpressionLog, i => i.EndsWith(".Take(1)"));
            Assert.Contains(loadOptions.ExpressionLog, i => i.Contains(".GroupBy"));
        }
Example #15
0
        public async Task NotSupported()
        {
            var error = await Record.ExceptionAsync(async delegate {
                await DataSourceLoader.LoadAsync(SAMPLE_DATA, new SampleLoadOptions());
            });

            Assert.True(error is NotSupportedException);
        }
        public async Task <IActionResult> OrdersLookup(DataSourceLoadOptions loadOptions)
        {
            var lookup = from i in _context.Orders
                         orderby i.OrderShipMethod
                         select new { Value = i.OrderId, Text = i.OrderShipMethod };

            return(Json(await DataSourceLoader.LoadAsync(lookup, loadOptions)));
        }
        public async Task <LoadResult> Get(DataSourceLoadOptions loadOptions, [FromQuery] DocumentNumberSequenceSearchRequest request)
        {
            var response =
                (WrappedResponse <IQueryable <DocumentNumberSequence> >) await _numberSequencesService
                .Search(request);

            return(await DataSourceLoader.LoadAsync(response.Data, loadOptions));
        }
        public async Task <LoadResult> BindDevExp(DataSourceLoadOptions loadOptions)
        {
            var data = _uow.NavigationMenuRepo
                       .TableNoTracking
                       .ProjectTo <NavigationMenuForListDto>(_mapper.ConfigurationProvider);

            return(await DataSourceLoader.LoadAsync(data, loadOptions));
        }
Example #19
0
        public async Task <IActionResult> GetOrganizasyon(DataSourceLoadOptions arama)
        {
            var veri = _context.Organizasyon.Include(p => p.Sirket);

            arama.PrimaryKey            = new[] { "id" };
            arama.PaginateViaPrimaryKey = true;
            return(Ok(await DataSourceLoader.LoadAsync(veri, arama)));
        }
Example #20
0
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            var data = _userManager.Users;

            var result = await DataSourceLoader.LoadAsync(data, loadOptions);

            return(Json(result));
        }
Example #21
0
        public async Task <IActionResult> GetSirket(DataSourceLoadOptions arama)
        {
            var veri = _context.Sirket;

            arama.PrimaryKey            = new[] { "id" };
            arama.PaginateViaPrimaryKey = true;
            return(Ok(await DataSourceLoader.LoadAsync(veri, arama)));
        }
        public async Task <IActionResult> EmployeesLookup(DataSourceLoadOptions loadOptions)
        {
            var lookup = from i in _context.Employees
                         orderby i.EmployeeFirstName
                         select new { Value = i.EmployeeId, Text = i.EmployeeFirstName };

            return(Json(await DataSourceLoader.LoadAsync(lookup, loadOptions)));
        }
        public async Task <LoadResult> Get(DataSourceLoadOptions loadOptions)
        {
            var user = await _accountService.GetUser(User);

            var query = _mapper.ProjectTo <GoodReceivedNoteBindingModel>(_grnService.GetAll()
                                                                         .FilterByUserWareHouses(user));

            return(await DataSourceLoader.LoadAsync(query, loadOptions));
        }
        public async Task <IActionResult> GetExecutionTestsPivot(DataSourceLoadOptions loadOptions)
        {
            var source = _executionTestsLogicService.GetExecutionTestsForPivot();

            loadOptions.PrimaryKey            = new[] { "Id" };
            loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(source, loadOptions)));
        }
        public async Task <IActionResult> GetResume(DataSourceLoadOptions loadOptions)
        {
            var empresas = _uow.Query <Empresas>().Select(i => new EmpresasResumenViewModel {
                Pk_Empresa   = i.Pk_Empresa,
                Denominacion = i.Denominacion
            });

            return(Json(await DataSourceLoader.LoadAsync(empresas, loadOptions)));
        }
Example #26
0
        public async Task <LoadResult> Get(DataSourceLoadOptions loadOptions)
        {
            var user = await _accountService.GetUser(User);

            var query = _mapper.ProjectTo <PurchaseOrderBindingModel>(_purchaseOrderService.GetAll()
                                                                      .FilterByUserWareHousesOptionally(user));

            return(await DataSourceLoader.LoadAsync(query, loadOptions));
        }
Example #27
0
        public async Task <LoadResult> GetStockAdjustmentsBtProductId(long id, DataSourceLoadOptions loadOptions)
        {
            var user = await _accountService.GetUser(User);

            var query = _mapper.ProjectTo <ProductStockAdjustmentBindingModel>(_stockService
                                                                               .GetStockAdjustmentsByProductId(id).FilterByUserWareHouses(user));

            return(await DataSourceLoader.LoadAsync(query, loadOptions));
        }
Example #28
0
 public async Task <LoadResult> DataSourceLoadAsync(DataSourceLoadOptionsBase loadOptions)
 {
     using (var uow = _uowFactory.CreateUnitOfWork())
     {
         return(await DataSourceLoader.LoadAsync(
                    uow.CreateRepository <IWordRepository>().GetContext().Words,
                    loadOptions));
     }
 }
        public async Task <IActionResult> Get(DataSourceLoadOptions loadOptions)
        {
            _context.Database.ExecuteSqlRaw("[dbo].[GETSTELLEN]");
            var stellenanzeigen = _context.Stellenanzeigen
                                  .FromSqlRaw <Stellenangebote>("SELECT * FROM STELLENANZEIGEN");



            return(Json(await DataSourceLoader.LoadAsync(stellenanzeigen, loadOptions)));
        }
        // GET api/<controller>
        public async Task <IHttpActionResult> Get([FromUri] DataSourceLoadOptions loadOptions)
        {
            UserTableBLL bll     = new UserTableBLL();
            var          results = bll.GetAll();

            loadOptions.PrimaryKey = new[] { "UserID" };
            //loadOptions.PaginateViaPrimaryKey = true;

            return(Json(await DataSourceLoader.LoadAsync(results, loadOptions)));
        }