예제 #1
0
        public OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> > GetPageUploadinfo(Ppc_UploadInfoInputPageListDto input)
        {
            OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> > res = new OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> >()
            {
                StatusCode = 0,
                Message    = "获取分页信息失败"
            };
            var result = _service.GetPageUploadinfo(input);

            return(result);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>

        public OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> > GetPageUploadinfo(Ppc_UploadInfoInputPageListDto input)
        {
            OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> > list = new OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> >()
            {
                StatusCode = 1, Message = "获取信息成功"
            };

            if (string.IsNullOrEmpty(SessionDataResult.LoginUseID))
            {
                list.StatusCode = 0;
                list.Message    = "登录信息已过期";
                return(list);
            }
            ComparePriceToCrmApiResultDto <List <CrmPurchaseOutPutDto> > crmOutPut = new ComparePriceToCrmApi(_apiRequest).GetPurchaseBelongsFromCrm(new PurchaseInputDto()
            {
                CRMUserId = SessionDataResult.LoginUseID
            }).Result;

            if (crmOutPut.State <= 0)
            {
                list.StatusCode = 0;
                list.Message    = crmOutPut.Message;
                return(list);
            }
            string[] ennameArray = crmOutPut.ReValue.Where(m => !string.IsNullOrWhiteSpace(m.EName)).Select(m => m.EName).Distinct().ToArray();
            Expression <Func <Ppc_UploadInfo, bool> > exp = m => 1 > 0;

            if (ennameArray != null && ennameArray.Length > 0)
            {
                exp = exp.And(m => ennameArray.Contains(m.CreateName));
            }
            Dictionary <int, Expression <Func <Ppc_UploadInfo, object> > > dic = new Dictionary <int, Expression <Func <Ppc_UploadInfo, object> > >();

            dic.Add(2, m => m.CreateTime);
            var selector   = ExpExtension.GetSelector <Ppc_UploadInfo, Ppc_UploadInfoOutPutPageListDto>();
            var pageEntity = _iRepository.GetConditionPageList <Ppc_UploadInfo, Ppc_UploadInfoOutPutPageListDto>(exp, input.PageIndex, input.PageSize, dic, selector);

            list.Ext1 = pageEntity.GetCommonPageEntityies <Ppc_UploadInfoOutPutPageListDto>();
            return(list);
        }