private void BindData()
 {
     BalanceDrawRequestQuery entity = new BalanceDrawRequestQuery {
         CheckTime = this.CheckTime,
         RequestTime = this.RequestTime,
         StoreName = this.StoreName,
         PageIndex = this.pager.PageIndex,
         PageSize = this.pager.PageSize,
         SortOrder = SortAction.Desc,
         SortBy = "UserId",
         RequestEndTime = "",
         RequestStartTime = "",
         IsCheck = ""
     };
     Globals.EntityCoding(entity, true);
     DbQueryResult balanceDrawRequest = VShopHelper.GetBalanceDrawRequest(entity);
     this.reBalanceDrawRequest.DataSource = balanceDrawRequest.Data;
     this.reBalanceDrawRequest.DataBind();
     this.pager.TotalRecords = balanceDrawRequest.TotalRecords;
 }
 protected override void AttachChildControls()
 {
     this.vshopbalancedraw = (VshopTemplatedRepeater) this.FindControl("vshopbalancedraw");
     BalanceDrawRequestQuery query = new BalanceDrawRequestQuery {
         PageIndex = 1,
         PageSize = 0x186a0,
         UserId = DistributorsBrower.GetCurrentDistributors().UserId.ToString(),
         SortBy = "SerialID",
         RequestTime = "",
         RequestStartTime = "",
         RequestEndTime = "",
         CheckTime = "",
         IsCheck = "",
         SortOrder = SortAction.Desc
     };
     DbQueryResult balanceDrawRequest = DistributorsBrower.GetBalanceDrawRequest(query);
     if (balanceDrawRequest.TotalRecords > 0)
     {
         this.vshopbalancedraw.DataSource = balanceDrawRequest.Data;
         this.vshopbalancedraw.DataBind();
     }
 }
Beispiel #3
0
 public void ProcessRequest(HttpContext context)
 {
     string str = context.Request.Form["actionName"];
     string s = string.Empty;
     string str4 = str;
     if (str4 != null)
     {
         if (!(str4 == "Topic"))
         {
             if (str4 == "Vote")
             {
                 s = JsonConvert.SerializeObject(StoreHelper.GetVoteList());
             }
             else if (str4 == "Category")
             {
                 s = JsonConvert.SerializeObject(from item in CatalogHelper.GetMainCategories() select new { CateId = item.CategoryId, CateName = item.Name });
             }
             else if (str4 == "Activity")
             {
                 Array values = Enum.GetValues(typeof(LotteryActivityType));
                 List<EnumJson> list3 = new List<EnumJson>();
                 foreach (Enum enum2 in values)
                 {
                     EnumJson json = new EnumJson {
                         Name = enum2.ToShowText(),
                         Value = enum2.ToString()
                     };
                     list3.Add(json);
                 }
                 s = JsonConvert.SerializeObject(list3);
             }
             else if (str4 == "ActivityList")
             {
                 string str3 = context.Request.Form["acttype"];
                 LotteryActivityType type = (LotteryActivityType) Enum.Parse(typeof(LotteryActivityType), str3);
                 if (type == LotteryActivityType.SignUp)
                 {
                     s = JsonConvert.SerializeObject(from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name });
                 }
                 else
                 {
                     s = JsonConvert.SerializeObject(VShopHelper.GetLotteryActivityByType(type));
                 }
             }
             else if (str4 == "AccountTime")
             {
                 s = s + "{";
                 BalanceDrawRequestQuery entity = new BalanceDrawRequestQuery {
                     RequestTime = "",
                     CheckTime = "",
                     StoreName = "",
                     PageIndex = 1,
                     PageSize = 1,
                     SortOrder = SortAction.Desc,
                     SortBy = "RequestTime",
                     RequestEndTime = "",
                     RequestStartTime = "",
                     IsCheck = "1",
                     UserId = context.Request.Form["UserID"]
                 };
                 Globals.EntityCoding(entity, true);
                 DataTable data = (DataTable) DistributorsBrower.GetBalanceDrawRequest(entity).Data;
                 if (data.Rows.Count > 0)
                 {
                     if (data.Rows[0]["MerchantCode"].ToString().Trim() != context.Request.Form["merchantcode"].Trim())
                     {
                         s = s + "\"Time\":\"" + data.Rows[0]["RequestTime"].ToString() + "\"";
                     }
                     else
                     {
                         s = s + "\"Time\":\"\"";
                     }
                 }
                 else
                 {
                     s = s + "\"Time\":\"\"";
                 }
                 s = s + "}";
             }
         }
         else
         {
             s = JsonConvert.SerializeObject(VShopHelper.Gettopics());
         }
     }
     context.Response.Write(s);
 }