protected void btnTestGetCars_Click(object sender, EventArgs e)
        {
            CarServiceRef.Agency agency = new CarServiceRef.Agency();
            agency.agencyID = 1;
            agency.name = "Hertz";
            agency.phone = "";
            agency.email = "";
            agency.city = "";
            agency.state = "";

            CarServiceRef.CarService pxy = new CarServiceRef.CarService();
            DataSet myDS = pxy.GetCars(agency, "Philadelphia", "PA");
            gvDisplayResults.DataSource = myDS;
            gvDisplayResults.DataBind();
        }
示例#2
0
        protected void btnTestGetCars_Click(object sender, EventArgs e)
        {
            CarServiceRef.Agency agency = new CarServiceRef.Agency();
            agency.agencyID = 1;
            agency.name     = "Hertz";
            agency.phone    = "";
            agency.email    = "";
            agency.city     = "";
            agency.state    = "";

            CarServiceRef.CarService pxy = new CarServiceRef.CarService();
            DataSet myDS = pxy.GetCars(agency, "Philadelphia", "PA");

            gvDisplayResults.DataSource = myDS;
            gvDisplayResults.DataBind();
        }
        protected void btnSearchCarAgencies_Click(object sender, EventArgs e)
        {
            CarServiceRef.CarService carService = new CarServiceRef.CarService();
            DataSet agencies = carService.GetRentalCarAgencies(txtCarCity.Text, ddlCarState.SelectedValue);
            CarServiceRef.Agency agency = new CarServiceRef.Agency();
            agency.agencyID = (int)agencies.Tables[0].Rows[ddlAgencies.SelectedIndex]["agencyID"];
            agency.name = ddlAgencies.SelectedValue;
            agency.phone = (string)agencies.Tables[0].Rows[ddlAgencies.SelectedIndex]["phone"];
            agency.email = (string)agencies.Tables[0].Rows[ddlAgencies.SelectedIndex]["email"];
            agency.city = (string)agencies.Tables[0].Rows[ddlAgencies.SelectedIndex]["city"];
            agency.state = (string)agencies.Tables[0].Rows[ddlAgencies.SelectedIndex]["state"];

            CarServiceRef.CarService pxy = new CarServiceRef.CarService();
            DataSet myDS = pxy.GetCars(agency, txtCarCity.Text, ddlCarState.SelectedValue);
            rptCars.DataSource = myDS;
            rptCars.DataBind();

            divCarForm.Visible = false;
            divCarResults.Visible = true;
        }