Exemplo n.º 1
0
 public void Save()
 {
     if (CatagoryID == -1)
     {
         CatagoryID = IDTracker.CreateNew(IDType.CATAGORY);
         IDTracker.SaveID(IDType.CATAGORY, CatagoryID);
     }
     else
     {
         CatagoryModel modelToDelete = UI.DataQueries.GetCatagoryModel(Managers.Data.FileData.CatagoryModels, CatagoryID);
         Managers.Data.FileData.CatagoryModels.Remove(modelToDelete);
     }
     Managers.Data.FileData.CatagoryModels.Add(this);
     Managers.Data.Save();
     //Messenger.Broadcast(AppEvent.CATAGORIES_UPDATED);
 }
Exemplo n.º 2
0
 public void Save()
 {
     if (ExpenseID == -1)
     {
         ExpenseID = IDTracker.CreateNew(IDType.EXPENSE);
         IDTracker.SaveID(IDType.EXPENSE, ExpenseID);
     }
     else
     {
         ExpenseModel modelToRemove = UI.DataQueries.GetExpenseModel(Managers.Data.FileData.ExpenseModels, ExpenseID);
         Managers.Data.FileData.ExpenseModels.Remove(modelToRemove);
     }
     Managers.Data.FileData.ExpenseModels.Add(this);
     Managers.Data.FileData.ExpenseModels.Sort();
     Managers.Data.Save();
     Messenger.Broadcast(UI.Events.EXPENSES_UPDATED);
 }