示例#1
0
        private void DeleteBatch(BatchDataModel batch)
        {
            BatchUtility.DeleteBatch(batch);

            if (CurrentBatch == batch)
            {
                int previousBatchIndex = SavedBatches.IndexOf(batch) - 1;
                CurrentBatch = previousBatchIndex >= 0 ? SavedBatches[previousBatchIndex] : SavedBatches.FirstOrDefault();
            }

            SavedBatches.Remove(batch);
        }
示例#2
0
 private void AddNewBatch(RecipeDataModel recipe)
 {
     SaveCurrentBatch();
     CurrentBatch = BatchUtility.CreateBatch(recipe);
     SavedBatches.Add(CurrentBatch);
 }