Exemplo n.º 1
0
        public RecordPage <SubjectInfo> AddApplyList(MarketOptionSearchParm parm, int pageIndex = 1, int pageSize = 10)
        {
            var dic = new Dictionary <string, object>();

            dic.Add("KeyWord", (parm == null || parm.SubjectNoName == "活动名称或活动编号" || string.IsNullOrEmpty(parm.SubjectNoName)) ? "" : parm.SubjectNoName);
            dic.Add("BrandNo", (parm == null || string.IsNullOrEmpty(parm.BrandNo)) ? "" : parm.BrandNo);
            dic.Add("ApplyBeginTime", (parm == null || string.IsNullOrEmpty(parm.ApplyBeginTime)) ? "" : parm.ApplyBeginTime);
            dic.Add("ApplyEndTime", (parm == null || string.IsNullOrEmpty(parm.ApplyEndTime)) ? "" : parm.ApplyEndTime);
            dic.Add("SpreadStatus", (parm == null || string.IsNullOrEmpty(parm.SpreadStatus)) ? "" : parm.SpreadStatus);
            dic.Add("Level", (parm == null || string.IsNullOrEmpty(parm.Level)) ? "" : parm.Level);
            dic.Add("SubjectType", (parm == null || string.IsNullOrEmpty(parm.SubjectType)) ? "" : parm.SubjectType);
            dic.Add("CategoryNo", (parm == null || string.IsNullOrEmpty(parm.CategoryNo)) ? "" : parm.CategoryNo);
            IEnumerable <SubjectInfo> query = DapperUtil.QueryPaging <SubjectInfo>("ComBeziWfs_SWfsSubjectApply_SubjectList", pageIndex, pageSize, "CreateDateTime desc", dic, new {
                KeyWord        = parm.SubjectNoName,
                BrandNo        = parm.BrandNo,
                ApplyBeginTime = parm.ApplyBeginTime,
                ApplyEndTime   = string.IsNullOrWhiteSpace(parm.ApplyEndTime) ? "" : Convert.ToDateTime(parm.ApplyEndTime).AddDays(1).ToString("yyyy-MM-dd"),
                SpreadStatus   = parm.SpreadStatus,
                Level          = parm.Level,
                SubjectType    = parm.SubjectType,
                CategoryNo     = parm.CategoryNo
            });

            Dictionary <string, List <SWfsSubjectChannelSordRef> > dicSordRef = new SWfsSubjectService().GetSordBySubjectNoList(query.Select(x => x.SubjectNo).ToArray());

            foreach (var subject in query)
            {
                subject.ChannelSordList = dicSordRef.Keys.Contains(subject.SubjectNo) ? dicSordRef[subject.SubjectNo] : null;
            }
            return(PageConvertor.Convert(pageIndex, pageSize, query.ToList()));
        }
