public void GetBalance()
 {
     MemberQuery query = new MemberQuery();
     query.Username = searchKey;
     query.Realname = realName;
     query.PageIndex = pager.PageIndex;
     query.PageSize = pager.PageSize;
     DbQueryResult underlingBlanceList = UnderlingHelper.GetUnderlingBlanceList(query);
     grdUnderlingAccountList.DataSource = underlingBlanceList.Data;
     grdUnderlingAccountList.DataBind();
     pager.TotalRecords = underlingBlanceList.TotalRecords;
     pager1.TotalRecords = underlingBlanceList.TotalRecords;
 }
示例#2
0
 protected void InitializeControls()
 {
     int num;
     MemberQuery query = new MemberQuery();
     if (this.dropPageSize != null)
     {
         this.dropPageSize.SelectedValue = query.PageSize;
     }
     if (this.dropMemberRank != null)
     {
         this.dropMemberRank.DataBind();
     }
     if ((this.Page.Request.QueryString["rankId"] != null) && int.TryParse(this.Page.Request.QueryString["rankId"], out num))
     {
         this.dropMemberRank.SelectedValue = new int?(num);
     }
 }
示例#3
0
 protected void BindData()
 {
     MemberQuery query = new MemberQuery();
     query.Username = searchKey;
     query.Realname = realName;
     query.GradeId = rankId;
     query.PageIndex = pager.PageIndex;
     query.IsApproved = approved;
     query.SortBy = grdMemberList.SortOrderBy;
     query.PageSize = pager.PageSize;
     if (grdMemberList.SortOrder.ToLower() == "desc")
     {
         query.SortOrder = SortAction.Desc;
     }
     DbQueryResult members = MemberHelper.GetMembers(query);
     grdMemberList.DataSource = members.Data;
     grdMemberList.DataBind();
     pager1.TotalRecords = pager.TotalRecords = members.TotalRecords;
 }
示例#4
0
 protected override void AttachChildControls()
 {
     this.txtSearchText = (TextBox) this.FindControl("txtSearchText");
     this.btnSearchButton = ButtonManager.Create(this.FindControl("btnSearchButton"));
     this.grdReferralmembers = (Common_Referral_MemberList) this.FindControl("Common_Referral_MemberList");
     this.pager = (Pager) this.FindControl("pager");
     this.btnSearchButton.Click += new EventHandler(this.btnSearchButton_Click);
     if (!this.Page.IsPostBack)
     {
         PageTitle.AddSiteNameTitle("用户中心首页", HiContext.Current.Context);
         MemberQuery query = new MemberQuery();
         if (!string.IsNullOrEmpty(this.Page.Request.QueryString["username"]))
         {
             query.Username = this.Page.Server.UrlDecode(this.Page.Request.QueryString["username"]);
         }
         query.PageIndex = this.pager.PageIndex;
         query.PageSize = this.pager.PageSize;
         DbQueryResult myReferralMembers = PersonalHelper.GetMyReferralMembers(query);
         this.grdReferralmembers.DataSource = myReferralMembers.Data;
         this.grdReferralmembers.DataBind();
         this.txtSearchText.Text = query.Username;
         this.pager.TotalRecords = myReferralMembers.TotalRecords;
     }
 }
示例#5
0
 private MemberQuery GetMemberQuery()
 {
     MemberQuery query = new MemberQuery();
     if (!string.IsNullOrEmpty(Page.Request.QueryString["GradeId"]))
     {
         int result = 0;
         if (int.TryParse(Page.Request.QueryString["GradeId"], out result))
         {
             query.GradeId = new int?(result);
         }
     }
     if (!string.IsNullOrEmpty(Page.Request.QueryString["Username"]))
     {
         query.Username = base.Server.UrlDecode(Page.Request.QueryString["Username"]);
     }
     if (!string.IsNullOrEmpty(Page.Request.QueryString["Realname"]))
     {
         query.Realname = base.Server.UrlDecode(Page.Request.QueryString["Realname"]);
     }
     if (!string.IsNullOrEmpty(Page.Request.QueryString["Approved"]))
     {
         query.IsApproved = new bool?(Convert.ToBoolean(Page.Request.QueryString["Approved"]));
     }
     query.PageSize = pager.PageSize;
     query.PageIndex = pager.PageIndex;
     return query;
 }
示例#6
0
 public static DbQueryResult GetMyReferralMembers(MemberQuery query)
 {
     return PersonalProvider.Instance().GetMyReferralMembers(query);
 }
