Exemplo n.º 1
0
 private void OnDeletePortion(string value)
 {
     if (SelectedPortion != null)
     {
         Workspace.Delete(SelectedPortion.Model);
         Model.Portions.Remove(SelectedPortion.Model);
         Portions.Remove(SelectedPortion);
     }
 }
Exemplo n.º 2
0
 private void OnDeletePortion(string value)
 {
     if (SelectedPortion != null)
     {
         var c = Dao.Count <Recipe>(x => x.Portion.Id == SelectedPortion.Model.Id);
         if (c == 0)
         {
             if (SelectedPortion.Model.Id > 0 && Model.Id > 0)
             {
                 _workspace.Delete(SelectedPortion.Model);
             }
             Model.Portions.Remove(SelectedPortion.Model);
             Portions.Remove(SelectedPortion);
         }
     }
 }