Exemple #1
0
        void DeleteFeast(Feast feast)
        {
            if (ReadOnly) return;

            Feast f = feast;
            if (f == null) f = FocusedFeast;

            if (f == null) return;

            _bindingFeast.Remove(f);
        }
Exemple #2
0
        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;
        }
Exemple #3
0
        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;
            }
        }
Exemple #4
0
 public Feast[] GetNewFeasts()
 {
     Feast[] _arr = new Feast[_bindingFeasts.Count];
     _bindingFeasts.CopyTo(_arr, 0);
     return _arr;
 }