protected void SubmitButton_Click(object sender, EventArgs e) { Model.VehicleBrand newVehicleBrand = new Model.VehicleBrand { Name = nameTextBox.Text }; vehicleBrandDao.InsertVehicleBrand(newVehicleBrand); Response.Redirect("~/Pages/VehicleBrand/VehicleBrands.aspx"); }
protected void SubmitButton_Click(object sender, EventArgs e) { Model.VehicleBrand brand = new Model.VehicleBrand { Id = Convert.ToInt32(vehicleBrandDropDown.SelectedItem.Value) }; Model.FuelType fuelType = new Model.FuelType { Id = Convert.ToInt32(fuelTypeRadio.SelectedValue) }; Model.VehicleModel newVehicleModel = new Model.VehicleModel { Name = nameTextBox.Text, Brand = brand, EngineCapacity = Convert.ToDecimal(engineCapacityTextBox.Text), FuelType = fuelType }; vehicleModelDao.InsertVehicleModel(newVehicleModel); Response.Redirect("~/Pages/VehicleModel/VehicleModels.aspx"); }