示例#7
0
 public static DataTable GetMembersNopage(MemberQuery query, IList<string> fields)
 {
     return new MemberDao().GetMembersNopage(query, fields);
 }
示例#8
0
 public static DbQueryResult GetMembers(MemberQuery query)
 {
     return new MemberDao().GetMembers(query);
 }
示例#9
0
 public abstract DataTable GetMembersNopage(MemberQuery query, IList<string> fields);
示例#10
0
 public abstract DbQueryResult GetMembers(MemberQuery query);
示例#11
0
 public DbQueryResult GetMembers(MemberQuery query)
 {
     object obj2;
     StringBuilder builder = new StringBuilder();
     if (query.HasVipCard.HasValue)
     {
         if (query.HasVipCard.Value)
         {
             builder.Append("VipCardNumber is not null");
         }
         else
         {
             builder.Append("VipCardNumber is null");
         }
     }
     if (query.GradeId.HasValue)
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat("GradeId = {0}", query.GradeId.Value);
     }
     if (query.IsApproved.HasValue)
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat("IsApproved = '{0}'", query.IsApproved.Value);
     }
     if (!string.IsNullOrEmpty(query.Username))
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat("UserName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Username));
     }
     if (!string.IsNullOrEmpty(query.Realname))
     {
         if (builder.Length > 0)
         {
             builder.AppendFormat(" AND ", new object[0]);
         }
         builder.AppendFormat("RealName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Realname));
     }
     string str = "";
     if (!string.IsNullOrEmpty(query.ClientType))
     {
         string clientType = query.ClientType;
         if (clientType == null)
         {
             goto Label_0533;
         }
         if (!(clientType == "new"))
         {
             if (clientType == "activy")
             {
                 str = "SELECT UserId FROM Hishop_Orders WHERE 1=1";
                 if (query.OrderNumber.HasValue)
                 {
                     obj2 = str;
                     obj2 = string.Concat(new object[] { obj2, " AND datediff(dd,OrderDate,'", query.StartTime.Value.Date, "')<=0" });
                     obj2 = string.Concat(new object[] { obj2, " AND datediff(dd,OrderDate,'", query.EndTime.Value.Date, "')>=0" });
                     str = string.Concat(new object[] { obj2, " GROUP BY UserId HAVING COUNT(*)", query.CharSymbol, query.OrderNumber.Value });
                 }
                 if (query.OrderMoney.HasValue)
                 {
                     obj2 = str;
                     obj2 = string.Concat(new object[] { obj2, " AND datediff(dd,OrderDate,'", query.StartTime.Value.Date, "')<=0" });
                     obj2 = string.Concat(new object[] { obj2, " AND datediff(dd,OrderDate,'", query.EndTime.Value.Date, "')>=0" });
                     str = string.Concat(new object[] { obj2, " GROUP BY UserId HAVING SUM(OrderTotal)", query.CharSymbol, query.OrderMoney.Value });
                 }
                 if (builder.Length > 0)
                 {
                     builder.AppendFormat(" AND ", new object[0]);
                 }
                 builder.AppendFormat("UserId IN (" + str + ")", new object[0]);
                 goto Label_0621;
             }
             goto Label_0533;
         }
         str = "SElECT UserId FROM aspnet_Members WHERE 1=1";
         if (query.StartTime.HasValue)
         {
             obj2 = str;
             str = string.Concat(new object[] { obj2, " AND datediff(dd,CreateDate,'", query.StartTime.Value.Date, "')<=0" });
         }
         if (query.EndTime.HasValue)
         {
             obj2 = str;
             str = string.Concat(new object[] { obj2, " AND datediff(dd,CreateDate,'", query.EndTime.Value.Date, "')>=0" });
         }
         if (builder.Length > 0)
         {
             builder.AppendFormat(" AND ", new object[0]);
         }
         builder.Append("UserId IN (" + str + ")");
     }
     goto Label_0621;
     Label_0533:
     str = "SELECT UserId FROM Hishop_Orders WHERE 1=1";
     obj2 = str;
     obj2 = string.Concat(new object[] { obj2, " AND datediff(dd,OrderDate,'", query.StartTime.Value.Date, "')<=0" });
     str = string.Concat(new object[] { obj2, " AND datediff(dd,OrderDate,'", query.EndTime.Value.Date, "')>=0" }) + " GROUP BY UserId";
     if (builder.Length > 0)
     {
         builder.AppendFormat(" AND ", new object[0]);
     }
     builder.AppendFormat("UserId NOT IN (" + str + ")", new object[0]);
     Label_0621:
     return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "aspnet_Members m", "UserId", (builder.Length > 0) ? builder.ToString() : null, "*, (SELECT Name FROM aspnet_MemberGrades WHERE GradeId = m.GradeId) AS GradeName");
 }
