Esempio n. 1
0
        public void ProcessRequest(HttpContext context)
        {
            List <BLLPermission.Model.PermissionGroupInfo> list = bllPms.GetGroupList(int.MaxValue, 1, null, bllPms.WebsiteOwner, null, 2);

            list.AddRange(bllPms.GetGroupList(int.MaxValue, 1, "", "common", null, 3));
            list.AddRange(bllPms.GetGroupList(int.MaxValue, 1, "", "common", null, 4));
            List <ListItem> itemList = new List <ListItem>();

            if (currentUserInfo.UserType != 1 && currentUserInfo.UserID != bllPms.WebsiteOwner && !currentUserInfo.PermissionGroupID.HasValue)
            {
                List <BLLPermission.Model.PermissionGroupInfo> groupList = bllPms.GetUserGroupList(currentUserInfo.UserID, bllPms.WebsiteOwner, 2);
                if (groupList.Count > 0)
                {
                    foreach (BLLPermission.Model.PermissionGroupInfo item in groupList)
                    {
                        if (itemList.FirstOrDefault(p => p.Value == item.GroupID.ToString()) != null)
                        {
                            continue;
                        }
                        bllPms.GetGroupItemList(ref itemList, list, item.GroupID, 1, 9, "");
                    }
                }
            }
            else
            {
                bllPms.GetGroupItemList(ref itemList, list, 0, 1, 9, "");
            }
            string result = new ZentCloud.Common.MyCategories().CreateSelectOptionHtml(itemList, "ddlPermissionGroup", "width: 140px", "");

            apiResp.result = result;
            apiResp.status = true;
            apiResp.code   = (int)APIErrCode.IsSuccess;
            bllPermissionColumn.ContextResponse(context, apiResp);
        }
Esempio n. 2
0
        public void ProcessRequest(HttpContext context)
        {
            StringBuilder sbWhere   = new StringBuilder();
            int           pageIndex = Convert.ToInt32(context.Request["page"]);
            int           pageSize  = Convert.ToInt32(context.Request["rows"]);
            string        keyWord   = context.Request["searchReq"];

            List <BLLPermission.Model.PermissionGroupInfo> list = bllPms.GetGroupList(pageSize, pageIndex, keyWord, bllPms.WebsiteOwner, null, 2);

            list.AddRange(bllPms.GetGroupList(pageSize, pageIndex, keyWord, "common", null, 3));
            list.AddRange(bllPms.GetGroupList(pageSize, pageIndex, keyWord, "common", null, 4));
            List <BLLPermission.Model.PermissionGroupInfo> dataList = new List <BLLPermission.Model.PermissionGroupInfo>();

            if (currentUserInfo.UserType != 1 && currentUserInfo.UserID != bllPms.WebsiteOwner)
            {
                List <BLLPermission.Model.PermissionGroupInfo> groupList = bllPms.GetUserGroupList(currentUserInfo.UserID, bllPms.WebsiteOwner, 2);
                if (groupList.Count > 0)
                {
                    foreach (BLLPermission.Model.PermissionGroupInfo item in groupList)
                    {
                        if (dataList.FirstOrDefault(p => p.GroupID == item.GroupID) != null)
                        {
                            continue;
                        }
                        bllPms.GetDataList(ref dataList, list, item.GroupID, 1, 9);
                    }
                }
            }
            else
            {
                bllPms.GetDataList(ref dataList, list, 0, 1, 9);
            }
            int total = dataList.Count;

            if (dataList.Count > pageSize)
            {
                dataList = dataList.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
            }
            var data = new
            {
                total = total,
                rows  = dataList//列表
            };

            bllPms.ContextResponse(context, data);
        }