Пример #1
0
 protected void CarEditButton_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         CarBLL       bll = new CarBLL(connectionString);
         CarViewModel car = new CarViewModel();
         car.CarID       = Convert.ToInt32(Request.QueryString["CarID"]);
         car.Name        = Name.Text;
         car.Make        = Make.Text;
         car.Model       = Model.Text;
         car.Trim        = Trim.Text;
         car.Year        = Convert.ToInt32(Year.Text);
         car.Description = Description.Text;
         car.CityMPG     = Convert.ToInt32(CityMPG.Text);
         car.HighwayMPG  = Convert.ToInt32(HighwayMPG.Text);
         car.IsAutomatic = Convert.ToBoolean(IsAutomatic.SelectedValue);
         car.HourlyRate  = Convert.ToDouble(HourlyRate.Text);
         bll.EditCar(car);
         Response.Redirect("~/Cars.aspx");
     }
 }