示例#1
0
        /// <summary>
        /// 获得当前用户有权限看到的分销商
        /// 2016-1-4 王耀发 创建
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public override IList <DsDealer> GetDealersListByCurUser(ParaDsDealerFilter filter)
        {
            var sql = @"Select d.* From DsDealer d Where {0}";

            var where = "d.[Status] = 1 ";

            //判断是否绑定所有分销商
            if (!filter.IsBindAllDealer)
            {
                //判断是否绑定分销商
                if (filter.IsBindDealer)
                {
                    where += " and d.SysNo = " + filter.DealerSysNo;
                }
                else
                {
                    where += " and d.CreatedBy = " + filter.DealerCreatedBy;
                }
            }
            where += " order by d.SysNo desc ";
            sql    = string.Format(sql, where);

            return(Context.Sql(sql)
                   .QueryMany <DsDealer>());
        }
示例#2
0
        /// <summary>
        /// 查询分销商信息
        /// </summary>
        /// <param name="filter">查询参数实体</param>
        /// <returns>分销商信息列表</returns>
        /// <remarks>
        /// 2013-09-04 郑荣华 创建
        /// </remarks>
        public override IList <CBDsDealer> GetDsDealerList(ParaDsDealerFilter filter)
        {
            //dbo.func_getaereapath(t.areasysno)
            const string sqlSelect = @"t.*,a.levelname,b.account,b.username,'' as AreaAllName,
                                       c.totalprestoreamount,c.availableamount,c.frozenamount";

            const string sqlFrom = @"DsDealer t left join dsdealerlevel a on t.levelsysno=a.sysno
                                     left join syuser b on t.usersysno=b.sysno 
                                     left join DsPrePayment c on t.sysno=c.dealersysno";

            const string sqlWhere = @"
                (@DealerName is null or t.DealerName=@DealerName) 
                and (@LevelSysNo is null or t.LevelSysNo= @LevelSysNo)
                and (@status is null or t.status= @status)
                and (@UserSysNo is null or t.UserSysNo=@UserSysNo)     
                and (@AppID is null or t.AppID=@AppID)    
                and (@AppSecret is null or t.AppSecret=@AppSecret)    
                and (@WeiXinNum is null or t.WeiXinNum=@WeiXinNum)    
                and (@DomainName is null or t.DomainName=@DomainName)    
               ";

            return(Context.Select <CBDsDealer>(sqlSelect)
                   .From(sqlFrom)
                   .Where(sqlWhere)
                   .Parameter("DealerName", filter.DealerName)
                   .Parameter("LevelSysNo", filter.LevelSysNo)
                   .Parameter("status", filter.Status)
                   .Parameter("UserSysNo", filter.UserSysNo)
                   .Parameter("AppID", filter.AppID)
                   .Parameter("AppSecret", filter.AppSecret)
                   .Parameter("WeiXinNum", filter.WeiXinNum)
                   .Parameter("DomainName", filter.DomainName)
                   .QueryMany());
        }
示例#3
0
        /// <summary>
        /// 查询分销商信息
        /// </summary>
        /// <param name="WeiXinNum">微信公众好</param>
        /// <returns></returns>
        /// 2015-12-22 王耀发 创建 可用于重复性检查 分销商名称唯一
        public IList <CBDsDealer> GetDsDealerListByWeiXinNum(string WeiXinNum)
        {
            var filter = new ParaDsDealerFilter {
                WeiXinNum = WeiXinNum
            };

            return(GetDsDealerList(filter));
        }
示例#4
0
        /// <summary>
        /// 查询分销商信息
        /// </summary>
        /// <param name="DomainName">域名</param>
        /// <returns></returns>
        /// 2015-12-22 王耀发 创建 可用于重复性检查 分销商名称唯一
        public IList <CBDsDealer> GetDsDealerListByDomainName(string DomainName)
        {
            var filter = new ParaDsDealerFilter {
                DomainName = DomainName
            };

            return(GetDsDealerList(filter));
        }
