Exemplo n.º 1
0
 async void DeleteDataVer()
 {
     // 1表任何人,删除所有人的参数版本号
     await AtCm.DeleteDataVer(new List <long> {
         1
     }, "params");
 }
Exemplo n.º 2
0
        async void RemoveRole(IEnumerable <Row> p_rows)
        {
            string         prvID = _lvPrv.SelectedItem.To <Prv>().ID;
            List <RolePrv> ls    = new List <RolePrv>();

            foreach (var row in p_rows)
            {
                ls.Add(new RolePrv(row.Long("roleid"), prvID));
            }
            if (ls.Count > 0 && await AtCm.BatchDelete(ls))
            {
                RefreshRelation(prvID);
                await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "privilege");
            }
        }
Exemplo n.º 3
0
        async void RemovePrv(IEnumerable <Row> p_rows)
        {
            long           roleID = _lvRole.SelectedRow.ID;
            List <RolePrv> ls     = new List <RolePrv>();

            foreach (var row in p_rows)
            {
                ls.Add(new RolePrv(roleID, row.Str("prvid")));
            }
            if (ls.Count > 0 && await AtCm.BatchDelete(ls))
            {
                _lvPrv.Data = await AtCm.Query("角色-关联的权限", new { roleid = roleID });

                await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "privilege");
            }
        }
Exemplo n.º 4
0
        async void RemoveMenu(IEnumerable <Row> p_rows)
        {
            long            roleID = _lvRole.SelectedRow.ID;
            List <RoleMenu> ls     = new List <RoleMenu>();

            foreach (var row in p_rows)
            {
                ls.Add(new RoleMenu(roleID, row.Long("menuid")));
            }
            if (ls.Count > 0 && await AtCm.BatchDelete(ls))
            {
                _lvMenu.Data = await AtCm.Query("角色-关联的菜单", new { roleid = roleID });

                await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "menu");
            }
        }
Exemplo n.º 5
0
        async void RemoveRole(IEnumerable <Row> p_rows)
        {
            long            menuID = _fv.Data.To <Menu>().ID;
            List <RoleMenu> ls     = new List <RoleMenu>();

            foreach (var row in p_rows)
            {
                ls.Add(new RoleMenu(row.Long("roleid"), menuID));
            }
            if (ls.Count > 0 && await AtCm.BatchDelete(ls))
            {
                _lvRole.Data = await AtCm.Query <RoleMenu>("菜单-关联的角色", new { menuid = menuID });

                await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "menu");
            }
        }
Exemplo n.º 6
0
        async void OnAddRole(object sender, Mi e)
        {
            string         prvID = _lvPrv.SelectedItem.To <Prv>().ID;
            SelectRolesDlg dlg   = new SelectRolesDlg();

            if (await dlg.Show(RoleRelations.Prv, prvID, e))
            {
                List <RolePrv> ls = new List <RolePrv>();
                foreach (var row in dlg.SelectedItems.OfType <Row>())
                {
                    ls.Add(new RolePrv(row.ID, prvID));
                }
                if (ls.Count > 0 && await AtCm.BatchSave(ls))
                {
                    RefreshRelation(prvID);
                    await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "privilege");
                }
            }
        }
Exemplo n.º 7
0
        async void OnAddPrv(object sender, Mi e)
        {
            long roleID = _lvRole.SelectedRow.ID;
            var  dlg    = new SelectRolePrvDlg();

            if (await dlg.Show(roleID, e))
            {
                List <RolePrv> ls = new List <RolePrv>();
                foreach (var row in dlg.SelectedItems.OfType <Row>())
                {
                    ls.Add(new RolePrv(roleID, row.Str("id")));
                }
                if (ls.Count > 0 && await AtCm.BatchSave(ls))
                {
                    _lvPrv.Data = await AtCm.Query("角色-关联的权限", new { roleid = roleID });

                    await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "privilege");
                }
            }
        }
Exemplo n.º 8
0
        async void OnAddMenu(object sender, Mi e)
        {
            long roleID = _lvRole.SelectedRow.ID;
            var  dlg    = new SelectRoleMenuDlg();

            if (await dlg.Show(roleID, e))
            {
                List <RoleMenu> ls = new List <RoleMenu>();
                foreach (var row in dlg.SelectedItems.OfType <Row>())
                {
                    ls.Add(new RoleMenu(roleID, row.ID));
                }
                if (ls.Count > 0 && await AtCm.BatchSave(ls))
                {
                    _lvMenu.Data = await AtCm.Query("角色-关联的菜单", new { roleid = roleID });

                    await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "menu");
                }
            }
        }
Exemplo n.º 9
0
        async void OnAddRole(object sender, Mi e)
        {
            SelectRolesDlg dlg    = new SelectRolesDlg();
            long           menuID = _fv.Data.To <Menu>().ID;

            if (await dlg.Show(RoleRelations.Menu, menuID.ToString(), e))
            {
                List <RoleMenu> ls = new List <RoleMenu>();
                foreach (var row in dlg.SelectedItems.OfType <Row>())
                {
                    ls.Add(new RoleMenu(row.ID, menuID));
                }
                if (ls.Count > 0 && await AtCm.BatchSave(ls))
                {
                    _lvRole.Data = await AtCm.Query <RoleMenu>("菜单-关联的角色", new { menuid = menuID });

                    await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "menu");
                }
            }
        }