Exemple #1
0
 public ActionResult List(Guid webApplicationId, int pageIndex = 1, int pageSize = 10)
 {
     try
     {
         if (webApplicationId == Guid.Empty)
         {
             throw new BaseException("webApplicationId不能为空");
         }
         var orderBys = OrderByHelper.Create().Desc("OpenId");
         var where = Where.Create().Eq("WebApplicationId", webApplicationId);
         var listResult = this.IWeiXinQRCodePromotionActivityAccountService.Page(orderBys, where, pageIndex, pageSize);
         foreach (var item in listResult.Data)
         {
             item.LoadWeiXinAccount();
         }
         return(this.JsonSuccessGenericPageExecResult(listResult));
     }
     catch (BaseException ex)
     {
         return(this.JsonFailureGenericPageExecResult(ex));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public void TestTransInsertAndQuery()
 {
     for (var i = 0; i < 200; i++)
     {
         var rnd = new Random();
         ServiceContext.IComClickService.Insert(new Entities.ComClickDto()
         {
             ID         = Guid.NewGuid(),
             Category   = "t",
             ClickCount = rnd.Next(1, 200)
         });
     }
     var list = ServiceContext.IComClickService.Top(10, 50, OrderByHelper.Create().Desc("ClickCount"));
     var kk   = 0;
 }
Exemple #3
0
        public GenericPageResult <WeiXinQRCodePromotionActivityAccountPointsHistoryDto> Find(Guid webApplicationId, string openId, int pageIndex = 1, int pageSize = 10)
        {
            if (this.IValidatorTool.IsEmpty(openId))
            {
                throw new BaseException("openId不能为空");
            }
            if (webApplicationId == Guid.Empty)
            {
                throw new BaseException("webApplicationId不能为空");
            }
            var where = Where.Create().Eq("WebApplicationId", webApplicationId).Eq("OpenId", openId);
            var orderBy = OrderByHelper.Create().Desc("CreatedDate");
            var list    = this.Page(orderBy, where, pageIndex, pageSize);

            return(list);
        }
        public ActionResult List(Guid weiXinQRCodePromotionActivityAccountId, int pageIndex = 1, int pageSize = 10)
        {
            try
            {
                if (weiXinQRCodePromotionActivityAccountId == Guid.Empty)
                {
                    throw new BaseException("WeiXinQRCodePromotionActivityAccountId不能为空");
                }
                var orderBys = OrderByHelper.Create().Desc("CreatedDate");
                var where = Where.Create().Eq("WeiXinQRCodePromotionActivityAccountId", weiXinQRCodePromotionActivityAccountId);
                var listResult = this.IWeiXinQRCodePromotionActivityAccountPointsHistoryService
                                 .Page(orderBys, where, pageIndex, pageSize);

                return(this.JsonSuccessGenericPageExecResult(listResult));
            }
            catch (Exception ex)
            {
                return(this.JsonFailureGenericPageExecResult(ex));
            }
        }