示例#5
0
        /// <summary>
        /// 查询分销商信息
        /// </summary>
        /// <param name="AppID">AppID</param>
        /// <returns></returns>
        /// <remarks>
        /// 2015-12-22 王耀发 创建 可用于重复性检查 分销商名称唯一
        /// </remarks>
        public IList <CBDsDealer> GetDsDealerListByAppID(string AppID)
        {
            var filter = new ParaDsDealerFilter {
                AppID = AppID
            };

            return(GetDsDealerList(filter));
        }
示例#6
0
        /// <summary>
        /// 查询分销商信息
        /// </summary>
        /// <param name="AppSecret">AppSecret</param>
        /// <returns></returns>
        /// <remarks>
        /// 2015-12-22 王耀发 创建 可用于重复性检查 分销商名称唯一
        public IList <CBDsDealer> GetDsDealerListByAppSecret(string AppSecret)
        {
            var filter = new ParaDsDealerFilter {
                AppSecret = AppSecret
            };

            return(GetDsDealerList(filter));
        }
示例#7
0
        /// <summary>
        /// 查询分销商信息
        /// </summary>
        /// <param name="dealerName">分销商名称</param>
        /// <returns>分销商信息列表,0或1条记录正常</returns>
        /// <remarks>
        /// 2013-09-04 郑荣华 创建 可用于重复性检查 分销商名称唯一
        /// </remarks>
        public IList <CBDsDealer> GetDsDealerList(string dealerName)
        {
            var filter = new ParaDsDealerFilter {
                DealerName = dealerName
            };

            return(GetDsDealerList(filter));
        }
示例#8
0
        /// <summary>
        /// 查询分销商信息
        /// </summary>
        /// <param name="userSysNo">系统用户编号</param>
        /// <returns>分销商信息列表,0或1条记录正常</returns>
        /// <remarks>
        /// 2013-09-04 郑荣华 创建 可用于重复性检查 一个系统用户编号不能用于多个分销商
        /// </remarks>
        public IList <CBDsDealer> GetDsDealerList(int userSysNo)
        {
            var filter = new ParaDsDealerFilter {
                UserSysNo = userSysNo
            };

            return(GetDsDealerList(filter));
        }
示例#9
0
 /// <summary>
 /// 获得当前用户有权限看到的分销商
 /// 2016-1-4 王耀发 创建
 /// </summary>
 /// <param name="filter"></param>
 /// <returns></returns>
 public abstract IList <DsDealer> GetDealersListByCurUser(ParaDsDealerFilter filter);
示例#10
0
 /// <summary>
 /// 查询分销商信息
 /// </summary>
 /// <param name="filter">查询参数实体</param>
 /// <returns>分销商信息列表</returns>
 /// <remarks>
 /// 2013-09-04 郑荣华 创建
 /// </remarks>
 public abstract IList <CBDsDealer> GetDsDealerList(ParaDsDealerFilter filter);
示例#11
0
 /// <summary>
 /// 分页查询分销商信息列表
 /// </summary>
 /// <param name="pager">分销商信息列表分页对象</param>
 /// <param name="filter">查询条件</param>
 /// <remarks>
 /// 2013-09-04 郑荣华 创建
 /// </remarks>
 public abstract void GetDsDealerList(ref Pager <CBDsDealer> pager, ParaDsDealerFilter filter);
