private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;
            try
            {
                Guid userId = (Guid)btn.Tag;
                UserModel userModel = this._users.Single(u => u.UserId == userId);
                if (userId != Guid.Empty)
                {
                    if (btn.Name == "Edit")
                    {
                        UserData user = new UserData();
                        user.UserId = userModel.UserId;
                        user.UserName = userModel.UserName;
                        string[] roles = userModel.Roles.Split(';');
                        foreach (string item in roles)
                        {
                            RoleData role = this._roles.SingleOrDefault(r => r.RoleName == item);
                            if (role != null)
                            {
                                user.Roles.Add(role);
                            }
                        }
                        UserTileControl tile = new UserTileControl(user, this._roles, false, this.AddUserSuccess);
                        this.UseManagerFrame.Children.Add(tile);
                        tile.IsModal = true;
                        tile.Show();
                        tile.BringToFront();
                    }
                    else if (btn.Name == "Delete")
                    {

                        if (MessageBox.Show(App.MainFrameWindow, string.Format("确认删除{0}用户吗", userModel.UserName), "Warnning", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
                        {
                            ConsoleClient.Instance.DeleteUser(userId, this.DeleteUser);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.TraceEvent(System.Diagnostics.TraceEventType.Error, "UserManagerButton_Click.\r\n{0}{1}", btn.Name, ex.ToString());
            }
        }
        private void AddUser_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                UserData user = new UserData();
                UserTileControl newUserDialog = new UserTileControl(user, this._roles, true, AddUserSuccess);
                this.UseManagerFrame.Children.Add(newUserDialog);
                newUserDialog.IsModal = true;
                newUserDialog.Show();
                newUserDialog.BringToFront();

            }
            catch (Exception ex)
            {
                Logger.TraceEvent(System.Diagnostics.TraceEventType.Error, "AddUser_Click.\r\n{0}", ex.ToString());
            }
        }