Exemple #1
0
        protected void btnSpoorReserveren_Click(object sender, EventArgs e)
        {
            try
            {
                bc = new BeheerController();

                int spoornummer = Convert.ToInt32(ddlSpoorReserverenSpoor.SelectedItem.Text);
                int tramnummer  = Convert.ToInt32(ddlSpoorReserverenTram.SelectedItem.Text);

                Spoor s = bc.GetSpoorByNummer(spoornummer);
                Tram  t = bc.GetTramByNummer(tramnummer);

                bc.SpoorReserveren(s, t);
                Response.Redirect(Request.RawUrl);
            }
            catch (Exception ex)
            {
                string script = "alert(\"    " + ex.Message + "\");";
                ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true);
            }
        }