private async void UpdateConsultant_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { ConsultantModel selectConsultant = gvConsultant.SelectedItem as ConsultantModel; if (selectConsultant != null) { string strErrorMsg = string.Empty; try { EditConsultantWindow newConsultantWindow = new EditConsultantWindow(); newConsultantWindow.SelectConsultant = gvConsultant.SelectedItem as ConsultantModel; newConsultantWindow.Om = OperationMode.EditMode; if (newConsultantWindow.ShowDialog() == true) { await bindConsultantList(); } } 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) { await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgError, "更新会籍顾问信息失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null); } } }
private async void gvConsultant_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e) { string strErrorMsg = string.Empty; try { EditConsultantWindow newConsultantWindow = new EditConsultantWindow(); newConsultantWindow.Om = OperationMode.AddMode; if (newConsultantWindow.ShowDialog() == true) { await bindConsultantList(); } } 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; //AisinoMessageBox.Show(ex.Message, UIResources.MsgInfo, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK); } if (strErrorMsg != string.Empty) { await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgError, "添加会籍顾问信息失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null); } }