private void btn审核不通过_Click(object sender, RoutedEventArgs e) { string rejectReason = tbRejectReason.Text; UpdateCertificateApproveStatus(false, rejectReason); NotificationsWorker.SendAddNotification(SelectedUser, "很遗憾,您的医生资格证没有通过审核。原因:" + rejectReason); }
private void btn审核通过_Click(object sender, RoutedEventArgs e) { string rejectReason = tbRejectReason.Text; UpdateCertificateApproveStatus(true, null); NotificationsWorker.SendAddNotification(SelectedUser, "恭喜您,您的医生资格证通过审核。"); }
private void UpdateCertificateApproveStatus(bool result, string rejectReason) { UpdateCertificateApproveStatusRequest request = new UpdateCertificateApproveStatusRequest(); request.Token = LungCare.SupportPlatform.Security.TokenManager.Token; request.UserId = _UserInfo.PhoneNumber; request.Sender = "PC Client"; request.Result = result; request.RejectReason = rejectReason; PauseGUI(); ThreadPool.QueueUserWorkItem(delegate { UpdateCertificateApproveStatusWorker.SendUpdateCertificateApproveStatusRequeset( request.UserId, request.Result, request.RejectReason, successCallback : delegate(UpdateCertificateApproveStatusResponse response) { Dispatcher.Invoke(new Action(delegate { if (result) { NotificationsWorker.SendAddNotification(_UserInfo.PhoneNumber, "恭喜您,您的医生资格证通过审核。"); lbCertificateStatus.Content = "通过审核"; } else { NotificationsWorker.SendAddNotification(_UserInfo.PhoneNumber, "很遗憾,您的医生资格证未通过审核。"); lbCertificateStatus.Content = "审核不通过:" + tbCheckReason.Text; } MessageBox.Show("确认结束"); ResumeGUI(); })); }, failureCallback : delegate(string failureReason) { Dispatcher.Invoke(new Action(delegate { MessageBox.Show("审核医师资格证失败。" + failureReason, "", MessageBoxButton.OK, MessageBoxImage.Asterisk); ResumeGUI(); })); }, errorCallback : delegate(Exception ex) { Dispatcher.Invoke(new Action(delegate { Util.ShowExceptionMessage(ex, "审核医师资格证出错。"); ResumeGUI(); })); }); }); }