public TravelDetails(TravelDetailsViewModel viewModel)
        {
            _viewModel     = viewModel;
            BindingContext = _viewModel;

            InitializeComponent();
        }
Beispiel #2
0
        public ActionResult TripDetails(int id, int?page)
        {
            TravelDetailsViewModel model;

            using (ApplicationDbContext dbContext = new ApplicationDbContext())
            {
                Route route      = dbContext.Routes.SingleOrDefault <Route>(a => a.RouteId == id);
                var   comments   = from comment in dbContext.Comments where comment.RouteId == id orderby comment.CommentId select comment;
                int   pageSize   = 5;
                int   pageNumber = (page ?? 1);
                model = new TravelDetailsViewModel {
                    Route = route, Users = route.Users.ToList(), DriverId = route.DriverId, User = UserInstance(dbContext), Comments = comments.ToPagedList(pageNumber, pageSize)
                };
            }
            ViewBag.Id = id;
            return(View(model));
        }
 public RemoveItemFromTravelCommand(TravelDetailsViewModel travelDetailsViewModel)
 {
 }