Exemplo n.º 1
0
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            NameValueCollection collection = controllerContext.HttpContext.Request.Form;

            var command = new RegistrationCommand(collection["originUnlocode"],
                                                  collection["destinationUnlocode"], collection["arrivalDeadline"]);

            return(command);
        }
Exemplo n.º 2
0
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            NameValueCollection collection = controllerContext.HttpContext.Request.Form;

            var command = new RegistrationCommand(collection["originUnlocode"],
                                                  collection["destinationUnlocode"], collection["arrivalDeadline"]);

            return command;
        }
Exemplo n.º 3
0
        public ActionResult Register(
            [ModelBinder(typeof(RegistrationCommandBinder))] RegistrationCommand registrationCommand)
        {
            DateTime arrivalDeadlineDateTime = DateTime.ParseExact(registrationCommand.ArrivalDeadline, RegisterDateFormat,
                                                                   CultureInfo.InvariantCulture);

            string trackingId = BookingServiceFacade.BookNewCargo(
                registrationCommand.OriginUnlocode, registrationCommand.DestinationUnlocode, arrivalDeadlineDateTime
                );

            return(RedirectToAction(ShowActionName, new RouteValueDictionary(new { trackingId })));
        }