protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                //Determine the RowIndex of the Row whose LinkButton was clicked.
                int rowIndex = Convert.ToInt32(e.CommandArgument);

                //Reference the GridView Row.
                GridViewRow row = GridView1.Rows[rowIndex];

                //Fetch value of Name.
                //int name = Convert.ToInt32(e.Row.Cells[0].Text);
                //string name = row.Cells[0].ToString();

                //Fetch value of Country
                string           id = row.Cells[0].Text;
                VehicalParkingBL oVehicalParkingBL = new VehicalParkingBL();
                oVehicalParkingBL.ParkingId1 = Convert.ToInt32(id);
                int j = oVehicalParkingBL.ExitSlot();
                if (j > 0)
                {
                    Response.Write("Vehicle is Exit succssefully");
                    BindGrid();
                }
                // ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Name: " + name + "\\nCountry: " + country + "');", true);
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            VehicalParkingBL oVehicleMasterBL = new VehicalParkingBL();

            oVehicleMasterBL.VehicleNo1     = txtVeNO0.Text;
            oVehicleMasterBL.VehicleTypeId1 = Convert.ToInt32(drpdVtype.SelectedValue);
            oVehicleMasterBL.AllotedSlot1   = Convert.ToInt32(drpAviSlot.SelectedValue);
            oVehicleMasterBL.InsertVehicleParking();
            {
                Response.Write("Data inserted successfully");
                txtVeNO0.Text = "";
                drpAviSlot.Items.Clear();
                BindGrid();
            }
        }
        private void BindGrid()
        {
            DataSet          dsddl             = new DataSet();
            VehicalParkingBL oVehicalParkingBL = new VehicalParkingBL();

            dsddl = oVehicalParkingBL.SelectParkingdata();
            if (dsddl != null)
            {
                if (dsddl.Tables[0].Rows.Count > 0)
                {
                    GridView1.DataSource = dsddl.Tables[0];
                    GridView1.DataBind();
                }
                GridView1.DataBind();
            }
        }
        private void SearchVehicle()
        {
            DataSet          dsddl             = new DataSet();
            VehicalParkingBL oVehicalParkingBL = new VehicalParkingBL();

            oVehicalParkingBL.VehicleNo1 = txtserch.Text;
            dsddl = oVehicalParkingBL.SearchParkingdata();
            if (dsddl != null)
            {
                if (dsddl.Tables[0].Rows.Count > 0)
                {
                    GridView1.DataSource = dsddl.Tables[0];
                    GridView1.DataBind();
                }
                GridView1.DataBind();
            }
        }