Exemplo n.º 1
0
        private async void getModuleEditModel(ModuleEditModel sysModule)
        {
            string strErrorMsg = string.Empty;

            try
            {
                //ModuleEditModel moduleEditModel = new ModuleEditModel();
                //moduleEditModel.Module = sysModule;
                if (Om == OperationMode.AddMode)
                {
                    _moduleAyncProxy = await Task.Run(() => ServiceHelper.GetModuleService());

                    await _moduleAyncProxy.CallAsync(c => c.Add(sysModule));

                    this.ShowAutoCloseDialogOwter(UIResources.MsgInfo, "新增模块成功!");
                    //AisinoMessageBox.Show("新增模块成功!", UIResources.MsgInfo, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
                    this.DialogResult = true;
                }
                else if (Om == OperationMode.EditMode)
                {
                    _moduleAyncProxy = await Task.Run(() => ServiceHelper.GetModuleService());

                    await _moduleAyncProxy.CallAsync(c => c.Update(sysModule));

                    this.ShowAutoCloseDialogOwter(UIResources.MsgInfo, "修改模块成功!");
                    //AisinoMessageBox.Show("修改模块成功!", UIResources.MsgInfo, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
                    this.DialogResult = true;
                }
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            catch (Exception ex)
            {
                strErrorMsg = ex.Message;
            }

            if (strErrorMsg != string.Empty)
            {
                AisinoMessageBox.Show(strErrorMsg);
            }
        }
Exemplo n.º 2
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            string strErrorMsg = string.Empty;

            try
            {
                ModuleEditModel sysModule = new ModuleEditModel();
                sysModule.ModuleCode = this.moduleCode.Text;
                sysModule.Name       = this.moduleName.Text;
                sysModule.Stopped    = this.moduleStopped.IsChecked.Value;
                sysModule.Remark     = this.moduleRemark.Text;
                getModuleEditModel(sysModule);
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            catch (Exception ex)
            {
                strErrorMsg = ex.Message;
            }

            if (strErrorMsg != string.Empty)
            {
                AisinoMessageBox.Show(strErrorMsg);
            }
        }
Exemplo n.º 3
0
        private async void btnOK_Click(object sender, RoutedEventArgs e)
        {
            string strErrorMsg = string.Empty;

            try
            {
                FunctionEditModel sysFunction = new FunctionEditModel();
                sysFunction.ModuleCode    = this._moduleDisplayModel.Code;
                sysFunction.OperationCode = this.txtOperationCode.Text;
                sysFunction.OperationName = this.txtOperationName.Text;
                sysFunction.Assembly      = this.txtAssembly.Text;
                sysFunction.ClassName     = this.txtClassName.Text;
                sysFunction.FunctionCode  = this.txtFunctionCode.Text;
                sysFunction.Name          = this.txtFunctionName.Text;
                sysFunction.Params        = this.txtParams.Text;
                sysFunction.Remark        = this.txtRemark.Text;
                FunctionType functionType = (FunctionType)Enum.Parse(typeof(FunctionType), this.cmbFunctionType.Text);
                sysFunction.Type   = functionType;
                _functionAyncProxy = await Task.Run(() => ServiceHelper.GetFunctionService());

                if (Om == OperationMode.AddMode)
                {
                    await _functionAyncProxy.CallAsync(c => c.Add(sysFunction));

                    this.ShowAutoCloseDialogOwter(UIResources.MsgInfo, "新增方法成功!");
                    //MessageDialogResult result = await DialogManager.ShowMessageAsync(this, UIResources.MsgInfo, "新增方法成功!", MessageDialogStyle.Affirmative, null); ;
                    this.DialogResult = true;
                }
                if (Om == OperationMode.EditMode)
                {
                    await _functionAyncProxy.CallAsync(c => c.Update(sysFunction));

                    this.ShowAutoCloseDialogOwter(UIResources.MsgInfo, "修改方法成功!");
                    //MessageDialogResult result = await DialogManager.ShowMessageAsync(this, UIResources.MsgInfo, "修改方法成功!", MessageDialogStyle.Affirmative, null);
                    this.DialogResult = true;
                }
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            catch (Exception ex)
            {
                strErrorMsg = ex.Message;
            }

            if (strErrorMsg != string.Empty)
            {
                AisinoMessageBox.Show(strErrorMsg);
            }
        }