public OrderDriver FinishTrip(Guid orderId, Guid driverId) { Client.FinishTrip(driverId, orderId); Order order = Parser.GetOrder(Client.FindOrder(orderId)); Driver driver = Parser.GetDriver(Client.FindDriver(driverId)); OrderDriver orderDriver = new OrderDriver(order, driver); //return View(orderDriver); return(orderDriver); }
/*public ActionResult GetOrder(Guid driverId, Guid orderId) //взять заказ * { * OrderDriver orderDriver = new OrderDriver(Parser.GetOrder(Client.FindOrder(orderId)), Parser.GetDriver(Client.FindDriver(driverId))); * Client.GetOrder(orderDriver.Driver.ID, orderDriver.Order.ID); * //Order orderToDo = Parser.GetOrder(Client.FindOrder(orderId)); * return RedirectToAction("ShowOrder", new { order = orderDriver.Order }); * }*/ /*public ActionResult ShowOrder(Guid idOrder, Guid idDriver) * { * Order order = Parser.GetOrder(Client.FindOrder(idOrder)); * Driver driver = Parser.GetDriver(Client.FindDriver(idDriver)); * OrderDriver orderDriver = new OrderDriver(order, driver); * return View(orderDriver); * }*/ // [HttpPost] public ActionResult ShowOrder(Guid orderId, Guid driverId, string act) //подробности о заказе { Client = new ServiceReference1.WebServiceTaxiSoapClient(); if (act == "ShowOrder") { Client.GetOrder(driverId, orderId); Order order = Parser.GetOrder(Client.FindOrder(orderId)); Driver driver = Parser.GetDriver(Client.FindDriver(driverId)); OrderDriver orderDriver = new OrderDriver(order, driver); //Client.GetOrder(orderDriver.Driver.ID, orderDriver.Order.ID); //Order order = Client.ShowOrder(orderDriver.Order.ID_Driver); //return View(orderDriver); return(View(orderDriver)); } if (act == "StartTrip") { Client.StartTrip(driverId, orderId); Order order = Parser.GetOrder(Client.FindOrder(orderId)); Driver driver = Parser.GetDriver(Client.FindDriver(driverId)); OrderDriver orderDriver = new OrderDriver(order, driver); return(View(orderDriver)); } if (act == "FinishTrip") { Client.FinishTrip(driverId, orderId); Order order = Parser.GetOrder(Client.FindOrder(orderId)); Driver driver = Parser.GetDriver(Client.FindDriver(driverId)); OrderDriver orderDriver = new OrderDriver(order, driver); return(View(orderDriver)); } if (act == "Update") { Order order = Parser.GetOrder(Client.FindOrder(orderId)); Driver driver = Parser.GetDriver(Client.FindDriver(driverId)); OrderDriver orderDriver = new OrderDriver(order, driver); if (orderDriver.Order.Status == "3") { //order1 = null; return(View(orderDriver)); } } return(View()); }