/// <summary>
        /// The page_ load.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        /// <exception cref="Exception">
        /// </exception>
        protected void Page_Load(object sender, EventArgs e)
        {
            int simulationId;
            int.TryParse(this.Request.QueryString["simulation"], out simulationId);

            try
            {
                Simulation simulation = new DataAccessLayer.Simulation().GetBy(new SearchParameter("Id", simulationId));
                if (simulation == null)
                {
                    throw new Exception("Indeling niet gevonden.");
                }

                if (simulation.Containers.Count(x => !x.Container.Active) > 0)
                {
                    throw new Exception("Indeling is niet up-to-date.");
                }

                var dalVessel = new DataAccessLayer.Vessel();
                var dalVesselContainer = new VesselContainer();
                var dalContainer = new DataAccessLayer.Container();

                var vessel = new Vessel { PortId = simulation.PortId, ShipId = simulation.ShipId, Created = DateTime.Now };
                dalVessel.Insert(vessel);

                foreach (SimulationContainer simulationContainer in simulation.Containers)
                {
                    var container = simulationContainer.Container;
                    container.Active = false;
                    dalContainer.Update(container);

                    var vesselContainer = new BusinessObjectLayer.VesselContainer
                                              {
                                                  VesselId = vessel.Id,
                                                  ContainerId = simulationContainer.ContainerId,
                                                  PositionX = simulationContainer.PositionX,
                                                  PositionY = simulationContainer.PositionY,
                                                  PositionZ = simulationContainer.PositionZ
                                              };
                    dalVesselContainer.Insert(vesselContainer);
                }

                this.SetFlash("Indeling succesvol omgezet.");
            }
            catch (Exception ex)
            {
                this.SetFlash("Omzetten van indeling niet gelukt. (Fout: " + ex.Message + ")", FlashType.Danger);
                this.Response.Redirect("/");
            }

            this.Response.Redirect("?page=Vessel");
        }
        /// <summary>
        /// The page_ load.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void Page_Load(object sender, EventArgs e)
        {
            int id;
            int.TryParse(this.Request.QueryString["vessel"], out id);

            this.Vessel = new DataAccessLayer.Vessel().GetBy(new SearchParameter("Id", id));

            if (this.Vessel == null)
            {
                this.SetFlash("Indeling niet gevonden. (Fout: Niet gevonden.)", FlashType.Danger);
                this.Response.Redirect("/");
            }
        }