//
 // GET: /Employee/Search
 public ActionResult Search()
 {
     var employees = new Employee[0];
     if (Request.IsAjaxRequest())
     {
         return PartialView("SearchPartial", employees);
     }
     return View(employees);
 }
        public void Update(Employee v)
        {
            Employee r = _context.NorthwindWebService.UpdateEmployee(v);

            v.EmployeeID = r.EmployeeID;
            v.LastName = r.LastName;
            v.FirstName = r.FirstName;
            v.Title = r.Title;
            v.TitleOfCourtesy = r.TitleOfCourtesy;
            v.BirthDate = r.BirthDate;
            v.HireDate = r.HireDate;
            v.Address = r.Address;
            v.City = r.City;
            v.Region = r.Region;
            v.PostalCode = r.PostalCode;
            v.Country = r.Country;
            v.HomePhone = r.HomePhone;
            v.Extension = r.Extension;
            v.Notes = r.Notes;
            v.PhotoPath = r.PhotoPath;
        }
        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 Employee CreateEmployee(Employee employee)
 {
     object[] results = Invoke("CreateEmployee", new object[] {employee});
     return ((Employee) (results[0]));
 }
 public Order[] SearchOrder(Employee employee, DateTime dateFrom, DateTime dateTo)
 {
     object[] results = Invoke("SearchOrder", new object[] {employee, dateFrom, dateTo});
     return ((Order[]) (results[0]));
 }
 public void DeleteEmployee(Employee employee)
 {
     object[] results = Invoke("DeleteEmployee", new object[] {employee});
 }
 public Order[] Search(Employee employee, DateTime dateFrom, DateTime dateTo)
 {
     return _context.NorthwindWebService.SearchOrder(employee, dateFrom, dateTo);
 }
 public void Delete(Employee v)
 {
     _context.NorthwindWebService.DeleteEmployee(v);
 }
 public ActionResult Search(string lastName, string firstName, string title)
 {
     var employees = new Employee[0];
     try
     {
         employees = new EmployeeRepository(new Context()).Search(lastName, firstName, title);
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(string.Empty, ex.Message);
     }
     return PartialView("SearchPartial", employees);
 }