Beispiel #1
0
        public override void Edit()
        {
            Domain.Colouring l = (Domain.Colouring)mainGridView.GetRow(mainGridView.FocusedRowHandle);
            if (l == null)
            {
                return;
            }
            FormColouring f = new FormColouring();

            f.Text      = GetLocalized("Edit Colouring");
            f.Colouring = l;
            if (f.ShowDialog(OwnerForm) == DialogResult.OK)
            {
                try
                {
                    ClientEnvironment.ColouringService.SaveOrUpdate(f.Colouring);
                }
                catch (EntityException ex)
                {
                    // 2think: what details should we show?
                    // 2think: how to localize?
                    using (FrmEntityExceptionDetails form = new FrmEntityExceptionDetails(ex))
                    {
                        form.Text = GetLocalized("CannotSaveColouring");
                        form.ShowDialog(this);
                    }
                }
            }

            RefreshData();
        }
Beispiel #2
0
        public override void Edit()
        {
            Domain.Colouring l = (Domain.Colouring)mainGridView.GetRow(mainGridView.FocusedRowHandle);
            if (l == null)
            {
                return;
            }
            FormColouring f = new FormColouring();
            f.Text = GetLocalized("Edit Colouring");
            f.Colouring = l;
            if (f.ShowDialog(OwnerForm) == DialogResult.OK)
            {
                try
                {
                    ClientEnvironment.ColouringService.SaveOrUpdate(f.Colouring);
                }
                catch (EntityException ex)
                {
                    // 2think: what details should we show?
                    // 2think: how to localize?
                    using (FrmEntityExceptionDetails form = new FrmEntityExceptionDetails(ex))
                    {
                        form.Text = GetLocalized("CannotSaveColouring");
                        form.ShowDialog(this);
                    }
                }
            }

            RefreshData();
        }
Beispiel #3
0
        public override void Add()
        {
            FormColouring f = new FormColouring();

            f.Text      = GetLocalized("New Colouring");
            f.Colouring = new Domain.Colouring();
            if (f.ShowDialog(OwnerForm) == DialogResult.OK)
            {
                try
                {
                    ClientEnvironment.ColouringService.SaveOrUpdate(f.Colouring);
                }
                catch (EntityException ex)
                {
                    // 2think: what details should we show?
                    // 2think: how to localize?
                    using (FrmEntityExceptionDetails form = new FrmEntityExceptionDetails(ex))
                    {
                        form.Text = GetLocalized("CannotSaveColouring");
                        form.ShowDialog(this);
                    }
                }
            }

            RefreshData();
        }
Beispiel #4
0
        public override void Add()
        {
            FormColouring f = new FormColouring();
            f.Text = GetLocalized("New Colouring");
            f.Colouring = new Domain.Colouring();
            if (f.ShowDialog(OwnerForm) == DialogResult.OK)
            {
                try
                {
                    ClientEnvironment.ColouringService.SaveOrUpdate(f.Colouring);
                }
                catch (EntityException ex)
                {
                    // 2think: what details should we show?
                    // 2think: how to localize?
                    using (FrmEntityExceptionDetails form = new FrmEntityExceptionDetails(ex))
                    {
                        form.Text = GetLocalized("CannotSaveColouring");
                        form.ShowDialog(this);
                    }
                }
            }

            RefreshData();
        }