Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Entity Framework 101
Message
From
04/06/2014 10:15:27
 
 
To
04/06/2014 10:07:37
General information
Forum:
ASP.NET
Category:
Entity Framework
Environment versions
Environment:
C# 4.0
OS:
Windows 8
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01601183
Message ID:
01601264
Views:
33
Can you help me fit that code into this, please?
@model IBCPackageTracking.Route

@{
    ViewBag.Title = "Route";
}

<h2>Get Run Sheet for your Route</h2>
<div class="content">
    <div class="float-left">
        <select id="SelectRoute" data-bind="options: routes, optionsText: 'rte_name', optionsCaption: 'Select a Route', optionsValue: 'rte_pk'">
        </select>
        <p>Date: <input type="text" id="datepicker"></p>
        <div><input type="submit" value="Get Run Sheet" /></div>
    </div>

</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
    $(function () {
        $("#datepicker").datepicker();
    });
</script>

    <script type="text/javascript" src="@Url.Content("~/Scripts/knockout-2.2.0.js")"></script>
    <script type="text/javascript">
        // View-model will go here
        function RoutesViewModel() {
            var self = this;
            self.routes = ko.observableArray();

            var baseUri = '@ViewBag.ApiUrl';

            self.create = function (formElement) {
                // If the form data is valid, post the serialized form data to the web API.
                $(formElement).validate();
                if ($(formElement).valid()) {
                    $.post(baseUri, $(formElement).serialize(), null, "json")
                        .done(function (o) {
                            // Add the new product to the view-model.
                            self.routes.push(o);
                        });
                }
            }

            self.update = function (route) {
                $.ajax({ type: "PUT", url: baseUri + '/' + route.Id, data: route });
            }

            self.remove = function (route) {
                // First remove from the server, then from the view-model.
                $.ajax({ type: "DELETE", url: baseUri + '/' + route.Id })
                    .done(function () { self.products.remove(route); });
            }

            $.getJSON(baseUri, self.routes);
            
        }

        $(document).ready(function () {
            ko.applyBindings(new RoutesViewModel());
        })
    </script>
}
>You don't need stored proc for this.
>
>Something like
>
>var customers = context.Customers.OrderBy(c => c.CompanyName);
>var customers = context.Customers.Where(c => c.State == "NY" && c.City == "New York");
>
>or mix them
>
>var customers = context.Customers.Where(c => c.State == "NY" && c.City == "New York").OrderBy(c => c.CompanyName);
>
>
>
>>
>>1. I need to display a list of possible selections in a dropdown list, so I want to select all the selections from my table and sort them alphabetically.
>>
>>2. I need to pull out a subset of data based on a couple parameters.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform