private void btnOk_Click(object sender, RoutedEventArgs e) { if (!ValidationManager.Validate(this)) { return; } CategoryRequestApprovalVM info = GetVM(); if (IsEdit) { info.OperationType = OperationType.Update; facade.CreateCategoryRequest(info, (obj, arg) => { if (arg.FaultsHandle()) { return; } CloseDialog(DialogResultType.OK); CPApplication.Current.CurrentPage.Context.Window.Alert("提交成功"); }); } else { info.OperationType = OperationType.Create; facade.CreateCategoryRequest(info, (obj, arg) => { if (arg.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert("提交成功"); CloseDialog(DialogResultType.OK); }); } }