Пример #1
0
        public void EditEntity(AvgAmount amount)
        {
            AvgAmount am = amount;
            if (amount == null && FocusedEntity == null) return;

            if (am == null) am = FocusedEntity;
            if (am == null) return;// paranoik check

            using (YearlyAppearanceForm form = new YearlyAppearanceForm())
            {
                form.Amount = am;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    _bindingWeeks.ResetItemById (am.ID);
                }
            }
        }
Пример #2
0
        public void NewEntity()
        {
            AvgAmount amount = ClientEnvironment.AvgAmountService.CreateEntity();

            amount.CountryID = EntityCountry.ID;
                
            using (YearlyAppearanceForm form = new YearlyAppearanceForm())
            {
                form.Amount = amount;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    _bindingWeeks.Add(form.Amount);
                    UpdateButtonEnable();
                }
            }
        }