Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CarBLL       bll = new CarBLL(connectionString);
         CarViewModel car = bll.GetCarById(Convert.ToInt32(Request.QueryString["CarID"]));
         Name.Text                  = car.Name;
         Make.Text                  = car.Make;
         Model.Text                 = car.Model;
         Trim.Text                  = car.Trim;
         Year.Text                  = car.Year.ToString();
         Description.Text           = car.Description;
         CityMPG.Text               = car.CityMPG.ToString();
         HighwayMPG.Text            = car.HighwayMPG.ToString();
         IsAutomatic.SelectedValue  = car.IsAutomatic.ToString();
         HourlyRate.Text            = car.HourlyRate.ToString();
         YearValidator.MaximumValue = (DateTime.Now.Year + 1).ToString();
     }
 }