Example #1
0
        /// <summary>
        /// 获取用户渠道ID权限
        /// </summary>
        /// <param name="softId"></param>
        /// <param name="channelType"></param>
        /// <param name="channels"></param>
        /// <param name="mustLogin">有些地方不需要登录也可以请求</param>
        /// <returns></returns>
        public List <int> GetAvailableChannelIds(int softId, ChannelTypeOptions channelType, int[] channels, bool mustLogin = true)
        {
            if (mustLogin)
            {
                if (!AvailableSofts.Exists(a => a.ID == softId))
                {
                    return(new List <int>());
                }

                if (LoginUser.AccountType == UserTypeOptions.Channel ||
                    LoginUser.AccountType == UserTypeOptions.ChannelPartner)
                {
                    return(DAChannelsHelper.GetChannelIds(LoginUser.ID, softId, channelType, channels));
                }
            }
            return(DAChannelsHelper.GetChannelIds(softId, channelType, channels));
        }
Example #2
0
 /// <summary>
 /// 获取指定软件指定渠道绑定的渠道ID列表(未登录)
 /// </summary>
 /// <param name="softId"></param>
 /// <param name="channelType"></param>
 /// <param name="channels"></param>
 /// <returns></returns>
 public List <int> GetChannelIds(int softId, ChannelTypeOptions channelType, int[] channels)
 {
     return(DAChannelsHelper.GetChannelIds(softId, channelType, channels));
 }