示例#12
0
 public static DataTable GetMembersNopage(MemberQuery query, IList<string> fields)
 {
     return UnderlingProvider.Instance().GetMembersNopage(query, fields);
 }
示例#13
0
 protected void BindClientList()
 {
     MemberQuery query = new MemberQuery {
         Username = this.searchKey,
         Realname = this.realName,
         GradeId = this.rankId,
         PageIndex = this.pager.PageIndex,
         IsApproved = this.approved,
         SortBy = this.grdMemberList.SortOrderBy,
         PageSize = this.pager.PageSize
     };
     if (this.grdMemberList.SortOrder.ToLower() == "desc")
     {
         query.SortOrder = SortAction.Desc;
     }
     DbQueryResult members = MemberHelper.GetMembers(this.SetClient(query));
     this.grdMemberList.DataSource = members.Data;
     this.grdMemberList.DataBind();
     this.pager1.TotalRecords = this.pager.TotalRecords = members.TotalRecords;
 }
示例#14
0
 public static DbQueryResult GetMembers(MemberQuery query)
 {
     return MemberProvider.Instance().GetMembers(query);
 }
示例#15
0
 public abstract DbQueryResult GetUnderlingBlanceList(MemberQuery query);
示例#16
0
 public override DbQueryResult GetMyReferralMembers(MemberQuery query)
 {
     StringBuilder builder = new StringBuilder();
     builder.AppendFormat("ParentUserId={0} AND ReferralUserId = {1}", HiContext.Current.SiteSettings.UserId.Value, HiContext.Current.User.UserId);
     if (query.GradeId.HasValue)
     {
         builder.AppendFormat(" AND GradeId = {0}", query.GradeId.Value);
     }
     if (!string.IsNullOrEmpty(query.Username))
     {
         builder.AppendFormat(" AND UserName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Username));
     }
     return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_distro_Members", "UserId", (builder.Length > 0) ? builder.ToString() : null, "*");
 }
示例#17
0
 public override DbQueryResult GetUnderlingBlanceList(MemberQuery query)
 {
     if (null == query)
     {
         return new DbQueryResult();
     }
     DbQueryResult result = new DbQueryResult();
     StringBuilder builder = new StringBuilder();
     string str = string.Format(" AND ParentUserId={0}", HiContext.Current.User.UserId);
     if (!string.IsNullOrEmpty(query.Username))
     {
         str = str + string.Format(" AND UserName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Username));
     }
     if (!string.IsNullOrEmpty(query.Realname))
     {
         str = str + string.Format(" AND RealName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Realname));
     }
     builder.AppendFormat("SELECT TOP {0} * FROM vw_distro_Members WHERE 0=0", query.PageSize);
     if (query.PageIndex == 1)
     {
         builder.AppendFormat(" {0} ORDER BY CreateDate DESC", str);
     }
     else
     {
         builder.AppendFormat(" AND CreateDate < (select min(CreateDate) FROM (SELECT TOP {0} CreateDate FROM vw_distro_Members WHERE 0=0 {1} ORDER BY CreateDate DESC ) AS tbltemp) {1} ORDER BY CreateDate DESC", (query.PageIndex - 1) * query.PageSize, str);
     }
     if (query.IsCount)
     {
         builder.AppendFormat(";SELECT COUNT(CreateDate) AS Total FROM vw_distro_Members WHERE 0=0 {0}", str);
     }
     DbCommand sqlStringCommand = database.GetSqlStringCommand(builder.ToString());
     using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
     {
         result.Data = DataHelper.ConverDataReaderToDataTable(reader);
         if (query.IsCount && reader.NextResult())
         {
             reader.Read();
             result.TotalRecords = reader.GetInt32(0);
         }
     }
     return result;
 }
示例#18
0
 public override DataTable GetMembersNopage(MemberQuery query, IList<string> fields)
 {
     if (fields.Count == 0)
     {
         return null;
     }
     DataTable table = null;
     string str = string.Empty;
     foreach (string str2 in fields)
     {
         str = str + str2 + ",";
     }
     str = str.Substring(0, str.Length - 1);
     StringBuilder builder = new StringBuilder();
     builder.AppendFormat("SELECT {0} FROM vw_distro_Members WHERE ParentUserId={1} ", str, HiContext.Current.User.UserId);
     if (!string.IsNullOrEmpty(query.Username))
     {
         builder.AppendFormat(" AND UserName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Username));
     }
     if (!string.IsNullOrEmpty(query.Realname))
     {
         builder.AppendFormat(" AND RealName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Realname));
     }
     if (query.GradeId.HasValue)
     {
         builder.AppendFormat(" AND GradeId={0}", query.GradeId);
     }
     DbCommand sqlStringCommand = database.GetSqlStringCommand(builder.ToString());
     using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
     {
         table = DataHelper.ConverDataReaderToDataTable(reader);
         reader.Close();
     }
     return table;
 }
示例#19
0
 private void btnExport_Click(object sender, EventArgs e)
 {
     if (exportFieldsCheckBoxList.SelectedItem == null)
     {
         ShowMsg("请选择需要导出的会员信息", false);
     }
     else
     {
         IList<string> fields = new List<string>();
         IList<string> list2 = new List<string>();
         foreach (ListItem item in exportFieldsCheckBoxList.Items)
         {
             if (item.Selected)
             {
                 fields.Add(item.Value);
                 list2.Add(item.Text);
             }
         }
         MemberQuery query = new MemberQuery();
         query.Username = txtUsername.Text.Trim();
         query.Realname = txtRealName.Text.Trim();
         query.GradeId = dropMemberGrade.SelectedValue;
         DataTable membersNopage = UnderlingHelper.GetMembersNopage(query, fields);
         StringBuilder builder = new StringBuilder();
         foreach (string str in list2)
         {
             builder.Append(str + ",");
             if (str == list2[list2.Count - 1])
             {
                 builder = builder.Remove(builder.Length - 1, 1);
                 builder.Append("\r\n");
             }
         }
         foreach (DataRow row in membersNopage.Rows)
         {
             foreach (string str2 in fields)
             {
                 builder.Append(row[str2]).Append(",");
                 if (str2 == fields[list2.Count - 1])
                 {
                     builder = builder.Remove(builder.Length - 1, 1);
                     builder.Append("\r\n");
                 }
             }
         }
         Page.Response.Clear();
         Page.Response.Buffer = false;
         Page.Response.Charset = "GB2312";
         if (exportFormatRadioButtonList.SelectedValue == "csv")
         {
             Page.Response.AppendHeader("Content-Disposition", "attachment;filename=MemberInfo.csv");
             Page.Response.ContentType = "application/octet-stream";
         }
         else
         {
             Page.Response.AppendHeader("Content-Disposition", "attachment;filename=MemberInfo.txt");
             Page.Response.ContentType = "application/vnd.ms-word";
         }
         Page.Response.ContentEncoding = Encoding.GetEncoding("GB2312");
         Page.EnableViewState = false;
         Page.Response.Write(builder.ToString());
         Page.Response.End();
     }
 }
示例#20
0
 public override DbQueryResult GetMembers(MemberQuery query)
 {
     StringBuilder builder = new StringBuilder();
     if (query.GradeId.HasValue)
     {
         builder.AppendFormat("GradeId = {0}", query.GradeId.Value);
     }
     if (query.IsApproved.HasValue)
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat("IsApproved = '{0}'", query.IsApproved.Value);
     }
     if (!string.IsNullOrEmpty(query.Username))
     {
         if (builder.Length > 0)
         {
             builder.Append(" AND ");
         }
         builder.AppendFormat("UserName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Username));
     }
     if (!string.IsNullOrEmpty(query.Realname))
     {
         if (builder.Length > 0)
         {
             builder.AppendFormat("AND", new object[0]);
         }
         builder.AppendFormat("RealName LIKE '%{0}%'", DataHelper.CleanSearchString(query.Realname));
     }
     return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_aspnet_Members", "UserId", (builder.Length > 0) ? builder.ToString() : null, "*");
 }
示例#21
0
 public DataTable GetMembersNopage(MemberQuery query, IList<string> fields)
 {
     if (fields.Count == 0)
     {
         return null;
     }
     DataTable table = null;
     string str = string.Empty;
     foreach (string str2 in fields)
     {
         str = str + str2 + ",";
     }
     str = str.Substring(0, str.Length - 1);
     StringBuilder builder = new StringBuilder();
     builder.AppendFormat("SELECT {0} FROM aspnet_Members WHERE 1=1 ", str);
     if (!string.IsNullOrEmpty(query.Username))
     {
         builder.AppendFormat(" AND UserName LIKE '%{0}%'", query.Username);
     }
     if (query.GradeId.HasValue)
     {
         builder.AppendFormat(" AND GradeId={0}", query.GradeId);
     }
     if (query.HasVipCard.HasValue)
     {
         if (query.HasVipCard.Value)
         {
             builder.Append(" AND VipCardNumber is not null");
         }
         else
         {
             builder.Append(" AND VipCardNumber is null");
         }
     }
     if (!string.IsNullOrEmpty(query.Realname))
     {
         builder.AppendFormat(" AND Realname LIKE '%{0}%'", query.Realname);
     }
     DbCommand sqlStringCommand = this.database.GetSqlStringCommand(builder.ToString());
     using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
     {
         table = DataHelper.ConverDataReaderToDataTable(reader);
         reader.Close();
     }
     return table;
 }
示例#22
0
 protected MemberQuery SetClient(MemberQuery query)
 {
     Dictionary<int, MemberClientSet> memberClientSet;
     int[] numArray;
     MemberClientSet set;
     if (!string.IsNullOrEmpty(base.Request.QueryString["type"]))
     {
         memberClientSet = MemberHelper.GetMemberClientSet();
         numArray = new int[memberClientSet.Count];
         memberClientSet.Keys.CopyTo(numArray, 0);
         if (memberClientSet.Count <= 0)
         {
             return query;
         }
         set = new MemberClientSet();
         string str = base.Request.QueryString["type"];
         query.ClientType = str;
         string str2 = str;
         if (str2 == null)
         {
             goto Label_01AC;
         }
         if (!(str2 == "new"))
         {
             if (str2 == "activy")
             {
                 set = memberClientSet[numArray[1]];
                 this.litType.Text = "活跃客户";
                 if (set.ClientValue > 0M)
                 {
                     query.StartTime = new DateTime?(DateTime.Now.AddDays((double) -set.LastDay));
                     query.EndTime = new DateTime?(DateTime.Now);
                     query.CharSymbol = set.ClientChar;
                     if (set.ClientTypeId == 6)
                     {
                         query.OrderNumber = new int?((int) set.ClientValue);
                         return query;
                     }
                     query.OrderMoney = new decimal?(set.ClientValue);
                 }
                 return query;
             }
             goto Label_01AC;
         }
         set = memberClientSet[numArray[0]];
         this.litType.Text = "新客户";
         query.StartTime = set.StartTime;
         query.EndTime = set.EndTime;
         if (set.LastDay > 0)
         {
             query.StartTime = new DateTime?(DateTime.Now.AddDays((double) -set.LastDay));
             query.EndTime = new DateTime?(DateTime.Now);
         }
     }
     return query;
     Label_01AC:
     set = memberClientSet[numArray[2]];
     this.litType.Text = "睡眠客户";
     query.StartTime = new DateTime?(DateTime.Now.AddDays((double) -set.LastDay));
     query.EndTime = new DateTime?(DateTime.Now);
     return query;
 }
示例#23
0
 public abstract DbQueryResult GetMemberBlanceList(MemberQuery query);
示例#24
0
 public static DbQueryResult GetUnderlingBlanceList(MemberQuery query)
 {
     return UnderlingProvider.Instance().GetUnderlingBlanceList(query);
 }
示例#25
0
 protected void BindData()
 {
     MemberQuery query = new MemberQuery {
         Username = this.searchKey,
         Realname = this.realName,
         GradeId = this.rankId,
         PageIndex = this.pager.PageIndex,
         IsApproved = this.approved,
         SortBy = this.grdMemberList.SortOrderBy,
         PageSize = this.pager.PageSize
     };
     if (this.grdMemberList.SortOrder.ToLower() == "desc")
     {
         query.SortOrder = SortAction.Desc;
     }
     if (this.vipCard.HasValue && (this.vipCard.Value != 0))
     {
         query.HasVipCard = new bool?(this.vipCard.Value == 1);
     }
     DbQueryResult members = MemberHelper.GetMembers(query);
     this.grdMemberList.DataSource = members.Data;
     this.grdMemberList.DataBind();
     this.pager1.TotalRecords = this.pager.TotalRecords = members.TotalRecords;
 }