Пример #1
0
        private void form_ConfirmClick(Distributor item, SaveDistributorForm form)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                InteractResult result = GlobalCache.ServerProxy.InsertDistributor(item);
                switch (result.ExeResult)
                {
                case ExeResult.Success:
                    form.DialogResult = DialogResult.OK;
                    this.RefreshPage();
                    break;

                case ExeResult.Error:
                    GlobalMessageBox.Show(result.Msg);
                    form.Cancel();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Пример #2
0
        private void form_ConfirmClick_Edit(Distributor item, SaveDistributorForm form)
        {
            try
            {
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }
                UpdateResult result = GlobalCache.ServerProxy.UpdateDistributor(item.ID, item.Name, item.Password);
                switch (result)
                {
                case UpdateResult.Success:
                    form.DialogResult = DialogResult.OK;
                    this.RefreshPage();
                    break;

                case UpdateResult.Error:
                    GlobalMessageBox.Show("内部错误!");
                    form.Cancel();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }