public ActionResult _ForeignKeyColumnUpdateOrder(int id, int employeeId)
        {
            var order = new ClientEditableOrder
            {
                OrderID  = id,
                Employee = new NorthwindDataContext().Employees
                           .Where(e => e.EmployeeID == employeeId)
                           .Select(e => e.FirstName + " " + e.LastName).SingleOrDefault()
            };

            // Exclude "Employee" from the list of updated properties
            if (TryUpdateModel(order, null, null, new[] { "Employee" }))
            {
                SessionClientOrderRepository.Update(order);
            }

            return(View(new GridModel(SessionClientOrderRepository.All())));
        }
 public ActionResult _ForeignKeyColumn()
 {
     return(View(new GridModel(SessionClientOrderRepository.All())));
 }
Example #3
0
        public ActionResult _ClientEditTemplate()
        {
            PopulateEmployees();

            return(View(new GridModel(SessionClientOrderRepository.All())));
        }
 public ActionResult EditingCustom_Read([DataSourceRequest] DataSourceRequest request)
 {
     return(Json(SessionClientOrderRepository.All().ToDataSourceResult(request)));
 }
Example #5
0
 public ActionResult ForeignKeyColumn_Read([DataSourceRequest] DataSourceRequest request)
 {
     return(Json(SessionClientOrderRepository.All().ToDataSourceResult(request)));
 }