Exemplo n.º 1
0
        public ActionResult RetrieveByCity(RetrieveByCityViewModel rbcvm)
        {
            DisplayRestrictedViewModel model = new DisplayRestrictedViewModel();

            if (ModelState.IsValid)  // required fields entered?
            {
                model = _adapter.GetDisplayRestrictedViewModelByCityAndState(rbcvm);
                return View("ShowByCity", model);
            }

            return View();
        }
Exemplo n.º 2
0
        public ActionResult Show(DisplayRestrictedViewModel drvm)
        {
            if (drvm.Type == TruckType.Single)
                ViewBag.trucktype = "Single";
            else if (drvm.Type == TruckType.Double)
                ViewBag.trucktype = "Double";
            else
                ViewBag.trucktype = "Straight";

            return View(drvm);
        }
Exemplo n.º 3
0
        public ActionResult Index(RestrictedIndexViewModel rivm)
        {
            DisplayRestrictedViewModel model = new DisplayRestrictedViewModel();

            if (ModelState.IsValid)  // required fields entered?
            {
                model = _adapter.GetDisplayRestrictedViewModel(rivm);

                if (model == null) // not found
                    return View("Index");
                else
                {
                    model.City = rivm.City;
                    model.State = rivm.State;
                    model.Height = rivm.Height;
                    model.Weight = rivm.Weight;
                    model.Type = rivm.Type;
                    if (model.Type == TruckType.Single)
                        ViewBag.trucktype = "Single";
                    else if (model.Type == TruckType.Double)
                        ViewBag.trucktype = "Double";
                    else
                        ViewBag.trucktype = "Straight";

                    return View("Show", model);
                }
            }
            return View("Index");
        }