Ejemplo n.º 1
0
        public static List <SystemUser> QuerySystemUserListBySysNos(IEnumerable <int> sysNos, string applicationID)
        {
            DataCommand cmd = new DataCommand("QuerySystemUserListBySysNos");

            cmd.SetParameter("@ApplicationID", DbType.String, applicationID);
            cmd.CommandText = cmd.CommandText.Replace("#SysNos#", string.Join(",", sysNos));
            List <SystemUser> result = cmd.ExecuteEntityList <SystemUser>();

            if (result != null && result.Count > 0)
            {
                List <SystemApplication> apps = AuthDA.GetSystemApplicationsByUserSysNo(from s in result select s.SysNo);
                result.ForEach(x =>
                {
                    x.Applications = apps.FindAll(y => y.BizSysNo == x.SysNo);
                });
            }
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 分页查询SystemUser信息
        /// </summary>
        public static QueryResult <SystemUser> QuerySystemUserList(QF_SystemUser filter)
        {
            //if (string.IsNullOrEmpty(filter.ApplicationID))
            //{
            DataCommand cmd = new DataCommand("QuerySystemUserList");

            cmd.QuerySetCondition("u.SysNo", ConditionOperation.Equal, DbType.Int32, filter.SysNo);
            if (!string.IsNullOrEmpty(filter.KeyWords))
            {
                cmd.QuerySetCondition($"And (u.CellPhone like '%{cmd.SetSafeParameter(filter.KeyWords)}%' OR u.UserFullName like '%{cmd.SetSafeParameter(filter.KeyWords)}%' OR u.LoginName like '%{cmd.SetSafeParameter(filter.KeyWords)}%' )");
            }
            //cmd.QuerySetCondition("u.Email", ConditionOperation.Equal, DbType.AnsiString, filter.Email);
            cmd.QuerySetCondition("u.CommonStatus", ConditionOperation.Equal, DbType.Int32, filter.CommonStatus);
            if (filter.MasterSysNo.HasValue)
            {
                cmd.QuerySetCondition("u.MasterSysNo", ConditionOperation.Equal, DbType.Int32, filter.MasterSysNo);
            }
            else if (filter.IsPlatformManager)
            {
                cmd.QuerySetCondition("And (u.MasterSysNo is NUll Or  u.MasterSysNo=0)");
            }



            QueryResult <SystemUser> result = cmd.Query <SystemUser>(filter, " u.SysNo DESC");

            if (result.data != null && result.data.Count > 0)
            {
                List <SystemApplication> apps = AuthDA.GetSystemApplicationsByUserSysNo(from s in result.data select s.SysNo);
                result.data.ForEach(x =>
                {
                    x.Applications = apps.FindAll(y => y.BizSysNo == x.SysNo);
                });
            }

            return(result);
            //}
            //else
            //{
            //    DataCommand cmd = new DataCommand("QuerySystemUserListBuyApplication");
            //    cmd.QuerySetCondition("u.SysNo", ConditionOperation.Equal, DbType.Int32, filter.SysNo);
            //    cmd.QuerySetCondition("u.LoginName", ConditionOperation.Like, DbType.AnsiString, cmd.SetSafeParameter(filter.LoginName));
            //    cmd.QuerySetCondition("u.UserFullName", ConditionOperation.Like, DbType.String, cmd.SetSafeParameter(filter.UserFullName));
            //    cmd.QuerySetCondition("u.CellPhone", ConditionOperation.Like, DbType.String, cmd.SetSafeParameter(filter.CellPhone));
            //    cmd.QuerySetCondition("u.Email", ConditionOperation.Equal, DbType.AnsiString, cmd.SetSafeParameter(filter.Email));
            //    cmd.QuerySetCondition("u.CommonStatus", ConditionOperation.Equal, DbType.Int32, filter.CommonStatus);
            //    //cmd.QuerySetCondition("u.CommonStatus", ConditionOperation.NotEqual, DbType.Int32, CommonStatus.Deleted);
            //    cmd.QuerySetCondition("ua.ApplicationID", ConditionOperation.Equal, DbType.AnsiString, cmd.SetSafeParameter(filter.ApplicationID));
            //    if (filter.MasterSysNo.HasValue)
            //    {
            //        cmd.QuerySetCondition("u.MasterSysNo", ConditionOperation.Equal, DbType.Int32, filter.MasterSysNo);
            //    }
            //    else
            //    {
            //        cmd.QuerySetCondition("And (u.MasterSysNo is NUll Or  u.MasterSysNo=0)");
            //    }
            //    QueryResult<SystemUser> result = cmd.Query<SystemUser>(filter, " u.SysNo DESC");
            //    if (result.data != null && result.data.Count > 0)
            //    {

            //        List<SystemApplication> apps = AuthDA.GetSystemApplicationsByUserSysNo(from s in result.data select s.SysNo);
            //        result.data.ForEach(x =>
            //        {
            //            x.Applications = apps.FindAll(y => y.BizSysNo == x.SysNo);
            //        });
            //    }

            //    return result;
            //}
        }