/// <summary> /// 添加用户 /// </summary> public async void Add() { SearchUserViewModel model = new SearchUserViewModel(); var dialog = ServiceProvider.Instance.Get <IModelDialog>("SearchUserDlg"); dialog.BindViewModel(model); var taskResult = await dialog.ShowDialog(); if (taskResult) { var modelList = model.UserModelList.Where(q => q.IsChecked.Equals(true)).ToList(); if (modelList != null) { modelList.ForEach(q => { if (CaCheUser.FirstOrDefault(t => t.Account.Equals(q.User.Account)) == null) { CaCheUser.Add(new View_GroupUser() { Account = q.User.Account, GroupCode = Group.GroupCode, UserName = q.User.UserName }); } }); } this.Query(this.SearchText); } }
/// <summary> /// 移除用户 /// </summary> /// <param name="user"></param> public async void Remove(View_GroupUser user) { if (await Msg.Question(string.Format("确认删除用户:{0}?", user.UserName), false)) { CaCheUser.Remove(user); this.Query(this.SearchText); } }