public void Update(Order v)
        {
            Order r = _context.NorthwindWebService.UpdateOrder(v);

            v.OrderID = r.OrderID;
            v.OrderDate = r.OrderDate;
            v.RequiredDate = r.RequiredDate;
            v.ShippedDate = r.ShippedDate;
            v.Freight = r.Freight;
            v.ShipName = r.ShipName;
            v.ShipAddress = r.ShipAddress;
            v.ShipCity = r.ShipCity;
            v.ShipRegion = r.ShipRegion;
            v.ShipPostalCode = r.ShipPostalCode;
            v.ShipCountry = r.ShipCountry;
            v.OrderDetails = r.OrderDetails;
            v.Customer = r.Customer;
            v.Employee = r.Employee;
            v.Shipper = r.Shipper;
        }
        public ActionResult Search(Employee employee, string dateFrom, string dateTo)
        {
            var context = new Context();
            //			ViewData["employee"] = default(Employee);
            //			if (!string.IsNullOrEmpty(employeeId))
            //			{
            //				ViewData["employee"] = new EmployeeRepository(context).Read(Convert.ToInt32(employeeId));
            //			}

            DateTime dateFromParsed = default(DateTime);
            if (!string.IsNullOrEmpty(dateFrom) && !DateTime.TryParse(dateFrom, out dateFromParsed))
            {
                ModelState.AddModelError("dateFrom", "error parsing dateFrom");
            }
            ViewData["dateFrom"] = dateFromParsed;

            DateTime dateToParsed = default(DateTime);
            if (!string.IsNullOrEmpty(dateTo) && !DateTime.TryParse(dateTo, out dateToParsed))
            {
                ModelState.AddModelError("dateTo", "error parsing dateTo");
            }
            ViewData["dateTo"] = dateToParsed;

            var orders = new Order[0];
            if (ModelState.IsValid)
            {
                orders = new OrderRepository(context).Search((Employee)ViewData["employee"], (DateTime)ViewData["dateFrom"], (DateTime) ViewData["dateFrom"]);
            }
            return View(orders);
        }
 public Order CreateOrder(Order order)
 {
     object[] results = Invoke("CreateOrder", new object[] {order});
     return ((Order) (results[0]));
 }
 public void DeleteOrder(Order order)
 {
     object[] results = Invoke("DeleteOrder", new object[] {order});
 }
 public void Delete(Order v)
 {
     _context.NorthwindWebService.DeleteOrder(v);
 }