コード例 #1
0
 public void Save()
 {
     if (CheckData())
     {
         AutoService service = new AutoService();
         if ((this.DataContext as AutoEntity).Id == -1 && !CheckDoppione())
         {
             if (service.Add(this.DataContext as AutoEntity) == 0)
             {
                 MessageBox.Show("Salvato!");
                 this.DataContext = new AutoEntity();
             }
             else
             {
                 MessageBox.Show("Errore durante il salvataggio!");
             }
         }
         else
         {
             if (service.Update(this.DataContext as AutoEntity) == 0)
             {
                 MessageBox.Show("Salvato!");
             }
             else
             {
                 MessageBox.Show("Errore durante il salvataggio!");
             }
         }
     }
 }
コード例 #2
0
 public void UpdateAuto(AutoDto autoDto)
 {
     autoService.Update(autoDto);
 }