public ActionResult MakeOrder(MakeOrderViewModel viewModel) { var game = this.session.Repository<Game>().Get(viewModel.GameId.Value); if (!ModelState.IsValid) return RedirectToAction("GameInfo", new { routeName = game.RouteName, message = ErrorMessage }); var orderTime = DateTime.Parse(viewModel.OrderTime, CultureInfo.CurrentCulture); this.MakeOrder(viewModel.GameId.Value, viewModel.Customer.Name, viewModel.Customer.PhoneNumber, orderTime, viewModel.Price, viewModel.Salary, true); return RedirectToAction("GameInfo", new { routeName = game.RouteName, message = AcceptMessage }); }
public ActionResult MakeOrder(int gameId, string orderTime, int price, int? salary) { ViewBag.OrderTime = orderTime; var viewModel = new MakeOrderViewModel() { GameId = gameId, OrderTime = orderTime, Price = price, Salary = salary, Customer = this.session.Repository<Customer>().Create() }; return PartialView("Partial/_MakeOrder", viewModel); }