예제 #1
0
        protected override void FillDisplayerRequestedParams(ReferenceEventArgs e)
        {
            if (!IsEditable)
            {
                e.Cancel = true;
                return;
            }

            if (SelectedItems.Count == 0)
            {
                return;
            }

            var item = SelectedItems[0];

            if (item.Group.Contains("Last"))
            {
                var form = new EducationComplianceForm(item.Record, item.LastCompliance);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    AnimatedThreadWorker.RunWorkerAsync();
                }
            }
            else
            {
                var form = new EducationComplianceForm(item.Record, item.LastCompliance);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    AnimatedThreadWorker.RunWorkerAsync();
                }
            }

            e.Cancel = true;
        }
예제 #2
0
        private void ButtonAddOnClick(object sender, EventArgs e)
        {
            var last = new LastComplianceView();

            if (_record?.Settings?.NextCompliance?.NextDate != null)
            {
                last.LastCompliance.LastDate = _record?.Settings?.NextCompliance?.NextDate;
            }

            var form = new EducationComplianceForm(_record, last.LastCompliance);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _animatedThreadWorker.RunWorkerAsync();
            }
        }