protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Customer login = (Customer)Session["login"];
         lblName.Text = "Customer : " + login.LastName + ", " + login.FirstName;
         VehicleDAO vehicleDAO = new VehicleDAO(login.CustomerId, login.Password);
         ddlVehicleType.DataSource = vehicleDAO.GetVehicleTypes();
         ddlVehicleType.DataBind();
         lblNoResults.Visible = false;
     }
 }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Customer login = (Customer)Session["login"];

            if (String.IsNullOrEmpty(tBoxSearchVehicles.Text))
            {
                VehicleDAO     vehicledao = new VehicleDAO(login.CustomerId, login.Password);
                List <Vehicle> vehicles   = vehicledao.FindVehicles(String.Empty, ddlVehicleType.Text);
                if (vehicles.Count > 0)
                {
                    GridViewVehicles.DataSource = vehicles;
                    GridViewVehicles.DataBind();
                    lblNoResults.Visible = false;
                }
                else
                {
                    lblNoResults.Visible = true;
                }
            }
            else
            {
                VehicleDAO     vehicledao = new VehicleDAO(login.CustomerId, login.Password);
                List <Vehicle> vehicles   = vehicledao.FindVehicles(tBoxSearchVehicles.Text, ddlVehicleType.Text);
                if (vehicles.Count > 0)
                {
                    GridViewVehicles.DataSource = vehicles;
                    GridViewVehicles.DataBind();
                    lblNoResults.Visible = false;
                }
                else
                {
                    lblNoResults.Visible = true;
                }

                GridViewVehicles.DataSource = vehicles;
                GridViewVehicles.DataBind();
            }
        }