示例#12
0
        /// <summary>
        /// 分页查询分销商信息列表
        /// </summary>
        /// <param name="pager">分销商信息列表分页对象</param>
        /// <param name="filter">查询条件</param>
        /// <returns></returns>
        /// <remarks>
        /// 2013-09-04 郑荣华 创建
        /// </remarks>
        public override void GetDsDealerList(ref Pager <CBDsDealer> pager, ParaDsDealerFilter filter)
        {
            using (var context = Context.UseSharedConnection(true))
            {
                //2015-12-19 王耀发 创建
                //var DealerSysNoList = string.Empty;
                //if (null != filter.DealerSysNoList)
                //{
                //    DealerSysNoList = string.Join(",", filter.DealerSysNoList);
                //}
                //dbo.func_getaereapath(t.areasysno)
                const string sqlSelect = @"t.*,a.levelname,b.account,b.username,'' as AreaAllName,
                                           c.totalprestoreamount,c.availableamount,c.frozenamount";

                const string sqlFrom  = @"DsDealer t left join dsdealerlevel a on t.levelsysno=a.sysno
                                         left join syuser b on t.usersysno=b.sysno 
                                         left join DsPrePayment c on t.sysno=c.dealersysno";
                string       sqlWhere = "1=1";

                //判断是否绑定所有分销商
                if (!filter.IsBindAllDealer)
                {
                    //判断是否绑定分销商
                    if (filter.IsBindDealer)
                    {
                        sqlWhere += " and t.SysNo = @DealerSysNo";
                    }
                    else if (filter.DealerCreatedBy >= 0)
                    {
                        sqlWhere += " and t.CreatedBy = @DealerCreatedBy";
                    }
                }

                sqlWhere += @" and (@DealerName is null or charindex(@DealerName,t.DealerName)>0)                
                                          and (@LevelSysNo is null or t.LevelSysNo= @LevelSysNo)
                                          and (@status is null or t.status= @status)
                                          and (@UserSysNo is null or t.UserSysNo=@UserSysNo)
                                          and (@ProductSysNo is null or not exists(select 1 from DsSpecialPrice s where t.sysno=s.dealersysno and s.productsysno=@ProductSysNo))              
                                          ";

                #region sqlcount

                string sqlCount = @" select count(1) from DsDealer t where " + sqlWhere;

                pager.TotalRows = context.Sql(sqlCount)
                                  .Parameter("DealerSysNo", filter.DealerSysNo)
                                  .Parameter("DealerCreatedBy", filter.DealerCreatedBy)
                                  .Parameter("DealerName", filter.DealerName)
                                  .Parameter("LevelSysNo", filter.LevelSysNo)
                                  .Parameter("status", filter.Status)
                                  .Parameter("UserSysNo", filter.UserSysNo)
                                  .Parameter("ProductSysNo", filter.ProductSysNo)
                                  .QuerySingle <int>();
                #endregion

                pager.Rows = context.Select <CBDsDealer>(sqlSelect)
                             .From(sqlFrom)
                             .Where(sqlWhere)
                             .Parameter("DealerSysNo", filter.DealerSysNo)
                             .Parameter("DealerCreatedBy", filter.DealerCreatedBy)
                             .Parameter("DealerName", filter.DealerName)
                             .Parameter("LevelSysNo", filter.LevelSysNo)
                             .Parameter("status", filter.Status)
                             .Parameter("UserSysNo", filter.UserSysNo)
                             .Parameter("ProductSysNo", filter.ProductSysNo)
                             .OrderBy("t.sysno desc")
                             .Paging(pager.CurrentPage, pager.PageSize)
                             .QueryMany();
            }
        }
示例#13
0
 /// <summary>
 /// 获得当前用户有权限看到的分销商
 /// 2016-1-4 王耀发 创建
 /// </summary>
 /// <param name="filter"></param>
 /// <returns></returns>
 public IList <DsDealer> GetDealersListByCurUser(ParaDsDealerFilter filter)
 {
     return(IDsDealerDao.Instance.GetDealersListByCurUser(filter));
 }
示例#14
0
 /// <summary>
 /// 查询分销商信息
 /// </summary>
 /// <param name="filter">查询参数实体</param>
 /// <returns>分销商信息列表</returns>
 /// <remarks>
 /// 2013-09-04 郑荣华 创建
 /// </remarks>
 public IList <CBDsDealer> GetDsDealerList(ParaDsDealerFilter filter)
 {
     return(IDsDealerDao.Instance.GetDsDealerList(filter));
 }
示例#15
0
 /// <summary>
 /// 分页查询分销商信息列表
 /// </summary>
 /// <param name="pager">分销商信息列表分页对象</param>
 /// <param name="filter">查询条件</param>
 /// <remarks>
 /// 2013-09-04 郑荣华 创建
 /// </remarks>
 public void GetDsDealerList(ref Pager <CBDsDealer> pager, ParaDsDealerFilter filter)
 {
     IDsDealerDao.Instance.GetDsDealerList(ref pager, filter);
 }