Exemplo n.º 1
0
        protected override void AttachChildControls()
        {
            CommissionsQuery query;
            this.vshopcommssion = (VshopTemplatedRepeater)this.FindControl("vshopcommssion");
            //query = new CommissionsQuery {
            //    StartTime = query.EndTime = "",
            //    PageIndex = 1,
            //    PageSize = 0x186a0,
            //    UserId = MemberProcessor.GetCurrentMember().UserId
            //};

            query = new CommissionsQuery();

            query.StartTime = query.EndTime = "";
            query.PageIndex = 1;
            query.PageSize = 0x186a0;
            query.UserId = MemberProcessor.GetCurrentMember().UserId;

            DbQueryResult commissions = DistributorsBrower.GetCommissions(query);
            if (commissions.TotalRecords > 0)
            {
                this.vshopcommssion.DataSource = commissions.Data;
                this.vshopcommssion.DataBind();
            }
        }
Exemplo n.º 2
0
 private void BindData()
 {
     CommissionsQuery entity = new CommissionsQuery {
         UserId = int.Parse(this.Page.Request.QueryString["UserId"]),
         EndTime = "",
         StartTime = "",
         PageIndex = this.pager.PageIndex,
         PageSize = this.pager.PageSize,
         SortOrder = SortAction.Desc,
         SortBy = "CommId"
     };
     Globals.EntityCoding(entity, true);
     DbQueryResult commissions = VShopHelper.GetCommissions(entity);
     this.reCommissions.DataSource = commissions.Data;
     this.reCommissions.DataBind();
     this.pager.TotalRecords = commissions.TotalRecords;
 }
Exemplo n.º 3
0
 private void BindData()
 {
     CommissionsQuery entity = new CommissionsQuery {
         EndTime = this.EndTime,
         StartTime = this.StartTime,
         StoreName = this.StoreName,
         OrderNum = this.OrderId,
         PageIndex = this.pager.PageIndex,
         PageSize = this.pager.PageSize,
         SortOrder = SortAction.Desc,
         SortBy = "CommId"
     };
     Globals.EntityCoding(entity, true);
     DbQueryResult commissions = VShopHelper.GetCommissions(entity);
     this.reCommissions.DataSource = commissions.Data;
     this.reCommissions.DataBind();
     this.pager.TotalRecords = commissions.TotalRecords;
 }
Exemplo n.º 4
0
 public static DbQueryResult GetCommissions(CommissionsQuery query)
 {
     return new DistributorsDao().GetCommissions(query);
 }
Exemplo n.º 5
0
 public DbQueryResult GetCommissions(CommissionsQuery query)
 {
     StringBuilder builder = new StringBuilder();
     if (query.UserId > 0)
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat("UserId = {0}", query.UserId);
     }
     if (!string.IsNullOrEmpty(query.StoreName))
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat("StoreName LIKE '%{0}%'", DataHelper.CleanSearchString(query.StoreName));
     }
     if (!string.IsNullOrEmpty(query.OrderNum))
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat(" OrderId = {0}", query.OrderNum);
     }
     if (!string.IsNullOrEmpty(query.StartTime.ToString()))
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat(" datediff(dd,'{0}',TradeTime)>=0", query.StartTime);
     }
     if (!string.IsNullOrEmpty(query.EndTime.ToString()))
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat("  datediff(dd,'{0}',TradeTime)<=0", query.EndTime);
     }
     return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_Hishop_CommissionDistributors", "CommId", (builder.Length > 0) ? builder.ToString() : null, "*");
 }