/// <summary> /// 查询分销商下有无领取活动商品 /// </summary> /// <param name="pager"></param> /// <param name="filter"></param> public void GetDealerReceiveProductList(ref Pager <CBDsReceiveProduct> pager, ParaReceiveProductFilter filter, string ContactKey) { IDsDealerApplyDao.Instance.GetDealerReceiveProductList(ref pager, filter, ContactKey); }
/// <summary> /// 领取活动商品记录 /// </summary> /// <param name="pager"></param> /// <param name="filter"></param> public override void GetDealerReceiveProductList(ref Pager <CBDsReceiveProduct> pager, ParaReceiveProductFilter filter, string ContactKey) { using (var context = Context.UseSharedConnection(true)) { const string sqlSelect = @"re.*,cu.NickName as CustomerName,cu.Account,pr.ProductName,de.DealerName"; const string sqlFrom = @"SoReceiveProduct re left join CrCustomer cu on re.CustomerSysNo=cu.sysno left join PdProduct pr on re.ProductSysNo=pr.sysno left join DsDealer de on re.DealerSysNo=de.sysno"; string sqlWhere = " 1=1 "; if (ContactKey != null) { sqlWhere += " and cu.NickName like'%" + ContactKey + "%' or pr.ProductName like'%" + ContactKey + "%'"; } #region sqlcount string sqlCount = @" select count(1) from SoReceiveProduct re left join CrCustomer cu on re.CustomerSysNo=cu.sysno left join PdProduct pr on re.ProductSysNo=pr.sysno left join DsDealer de on re.DealerSysNo=de.sysno where " + sqlWhere; pager.TotalRows = context.Sql(sqlCount) .QuerySingle <int>(); #endregion pager.Rows = context.Select <CBDsReceiveProduct>(sqlSelect) .From(sqlFrom) .Where(sqlWhere) .OrderBy("re.sysno desc") .Paging(pager.CurrentPage, pager.PageSize) .QueryMany(); } }
/// <summary> /// 查询分销商下有无领取活动商品 /// </summary> /// <param name="pager"></param> /// <param name="filter"></param> public abstract void GetDealerReceiveProductList(ref Pager <CBDsReceiveProduct> pager, ParaReceiveProductFilter filter, string ContactKey);