Beispiel #1
0
        private void ucButtonSave_Click(object sender, System.EventArgs e)
        {
            if (!_ListHelper.IsDirty)
            {
                return;
            }

            if (_AddTSErrorCodeWhenSave)
            {
                try
                {
                    this.DataProvider.BeginTransaction();

                    _TSFacade.AddTSErrorCode(_CurrentTS, _ListHelper.AddList);
                    _TSFacade.DeleteTSErrorCode(_CurrentTS, _ListHelper.DeleteList);
                    _TSFacade.DeleteTSErrorCode(_CurrentTS.TSId, string.Empty, _DefaultErrorCode.ParameterAlias);

                    this.DataProvider.CommitTransaction();
                }
                catch (Exception ex)
                {
                    this.DataProvider.RollbackTransaction();

                    this.ShowMessage(ex);

                    return;
                }

                this.ShowMessage(new UserControl.Message(MessageType.Success, "$CS_Save_Success"));
            }
            else
            {
                _SelectedTSErrorCode = _ListHelper.AddList;
            }

            _ListHelper.Clear();

            this.Close();
        }