Пример #1
0
 public void DeleteRecordRequest(int inRecordIndex)
 {
     // warn user
     if (_view.WarnUser(CommonPresenterStuff.WarnDeleteMessage("fishing record")))
     {
         FishingRecordRepository repository = FishingRecordRepository.GetInstance();
         repository.DeleteRecord(inRecordIndex);
     }
 }
Пример #2
0
 public void DeleteLocationRequest(int inLocationIndex)
 {
     // warn user
     if (_view.WarnUser(CommonPresenterStuff.WarnDeleteMessage("location")))
     {
         // try deleting location
         try
         {
             LocationRepository.GetInstance().DeleteLocation(inLocationIndex);
         }
         catch (LocationPartOfFishingRecordException)
         {
             _view.ShowErrorMessage("Location can't be deleted!\nIt is a part of one or more fishing records.");
             return;
         }
         catch (Exception)
         {
             _view.ShowErrorMessage(CommonPresenterStuff.ErrorMessage());
             return;
         }
     }
 }