public void SetVehicleHistoryDetails(int vehicleId)
 {
     using (var dataAccess = new OverviewDataAccess())
     {
         VehicleHistoryDetails = dataAccess.GetVehicleHistoryDetails(vehicleId);
     }
     SetHistory();
 }
Beispiel #2
0
        protected override bool OnBubbleEvent(object sender, EventArgs args)
        {
            var handled = false;

            if (args is GridViewCommandEventArgs)
            {
                var commandArgs = args as GridViewCommandEventArgs;
                if (commandArgs.CommandName == "ShowVehicle")
                {
                    var vehicleId = int.Parse(commandArgs.CommandArgument.ToString());

                    using (var dataAccess = new OverviewDataAccess())
                    {
                        Session[OverviewVehicleHistory.OverviewVehicleHistoryDetails] = dataAccess.GetVehicleHistoryDetails(vehicleId);
                    }

                    ucOverviewVehicle.SetVehicleDetails(vehicleId);

                    upnlMultiview.Update();
                    mpeCarSearch.Show();
                }
                handled = true;
            }

            if (args is CommandEventArgs)
            {
                var commandArgs = args as CommandEventArgs;
                if (commandArgs.CommandName == "RefreshGrid")
                {
                    using (var dataAccess = new AvailabilityDataAccess(null))
                    {
                        lblLastUpdate.Text = LastUpdatedFromFleetNow.GetLastUpdatedDateTime(dataAccess);
                    }
                    RefreshOverviewGrid();
                }
                handled = true;
            }
            return(handled);
        }