Beispiel #1
0
 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;
 }
Beispiel #2
0
        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.");
        }
Beispiel #3
0
 private int SetCount(int id)
 {
     ServiceReference1.Auto auto = new ServiceReference1.Auto();
     return(id = auto.Id);
 }
Beispiel #4
0
 private void pervbutton_Click(object sender, EventArgs e)
 {
     ServiceReference1.Auto carperv = palvelu.GetPrevious(ID);
     ID = carperv.Id;
     DisplayCar(carperv);
 }
Beispiel #5
0
 private void nextbutton_Click(object sender, EventArgs e)
 {
     ServiceReference1.Auto carnext = palvelu.GetNextAuto(ID);
     ID = carnext.Id;
     DisplayCar(carnext);
 }