Exemple #1
0
        public static User[] GetAPPCustomerListByWechatMsgID(int WechatMsgID)
        {
            var msg_project_list = Wechat_MsgProject.GetWechat_MsgProjectList(WechatMsgID);

            if (msg_project_list.Length == 0)
            {
                return(new User[] { });
            }
            List <string> conditions = new List <string>();

            foreach (var msg_project in msg_project_list)
            {
                conditions.Add("[AllParentID] like '%," + msg_project.ProjectID + ",%'");
            }
            string cmdtext = "select * from [User] where [UserID] in (select [UserID] from [Mall_UserProject] where isnull([IsDisable],0)=0 and [ProjectID] in (select ID from [Project] where [isParent]=0 and (" + string.Join(" or ", conditions.ToArray()) + ")))";
            var    list    = GetList <User>(cmdtext, new List <SqlParameter>()).ToArray();

            return(list);
        }
Exemple #2
0
        public static User[] GetAPPUserListByWechatMsgID(int WechatMsgID)
        {
            var msg_project_list = Wechat_MsgProject.GetWechat_MsgProjectList(WechatMsgID);

            if (msg_project_list.Length == 0)
            {
                return(new User[] { });
            }
            List <string> conditions = new List <string>();
            List <string> cmdlist    = new List <string>();

            foreach (var msg_project in msg_project_list)
            {
                cmdlist.Add("[AllParentID] like '%," + msg_project.ProjectID + ",%'");
            }
            conditions.Add("([UserID] in (select [UserID] from [UserRoles] where [RoleID] in (select [RoleID] from [RoleProject] where [ProjectID] in (select ID from [Project] where " + string.Join(" or ", cmdlist.ToArray()) + "))) or [UserID] in (select [UserID] from [RoleProject] where [ProjectID] in (select ID from [Project] where " + string.Join(" or ", cmdlist.ToArray()) + ")))");
            string cmdtext = "select * from [User] where " + string.Join(" and ", conditions.ToArray());
            var    list    = GetList <User>(cmdtext, new List <SqlParameter>()).ToArray();

            return(list);
        }