private async void UpdateClassType_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { ClassTypeModel selectClassType = this.gvClassTypes.SelectedItem as ClassTypeModel; if (selectClassType != null) { string strErrorMsg = string.Empty; try { EditClassTypeWindow newClassTypeWindow = new EditClassTypeWindow(); newClassTypeWindow.SelectClassType = selectClassType; newClassTypeWindow.Om = OperationMode.EditMode; if (newClassTypeWindow.ShowDialog() == true) { await bindClassTypeList(); } } 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 gvClassTypes_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e) { string strErrorMsg = string.Empty; try { EditClassTypeWindow newClassTypeWindow = new EditClassTypeWindow(); newClassTypeWindow.Om = OperationMode.AddMode; if (newClassTypeWindow.ShowDialog() == true) { await bindClassTypeList(); } } 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); } }