Exemplo n.º 2
0
        public void PageConvertor_Convert_EntitiesToDtoPage()
        {
            var convertor = new PageConvertor <AuthorDto>(_projector);

            IPaging paging = new Paging(2, 10);

            using (var uowStub = Stub.CreateMemoryUoW(typeof(Author)).AddAuthors(50))
            {
                var actual = convertor.Convert(uowStub.Linq.Query <Author>(), paging);

                Assert.IsInstanceOfType(actual, typeof(Page <AuthorDto>));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 活动图管理列表
        /// </summary>
        /// <param name="keyword">活动图名称</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="pageIndex"当前页></param>
        /// <param name="pageSize">页码</param>
        /// <returns></returns>
        public RecordPage <SWfsStyleActivityPicM> SelectActivityPicList(string keyword, string startTime, string endTime, int pageIndex, int pageSize)
        {
            var dic = new Dictionary <string, object>();

            dic.Add("KeyWord", (keyword == null || keyword == "活动图名称") ? "" : keyword.Trim());
            dic.Add("StartTime", startTime == null ? "" : startTime);
            dic.Add("EndTime", endTime == null ? "" : endTime);
            DynamicParameters param = new DynamicParameters();

            param.Add("ActivityName", keyword, System.Data.DbType.AnsiString, System.Data.ParameterDirection.Input, 100);
            param.Add("StartTime", (!string.IsNullOrWhiteSpace(startTime) ? startTime : "1900-01-01 00:00:00"), System.Data.DbType.DateTime, System.Data.ParameterDirection.Input);
            param.Add("EndTime", (!string.IsNullOrWhiteSpace(endTime) ? endTime : "1900-01-01 00:00:00"), System.Data.DbType.DateTime, System.Data.ParameterDirection.Input);
            IEnumerable <SWfsStyleActivityPicM> query = DapperUtil.QueryPaging <SWfsStyleActivityPicM>("ComBeziWfs_SWfsStyleActivityPic_FindStyleActivityPicList", pageIndex, pageSize, "StartTime desc,CreateDate desc", dic, param);

            return(PageConvertor.Convert(pageIndex, pageSize, query.ToList()));
        }
Exemplo n.º 4
0
        /// <summary>
        /// EP改版 20141003 by lijia
        /// </summary>
        /// <param name="typeId"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public RecordPage <BrandIndexM> GetBrandIndexDataListNew(int typeId, int pageIndex, int pageSize)
        {
            var dic = new Dictionary <string, object>();

            dic.Add("TypeId", typeId);
            DynamicParameters param = new DynamicParameters();

            param.Add("TypeId", typeId, System.Data.DbType.Int32, System.Data.ParameterDirection.Input);
            List <BrandIndexM>        list  = new List <BrandIndexM>();
            IEnumerable <BrandIndexM> query = DapperUtil.QueryPaging <BrandIndexM>("ComBeziWfs_SWfsBrandIndex_FindBrandIndexDataListNew", pageIndex, pageSize, "SWfsBrandIndex.Sort ASC ,SWfsBrandIndex.DateCreate ASC", dic, param);

            if (query != null && query.Count() > 0)
            {
                list = query.ToList();
            }
            list = (list == null ? new List <BrandIndexM>() : list);
            return(PageConvertor.Convert(pageIndex, pageSize, list));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 品牌首页管理——热门品牌管理EP 20141003 by lijia
        /// </summary>
        /// <param name="showName"></param>
        /// <param name="typeId"></param>
        /// <param name="status"></param>
        /// <param name="brandView"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public RecordPage <SWfsBrandIndexInfo> GetHotBrandList(string showName, string typeId, string status, string brandView, int pageIndex, int pageSize)
        {
            var dic = new Dictionary <string, object>();

            dic.Add("BrandShowName", showName);
            dic.Add("TypeId", typeId);
            dic.Add("Status", status);
            DynamicParameters param = new DynamicParameters();

            param.Add("BrandView", brandView, System.Data.DbType.Int32, System.Data.ParameterDirection.Input);
            param.Add("BrandShowName", showName, System.Data.DbType.AnsiString, System.Data.ParameterDirection.Input);
            param.Add("TypeId", typeId, System.Data.DbType.AnsiString, System.Data.ParameterDirection.Input);
            param.Add("Status", status, System.Data.DbType.AnsiString, System.Data.ParameterDirection.Input);
            IEnumerable <SWfsBrandIndexInfo> query = DapperUtil.QueryPaging <SWfsBrandIndexInfo>("ComBeziWfs_SpBrand_SWfsBrandIndex_ListOutlet", pageIndex, pageSize, "SWfsBrandIndex.Sort asc,SWfsBrandIndex.DateCreate ASC", dic, param);
            List <SWfsBrandIndexInfo>        list  = new List <SWfsBrandIndexInfo>();

            if (query != null && query.Count() > 0)
            {
                list = query.ToList();
            }
            list = (list == null ? new List <SWfsBrandIndexInfo>() : list);
            return(PageConvertor.Convert(pageIndex, pageSize, list));
        }
Exemplo n.º 6
0
        public RecordPage <ProductInfo> GetProductListByTopicNo(IDictionary <string, object> dic, int pageIndex, int pageSize)
        {
            IList <ProductInfo> productList = DapperUtil.QueryPaging <ProductInfo>("ComBeziWfs_SWfsTopicProductRef_SelectTopicProductByTopicNo", pageIndex, pageSize, "SWfsTopicProductRef.OrderFlag asc", dic, new { gCategroyNo = dic["gCategroyNo"].ToString(), brandNo = dic["brandNo"].ToString(), TopicNo = dic["topicId"].ToString(), productNoOrName = dic["productNoOrName"].ToString() }).ToList();

            return(PageConvertor.Convert(pageIndex, pageSize, productList));
        }
Exemplo n.º 7
0
        public RecordPage <ProductInfo> GetProductList(IDictionary <string, object> dic, int pageIndex, int pageSize)
        {
            IList <ProductInfo> productList = DapperUtil.QueryPaging <ProductInfo>("ComBeziWfs_WfsProduct_SelectTopicProductList", pageIndex, pageSize, "ProductNo desc", dic, new { gCategroyNo = dic["gCategroyNo"].ToString(), brandNo = dic["brandNo"].ToString(), productNoOrName = dic["productNoOrName"].ToString(), gender = dic["gender"].ToString() }).ToList();

            return(PageConvertor.Convert(pageIndex, pageSize, productList));
        }