private void DisplayCar(ServiceReference1.Auto car) { mittariluksbox.Text = car.Mittarilukema.ToString(); motilabox.Text = car.Mottoritila.ToString(); hintabox.Text = car.Hinta.ToString(); merkkibox.SelectedValue = car.Merkki; mallibox.SelectedValue = car.Malli; fuelbox.SelectedValue = car.Fuel; colorbox.SelectedValue = car.Color; pvmBox.Value = car.Pvm; }
private void addstuff_Click(object sender, EventArgs e) { int affected = 0; ServiceReference1.Auto car = new ServiceReference1.Auto(); car.Hinta = int.Parse(hintabox.Text); car.Mottoritila = decimal.Parse(motilabox.Text); car.Mittarilukema = int.Parse(mittariluksbox.Text); car.Merkki = (int)merkkibox.SelectedValue; car.Malli = (int)mallibox.SelectedValue; car.Color = (int)colorbox.SelectedValue; car.Fuel = (int)fuelbox.SelectedValue; car.Pvm = pvmBox.Value; affected = palvelu.saveAutoIntoDatabase(car); MessageBox.Show(affected + " rows affected."); }
private int SetCount(int id) { ServiceReference1.Auto auto = new ServiceReference1.Auto(); return(id = auto.Id); }
private void pervbutton_Click(object sender, EventArgs e) { ServiceReference1.Auto carperv = palvelu.GetPrevious(ID); ID = carperv.Id; DisplayCar(carperv); }
private void nextbutton_Click(object sender, EventArgs e) { ServiceReference1.Auto carnext = palvelu.GetNextAuto(ID); ID = carnext.Id; DisplayCar(carnext); }