Пример #1
0
        async void OnAddRole(object sender, Mi e)
        {
            SelectRolesDlg dlg    = new SelectRolesDlg();
            long           userID = _lvUser.SelectedRow.ID;

            if (await dlg.Show(RoleRelations.User, userID.ToString(), e))
            {
                List <long> roles = new List <long>();
                foreach (var row in dlg.SelectedItems.OfType <Row>())
                {
                    roles.Add(row.ID);
                }
                if (roles.Count > 0 && await AtCm.AddUserRole(userID, roles))
                {
                    _lvRole.Data = await AtCm.Query("用户-关联角色", new { userid = userID });
                }
            }
        }