예제 #1
0
 public IActionResult ShippersLookup(DataSourceLoadOptions options)
 {
     return(DataSourceLoadResult.Create(
                from s in _nwind.Shippers
                orderby s.CompanyName
                select new { Value = s.ShipperID, Text = s.CompanyName },
                options
                ));
 }
예제 #2
0
 public IActionResult CustomersLookup(DataSourceLoadOptions options)
 {
     return(DataSourceLoadResult.Create(
                from c in _nwind.Customers
                orderby c.CompanyName
                select new { Value = c.CustomerID, Text = $"{c.CompanyName} ({c.Country})" },
                options
                ));
 }
예제 #3
0
 public IActionResult OrderDetails(int orderID, DataSourceLoadOptions options)
 {
     return(DataSourceLoadResult.Create(
                from i in _nwind.Order_Details
                where i.OrderID == orderID
                select new {
         i.Product.ProductName,
         i.UnitPrice,
         i.Quantity,
         Sum = i.UnitPrice * i.Quantity
     },
                options
                ));
 }
예제 #4
0
        public async Task <IActionResult> Appointments(DataSourceLoadOptions loadOptions)
        {
            var url = "https://www.googleapis.com/calendar/v3/calendars/"
                      + "*****@*****.**"
                      + "/events?key=" + "AIzaSyBnNAISIUKe6xdhq1_rjor2rxoI3UlMY7k";

            using (var client = new HttpClient()) {
                var json = await client.GetStringAsync(url);

                var appointments = from i in JObject.Parse(json)["items"]
                                   select new {
                    text           = (string)i["summary"],
                    startDate      = (DateTime?)i["start"]["dateTime"],
                    endDate        = (DateTime?)i["end"]["dateTime"],
                    recurrenceRule = ""                    // TODO consider replacing with '-expr' attribute in 15.2.6
                };

                return(DataSourceLoadResult.Create(appointments, loadOptions));
            }
        }
예제 #5
0
 public IActionResult Orders(DataSourceLoadOptions options)
 {
     return(DataSourceLoadResult.Create(_nwind.Orders, options));
 }