protected void Button1_Click(object sender, EventArgs e) { MemberInfo currentMember = MemberProcessor.GetCurrentMember(); if (currentMember != null) { if (UserSignHelper.IsSign(currentMember.UserId)) { int num = UserSignHelper.USign(currentMember.UserId, wid); base.Response.Write("增加:" + num + "分"); } else { base.Response.Write("已签到"); } } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("会员中心"); MemberInfo currentMember = MemberProcessor.GetCurrentMember(); if (currentMember == null) { base.GotoResourceNotFound("用户信息获取错误!"); } this.litUserName = (Literal)this.FindControl("litUserName"); this.litPoints = (Literal)this.FindControl("litPoints"); this.litPoints.Text = currentMember.Points.ToString(); this.image = (Image)this.FindControl("image"); this.litBindUser = (Literal)this.FindControl("litBindUser"); this.litExpenditure = (Literal)this.FindControl("litExpenditure"); this.litExpenditure.SetWhenIsNotNull("¥" + currentMember.Expenditure.ToString("F2")); if (!string.IsNullOrEmpty(currentMember.UserBindName)) { this.litBindUser.Text = " style=\"display:none\""; } MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(currentMember.GradeId); this.litrGradeName = (Literal)this.FindControl("litrGradeName"); if (memberGrade != null) { this.litrGradeName.Text = memberGrade.Name; } else { this.litrGradeName.Text = "普通会员"; } this.litUserName.Text = string.IsNullOrEmpty(currentMember.RealName) ? currentMember.UserName : currentMember.RealName; if (!UserSignHelper.IsSign(currentMember.UserId)) { this.IsSign = (HtmlInputHidden)this.FindControl("IsSign"); this.IsSign.Value = "1"; } if (!string.IsNullOrEmpty(currentMember.UserHead)) { this.image.ImageUrl = currentMember.UserHead; } this.txtWaitForstr = (HtmlInputHidden)this.FindControl("txtWaitForstr"); OrderQuery query = new OrderQuery { Status = OrderStatus.WaitBuyerPay }; int userOrderCount = MemberProcessor.GetUserOrderCount(Globals.GetCurrentMemberUserId(), query); query.Status = OrderStatus.SellerAlreadySent; int num2 = MemberProcessor.GetUserOrderCount(Globals.GetCurrentMemberUserId(), query); int userOrderReturnCount = MemberProcessor.GetUserOrderReturnCount(Globals.GetCurrentMemberUserId()); this.txtWaitForstr.Value = userOrderCount.ToString() + "|" + num2.ToString() + "|" + userOrderReturnCount.ToString(); DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(Globals.GetCurrentMemberUserId()); this.txtShowDis = (HtmlInputHidden)this.FindControl("txtShowDis"); if ((userIdDistributors == null) || (userIdDistributors.ReferralStatus != 0)) { this.txtShowDis.Value = "false"; } else { this.txtShowDis.Value = "true"; } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("会员中心"); MemberInfo currentMemberInfo = base.CurrentMemberInfo; if (currentMemberInfo == null) { this.Page.Response.Redirect("/logout.aspx"); } else { int currentMemberUserId = Globals.GetCurrentMemberUserId(); this.UserBindName = (HtmlInputHidden)this.FindControl("UserBindName"); this.UserBindName.Value = currentMemberInfo.UserBindName; this.UpClassInfo = (HtmlContainerControl)this.FindControl("UpClassInfo"); this.litUserName = (Literal)this.FindControl("litUserName"); this.litPoints = (Literal)this.FindControl("litPoints"); this.litPoints.Text = currentMemberInfo.Points.ToString(); this.image = (Image)this.FindControl("image"); this.litBindUser = (Literal)this.FindControl("litBindUser"); this.litExpenditure = (Literal)this.FindControl("litExpenditure"); this.litExpenditure.SetWhenIsNotNull("¥" + currentMemberInfo.Expenditure.ToString("F2")); if (!string.IsNullOrEmpty(currentMemberInfo.UserBindName)) { this.litBindUser.Text = " style=\"display:none\""; } MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(currentMemberInfo.GradeId); this.litrGradeName = (Literal)this.FindControl("litrGradeName"); if (memberGrade != null) { this.litrGradeName.Text = memberGrade.Name; } else { this.litrGradeName.Text = "普通会员"; } this.litUserName.Text = string.IsNullOrEmpty(currentMemberInfo.RealName) ? currentMemberInfo.UserName : currentMemberInfo.RealName; SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); this.IsSign = (HtmlInputHidden)this.FindControl("IsSign"); if (!masterSettings.sign_score_Enable) { this.IsSign.Value = "-1"; } else if (!UserSignHelper.IsSign(currentMemberInfo.UserId)) { this.IsSign.Value = "1"; } if (!string.IsNullOrEmpty(currentMemberInfo.UserHead)) { this.image.ImageUrl = currentMemberInfo.UserHead; } this.txtWaitForstr = (HtmlInputHidden)this.FindControl("txtWaitForstr"); OrderQuery query = new OrderQuery { Status = OrderStatus.WaitBuyerPay }; int userOrderCount = MemberProcessor.GetUserOrderCount(currentMemberUserId, query); query.Status = OrderStatus.SellerAlreadySent; int num3 = MemberProcessor.GetUserOrderCount(currentMemberUserId, query); query.Status = OrderStatus.BuyerAlreadyPaid; int num4 = MemberProcessor.GetUserOrderCount(currentMemberUserId, query); int waitCommentByUserID = ProductBrowser.GetWaitCommentByUserID(currentMemberUserId); int userOrderReturnCount = MemberProcessor.GetUserOrderReturnCount(currentMemberUserId); this.txtWaitForstr.Value = userOrderCount.ToString() + "|" + num4.ToString() + "|" + num3.ToString() + "|" + waitCommentByUserID.ToString() + "|" + userOrderReturnCount.ToString(); DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId); this.txtShowDis = (HtmlInputHidden)this.FindControl("txtShowDis"); if ((userIdDistributors == null) || (userIdDistributors.ReferralStatus != 0)) { this.txtShowDis.Value = "false"; } else { this.txtShowDis.Value = "true"; } IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades(); MemberGradeInfo info4 = null; foreach (MemberGradeInfo info5 in memberGrades) { int? nullable3; int? nullable4; double?tranVol = memberGrade.TranVol; double?nullable2 = info5.TranVol; if (((tranVol.GetValueOrDefault() < nullable2.GetValueOrDefault()) || !(tranVol.HasValue & nullable2.HasValue)) || (((nullable3 = memberGrade.TranTimes).GetValueOrDefault() < (nullable4 = info5.TranTimes).GetValueOrDefault()) || !(nullable3.HasValue & nullable4.HasValue))) { tranVol = memberGrade.TranVol; nullable2 = info5.TranVol; if (((tranVol.GetValueOrDefault() < nullable2.GetValueOrDefault()) && (tranVol.HasValue & nullable2.HasValue)) || (((nullable3 = memberGrade.TranTimes).GetValueOrDefault() < (nullable4 = info5.TranTimes).GetValueOrDefault()) && (nullable3.HasValue & nullable4.HasValue))) { if (info4 == null) { info4 = info5; } else { tranVol = info4.TranVol; nullable2 = info5.TranVol; if (((tranVol.GetValueOrDefault() > nullable2.GetValueOrDefault()) && (tranVol.HasValue & nullable2.HasValue)) || (((nullable3 = info4.TranTimes).GetValueOrDefault() > (nullable4 = info5.TranTimes).GetValueOrDefault()) && (nullable3.HasValue & nullable4.HasValue))) { info4 = info5; } } } } } if (info4 == null) { this.UpClassInfo.Visible = false; } else { int num7 = 0; if (info4.TranTimes.HasValue) { num7 = info4.TranTimes.Value - currentMemberInfo.OrderNumber; } if (num7 <= 0) { num7 = 1; } decimal num8 = 0M; if (info4.TranVol.HasValue) { num8 = ((decimal)info4.TranVol.Value) - currentMemberInfo.Expenditure; } if (num8 <= 0M) { num8 = 0.01M; } this.UpClassInfo.InnerHtml = "再交易<span>" + num7.ToString() + "次 </span>或消费<span> " + Math.Round((decimal)(num8 + 0.49M), 0).ToString() + "元 </span>升级"; } } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("会员中心"); MemberInfo currentMemberInfo = this.CurrentMemberInfo; if (currentMemberInfo == null) { this.Page.Response.Redirect("/logout.aspx"); } else { int currentMemberUserId = Globals.GetCurrentMemberUserId(false); this.UserBindName = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("UserBindName"); this.UserBindName.Value = currentMemberInfo.UserBindName; this.UpClassInfo = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("UpClassInfo"); this.litUserName = (System.Web.UI.WebControls.Literal) this.FindControl("litUserName"); this.litPoints = (System.Web.UI.WebControls.Literal) this.FindControl("litPoints"); this.litPoints.Text = currentMemberInfo.Points.ToString(); this.image = (System.Web.UI.WebControls.Image) this.FindControl("image"); this.usePoints = (System.Web.UI.WebControls.Literal) this.FindControl("usePoints"); this.usePoints.Text = currentMemberInfo.Points.ToString(); this.litAmount = (System.Web.UI.WebControls.Literal) this.FindControl("litAmount"); this.litAmount.Text = System.Math.Round(currentMemberInfo.AvailableAmount, 2).ToString(); MemberCouponsSearch memberCouponsSearch = new MemberCouponsSearch(); memberCouponsSearch.CouponName = ""; memberCouponsSearch.Status = "0"; memberCouponsSearch.MemberId = currentMemberUserId; memberCouponsSearch.IsCount = true; memberCouponsSearch.PageIndex = 1; memberCouponsSearch.PageSize = 10; memberCouponsSearch.SortBy = "CouponId"; memberCouponsSearch.SortOrder = SortAction.Desc; int num = 0; DataTable memberCoupons = CouponHelper.GetMemberCoupons(memberCouponsSearch, ref num); this.litCoupon = (System.Web.UI.WebControls.Literal) this.FindControl("litCoupon"); this.litCoupon.Text = num.ToString(); //将coupon改为奶券数量 this.litCoupon.Text = VShopHelper.GetMilkCardCount(currentMemberInfo.UserId).ToString(); this.litBindUser = (System.Web.UI.WebControls.Literal) this.FindControl("litBindUser"); this.litExpenditure = (System.Web.UI.WebControls.Literal) this.FindControl("litExpenditure"); this.litExpenditure.SetWhenIsNotNull("¥" + currentMemberInfo.Expenditure.ToString("F2")); if (!string.IsNullOrEmpty(currentMemberInfo.UserBindName)) { this.litBindUser.Text = " style=\"display:none\""; } MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(currentMemberInfo.GradeId); this.litrGradeName = (System.Web.UI.WebControls.Literal) this.FindControl("litrGradeName"); if (memberGrade != null) { this.litrGradeName.Text = memberGrade.Name; } else { this.litrGradeName.Text = "普通会员"; } this.litUserName.Text = (string.IsNullOrEmpty(currentMemberInfo.OpenId) ? (string.IsNullOrEmpty(currentMemberInfo.RealName) ? currentMemberInfo.UserName : currentMemberInfo.RealName) : currentMemberInfo.UserName); SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); this.fxCenter = (System.Web.UI.WebControls.Literal) this.FindControl("fxCenter"); this.fxCenter.Text = masterSettings.DistributorCenterName; this.IsSign = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("IsSign"); if (!masterSettings.sign_score_Enable) { this.IsSign.Value = "-1"; } else if (!UserSignHelper.IsSign(currentMemberInfo.UserId)) { this.IsSign.Value = "1"; } if (!string.IsNullOrEmpty(currentMemberInfo.UserHead)) { this.image.ImageUrl = currentMemberInfo.UserHead; } this.txtWaitForstr = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtWaitForstr"); OrderQuery orderQuery = new OrderQuery(); orderQuery.Status = OrderStatus.WaitBuyerPay; int userOrderCount = MemberProcessor.GetUserOrderCount(currentMemberUserId, orderQuery); orderQuery.Status = OrderStatus.SellerAlreadySent; int userOrderCount2 = MemberProcessor.GetUserOrderCount(currentMemberUserId, orderQuery); orderQuery.Status = OrderStatus.BuyerAlreadyPaid; int userOrderCount3 = MemberProcessor.GetUserOrderCount(currentMemberUserId, orderQuery); int waitCommentByUserID = ProductBrowser.GetWaitCommentByUserID(currentMemberUserId); int userOrderReturnCount = MemberProcessor.GetUserOrderReturnCount(currentMemberUserId); this.txtWaitForstr.Value = string.Concat(new string[] { userOrderCount.ToString(), "|", userOrderCount3.ToString(), "|", userOrderCount2.ToString(), "|", waitCommentByUserID.ToString(), "|", userOrderReturnCount.ToString() }); DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId); this.txtShowDis = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtShowDis"); if (userIdDistributors == null || userIdDistributors.ReferralStatus != 0) { this.txtShowDis.Value = "false"; } else { this.txtShowDis.Value = "true"; } System.Collections.Generic.IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades(); MemberGradeInfo memberGradeInfo = null; foreach (MemberGradeInfo current in memberGrades) { double?tranVol = memberGrade.TranVol; double?tranVol2 = current.TranVol; if (tranVol.GetValueOrDefault() < tranVol2.GetValueOrDefault() || !(tranVol.HasValue & tranVol2.HasValue) || !(memberGrade.TranTimes >= current.TranTimes)) { tranVol = memberGrade.TranVol; tranVol2 = current.TranVol; if ((tranVol.GetValueOrDefault() < tranVol2.GetValueOrDefault() && (tranVol.HasValue & tranVol2.HasValue)) || memberGrade.TranTimes < current.TranTimes) { if (memberGradeInfo == null) { memberGradeInfo = current; } else { tranVol = memberGradeInfo.TranVol; tranVol2 = current.TranVol; if ((tranVol.GetValueOrDefault() > tranVol2.GetValueOrDefault() && (tranVol.HasValue & tranVol2.HasValue)) || memberGradeInfo.TranTimes > current.TranTimes) { memberGradeInfo = current; } } } } } if (memberGradeInfo == null) { this.UpClassInfo.Visible = false; } else { int num2 = 0; if (memberGradeInfo.TranTimes.HasValue) { num2 = memberGradeInfo.TranTimes.Value - currentMemberInfo.OrderNumber; } if (num2 <= 0) { num2 = 1; } decimal d = 0m; if (memberGradeInfo.TranVol.HasValue) { d = (decimal)memberGradeInfo.TranVol.Value - currentMemberInfo.Expenditure; } if (d <= 0m) { d = 0.01m; } this.UpClassInfo.InnerHtml = string.Concat(new string[] { "再交易<span>", num2.ToString(), "次 </span>或消费<span> ", System.Math.Round(d + 0.49m, 0).ToString(), "元 </span>升级" }); } } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("会员中心"); MemberInfo currentMemberInfo = base.CurrentMemberInfo; if (currentMemberInfo == null) { this.Page.Response.Redirect("/logout.aspx"); } else { int currentMemberUserId = Globals.GetCurrentMemberUserId(false); this.UserBindName = (HtmlInputHidden)this.FindControl("UserBindName"); this.UserBindName.Value = currentMemberInfo.UserBindName; this.UpClassInfo = (HtmlContainerControl)this.FindControl("UpClassInfo"); this.litUserName = (Literal)this.FindControl("litUserName"); this.litPoints = (Literal)this.FindControl("litPoints"); this.litPoints.Text = currentMemberInfo.Points.ToString(); this.image = (Image)this.FindControl("image"); this.usePoints = (Literal)this.FindControl("usePoints"); this.usePoints.Text = currentMemberInfo.Points.ToString(); this.litAmount = (Literal)this.FindControl("litAmount"); this.litAmount.Text = Math.Round(currentMemberInfo.AvailableAmount, 2).ToString(); MemberCouponsSearch search = new MemberCouponsSearch { CouponName = "", Status = "0", MemberId = currentMemberUserId, IsCount = true, PageIndex = 1, PageSize = 10, SortBy = "CouponId", SortOrder = SortAction.Desc }; int total = 0; CouponHelper.GetMemberCoupons(search, ref total); this.litCoupon = (Literal)this.FindControl("litCoupon"); this.litCoupon.Text = total.ToString(); this.litBindUser = (Literal)this.FindControl("litBindUser"); this.litExpenditure = (Literal)this.FindControl("litExpenditure"); this.litExpenditure.SetWhenIsNotNull("¥" + currentMemberInfo.Expenditure.ToString("F2")); if (!string.IsNullOrEmpty(currentMemberInfo.UserBindName)) { this.litBindUser.Text = " style=\"display:none\""; } MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(currentMemberInfo.GradeId); this.litrGradeName = (Literal)this.FindControl("litrGradeName"); if (memberGrade != null) { this.litrGradeName.Text = memberGrade.Name; } else { this.litrGradeName.Text = "普通会员"; } this.litUserName.Text = string.IsNullOrEmpty(currentMemberInfo.OpenId) ? (string.IsNullOrEmpty(currentMemberInfo.RealName) ? currentMemberInfo.UserName : currentMemberInfo.RealName) : currentMemberInfo.UserName; SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); this.fxCenter = (Literal)this.FindControl("fxCenter"); this.fxCenter.Text = masterSettings.DistributorCenterName; this.IsSign = (HtmlInputHidden)this.FindControl("IsSign"); if (!masterSettings.sign_score_Enable) { this.IsSign.Value = "-1"; } else if (!UserSignHelper.IsSign(currentMemberInfo.UserId)) { this.IsSign.Value = "1"; } if (!string.IsNullOrEmpty(currentMemberInfo.UserHead)) { this.image.ImageUrl = currentMemberInfo.UserHead; } this.txtWaitForstr = (HtmlInputHidden)this.FindControl("txtWaitForstr"); OrderQuery query = new OrderQuery { Status = OrderStatus.WaitBuyerPay }; int userOrderCount = MemberProcessor.GetUserOrderCount(currentMemberUserId, query); query.Status = OrderStatus.SellerAlreadySent; int num4 = MemberProcessor.GetUserOrderCount(currentMemberUserId, query); query.Status = OrderStatus.BuyerAlreadyPaid; int num5 = MemberProcessor.GetUserOrderCount(currentMemberUserId, query); int waitCommentByUserID = ProductBrowser.GetWaitCommentByUserID(currentMemberUserId); int userOrderReturnCount = MemberProcessor.GetUserOrderReturnCount(currentMemberUserId); this.txtWaitForstr.Value = userOrderCount.ToString() + "|" + num5.ToString() + "|" + num4.ToString() + "|" + waitCommentByUserID.ToString() + "|" + userOrderReturnCount.ToString(); DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId); this.txtShowDis = (HtmlInputHidden)this.FindControl("txtShowDis"); if ((userIdDistributors == null) || (userIdDistributors.ReferralStatus != 0)) { this.txtShowDis.Value = "false"; } else { this.txtShowDis.Value = "true"; } IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades(); MemberGradeInfo info4 = null; foreach (MemberGradeInfo info5 in memberGrades) { double?tranVol = memberGrade.TranVol; double?nullable2 = info5.TranVol; if ((tranVol.GetValueOrDefault() >= nullable2.GetValueOrDefault()) && (tranVol.HasValue & nullable2.HasValue)) { int?tranTimes = memberGrade.TranTimes; int?nullable4 = info5.TranTimes; if ((tranTimes.GetValueOrDefault() >= nullable4.GetValueOrDefault()) && (tranTimes.HasValue & nullable4.HasValue)) { continue; } } double?nullable5 = memberGrade.TranVol; double?nullable6 = info5.TranVol; if ((nullable5.GetValueOrDefault() >= nullable6.GetValueOrDefault()) || !(nullable5.HasValue & nullable6.HasValue)) { int?nullable7 = memberGrade.TranTimes; int?nullable8 = info5.TranTimes; if ((nullable7.GetValueOrDefault() >= nullable8.GetValueOrDefault()) || !(nullable7.HasValue & nullable8.HasValue)) { continue; } } if (info4 == null) { info4 = info5; } else { double?nullable9 = info4.TranVol; double?nullable10 = info5.TranVol; if ((nullable9.GetValueOrDefault() <= nullable10.GetValueOrDefault()) || !(nullable9.HasValue & nullable10.HasValue)) { int?nullable11 = info4.TranTimes; int?nullable12 = info5.TranTimes; if ((nullable11.GetValueOrDefault() <= nullable12.GetValueOrDefault()) || !(nullable11.HasValue & nullable12.HasValue)) { continue; } } info4 = info5; } } if (info4 == null) { this.UpClassInfo.Visible = false; } else { int num8 = 0; if (info4.TranTimes.HasValue) { num8 = info4.TranTimes.Value - currentMemberInfo.OrderNumber; } if (num8 <= 0) { num8 = 1; } decimal num9 = 0M; if (info4.TranVol.HasValue) { num9 = ((decimal)info4.TranVol.Value) - currentMemberInfo.Expenditure; } if (num9 <= 0M) { num9 = 0.01M; } this.UpClassInfo.InnerHtml = "再交易<span>" + num8.ToString() + "次 </span>或消费<span> " + Math.Round((decimal)(num9 + 0.49M), 0).ToString() + "元 </span>升级"; } } }