void DeleteFeast(Feast feast) { if (ReadOnly) return; Feast f = feast; if (f == null) f = FocusedFeast; if (f == null) return; _bindingFeast.Remove(f); }
private void dateNavigator1_MouseDoubleClick(object sender, MouseEventArgs e) { DateTime dt = dateNavigator1.DateTime; Feast feast = new Feast(); feast.Country = Country; feast.Date = dt; _bindingFeasts.Add(feast); Modified = true; }
public bool DeleteEntity(Feast feast) { if (ReadOnly) return false; Feast f = feast; if (f == null || f.FeastDate < DateTime.Now.Date) // || UCCountryEdit.IsEstimationExist(f.FeastDate, Country.ID) return false; try { ClientEnvironment.FeastService.DeleteByID(f.ID); ListOfFeasts.Remove(f); UpdateEnableButton(); return true; } catch(Exception ex) { ErrorMessage(ex.Message); return false; } }
public Feast[] GetNewFeasts() { Feast[] _arr = new Feast[_bindingFeasts.Count]; _bindingFeasts.CopyTo(_arr, 0); return _arr; }