protected void btnSearch_Click1(object sender, EventArgs e) { CarDAL carDAL = new CarDAL(); // gvCar.DataSource = carDAL.ReadByMakeId(Convert.ToInt16(ddMake.SelectedItem.Value)); int makeId = 0, modelId = 0; if (ddMake.SelectedItem.Value != "") { makeId = Convert.ToInt16(ddMake.SelectedItem.Value); } if (ddModel.SelectedItem.Value != "") { modelId = Convert.ToInt16(ddModel.SelectedItem.Value); } if (makeId > 0) { gvCar.DataSource = carDAL.ReadByMakeId(Convert.ToInt16(ddMake.SelectedItem.Value)); } if (modelId > 0 && makeId > 0) { gvCar.DataSource = carDAL.SearchCar(makeId, modelId); } gvCar.DataBind(); btnAddGarage.Visible = true; }
//metodo para buscar un auto //por marca, descripcion y fecha. public List <Car> SearchCar(Car pCar) { return(carDal.SearchCar(pCar)); }