Exemplo n.º 1
0
        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            var failed = Connection.SaveUser(_toDelete);
            var t      = string.Empty;

            for (var i = 0; i < failed.Count; i++)
            {
                if (i != failed.Count - 1)
                {
                    t += failed[i] + "、";
                }
                else
                {
                    t += failed[i];
                }
            }
            if (failed.Count != 0)
            {
                MessageBox.Show("以下用户未能保存,因为已存在相同用户名的用户:\n" + t, "提示", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            UserHelper.GetUserBelongs();
            Close();
        }