Esempio n. 1
0
        public ActionResult GetAllSalesOrderForSelect()
        {
            var repository = new SalesOrdersRepository(_context);

            return(Ok(repository.GetAll()
                      .Select(r => new SelectItem(r.ID.ToString(), r.SalesOrderNo + " - " + r.Customer.Name))
                      .ToList()));
        }
Esempio n. 2
0
        public ActionResult GetAllSalesOrder()
        {
            var repository = new SalesOrdersRepository(_context);
            IGridServer <SalesOrder> server = new GridServer <SalesOrder>(repository.GetAll(), Request.Query,
                                                                          true, "salesOrdersGrid", c => ColumnCollections.SalesOrderColumnsWithCustomer(c, null, null))
                                              .WithPaging(10)
                                              .Sortable()
                                              .Filterable()
                                              .WithMultipleFilters()
                                              .WithGridItemsCount();

            var salesOrders = server.ItemsToDisplay;

            return(Ok(salesOrders));
        }