private void btn删除用户_Click(object sender, RoutedEventArgs e) { DeleteUserWorker.SendDeleteUserRequest(SelectedUser, delegate { }, delegate { }, delegate { }); }
private void deleteUserLinkLabel_Click(object sender, RoutedEventArgs e) { MessageBoxResult MsgBoxResult; MsgBoxResult = MessageBox.Show("是否删除用户?", "提示", MessageBoxButton.OKCancel); if (MsgBoxResult == MessageBoxResult.Cancel) { return; } else { ThemedControlsLibrary.LinkLabel LinkLabel = (ThemedControlsLibrary.LinkLabel)sender; string phoneNumber = LinkLabel.Tag.ToString(); Console.WriteLine(LinkLabel.Tag.ToString()); IEnumerable <LungCare.SupportPlatform.Models.GetUserInfoResponse> list = listView.Items.SourceCollection.Cast <LungCare.SupportPlatform.Models.GetUserInfoResponse>(); var items = list.First(item => ((LungCare.SupportPlatform.Models.GetUserInfoResponse)item).PhoneNumber == phoneNumber); if (items != null) { String userID = items.PhoneNumber; DeleteUserWorker.SendDeleteUserRequest(userID, successCallback: delegate { if (DeleteHandler != null) { DeleteHandler(sender, e); } MessageBox.Show("delete success!!!"); }, failureCallback: delegate { }, errorCallback: delegate { }); } else { MessageBox.Show("未找到详细信息"); } } }