/// <summary>
        /// 查询群组人员
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="rowCount"></param>
        /// <param name="userAccount"></param>
        /// <param name="userName"></param>
        /// <param name="personType"></param>
        /// <returns></returns>
        public DataSet QueryPersons(int pageIndex, int pageSize, out int rowCount, string userAccount, string userName, string personType, string groupID)
        {
            string strSql = @" SELECT  TBLPERSON.oid ,
                                        TBLPERSON.personaccount ,
                                        TBLPERSON.personname ,
                                        TBLPERSON.personsex ,
                                        TBLPERSON.personstatus ,
                                        TBLPERSON.personofficephone ,
                                        TBLPERSON.personmobilephone ,
                                        TBLPERSON.personemail ,
                                        TBLPERSON.personmemo ,
                                        persontype
                                FROM    TBLGroupPersonMap
                                        INNER JOIN TBLPERSON ON TBLGroupPersonMap.PersonID = TBLPERSON.oid
                                WHERE   1 = 1 ";
            if (!string.IsNullOrEmpty(userAccount))
            {
                strSql += " and personaccount like @PersonAccount ";
            }
            if (!string.IsNullOrEmpty(userName))
            {
                strSql += " and personname like @PersonName ";
            }
            if (!string.IsNullOrEmpty(personType))
            {
                strSql += " and persontype = @PersonType ";
            }
            if (!string.IsNullOrEmpty(groupID))
            {
                strSql += " AND TBLGroupPersonMap.groupID=@GroupID ";
            }
            string[] paramNames = new string[4];
            object[] paramValues = new object[4];

            paramNames[0] = "PersonAccount";
            paramNames[1] = "PersonName";
            paramNames[2] = "PersonType";
            paramNames[3] = "GroupID";

            paramValues[0] = "%" + userAccount + "%";
            paramValues[1] = "%" + userName + "%";
            paramValues[2] = personType;
            paramValues[3] = groupID;
            SqlDBBroker broker = new SqlDBBroker();
            broker.Open();
            DataSet dst = broker.QueryPageFromSql(strSql, paramNames, paramValues, pageIndex, pageSize, out rowCount);
            broker.Close();
            return dst;
        }
Exemplo n.º 2
0
        public DataSet QueryPersons(int pageIndex,int pageSize,out int rowCount,string userAccount,string userName)
        {
            string strSql = @" SELECT  oid ,
                                        personaccount ,
                                        personname ,
                                        personsex ,
                                        personofficephone ,
                                        personmobilephone ,
                                        personemail ,
                                        personmemo
                                FROM    TBLPERSON where 1=1 ";
            if (!string.IsNullOrEmpty(userAccount))
            {
                strSql += " and personaccount like @PersonAccount ";
            }
            if (!string.IsNullOrEmpty(userName))
            {
                strSql += " and personname like @PersonName ";
            }
            string[] paramNames = new string[2];
            object[] paramValues = new object[2];

            paramNames[0] = "PersonAccount";
            paramNames[1] = "PersonName";

            paramValues[0] = "%" + userAccount + "%";
            paramValues[1] = "%" + userName + "%";
            SqlDBBroker broker = new SqlDBBroker();
            broker.Open();
            DataSet dst = broker.QueryPageFromSql(strSql,paramNames,paramValues,pageIndex,pageSize,out rowCount);
            broker.Close();
            return dst;
        }
        public DataSet QueryGroupPermissions(int pageIndex, int pageSize, out int rowCount, string groupCode, string groupName)
        {
            string strSql = @" SELECT * FROM TBLPermissionGroup WHERE 1=1 ";
            if (!string.IsNullOrEmpty(groupCode))
            {
                strSql += " and groupcode like @GroupCode ";
            }
            if (!string.IsNullOrEmpty(groupName))
            {
                strSql += " and groupname like @GroupName ";
            }
            string[] paramNames = new string[2];
            object[] paramValues = new object[2];

            paramNames[0] = "GroupCode";
            paramNames[1] = "GroupName";

            paramValues[0] = "%" + groupCode + "%";
            paramValues[1] = "%" + groupName + "%";
            SqlDBBroker broker = new SqlDBBroker();
            broker.Open();
            DataSet dst = broker.QueryPageFromSql(strSql, paramNames, paramValues, pageIndex, pageSize, out rowCount);
            broker.Close();
            return dst;
        }