Esempio n. 1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (station == null)
     {
         Station newStation = new Station();
         newStation = fillObject(newStation);
         if (newStation != null)
         {
             var registered = _stationService.Insert(newStation);
             if (registered)
             {
                 MessageBox.Show("U regjistrua me sukses");
                 this.Close();
             }
             else
             {
                 MessageBox.Show("Regjistrimi deshtoi. Ju lutem kontrolloni formen");
             }
         }
     }
     else
     {
         station = fillObject(station);
         var updated = _stationService.Update(station);
         if (updated)
         {
             MessageBox.Show("U editua me sukses");
             this.Close();
         }
         else
         {
             MessageBox.Show("Editimi deshtoi. Ju lutem kontrolloni formen");
         }
     }
 }