protected string ReadUserEmail(string strUserGrade) { string str = string.Empty; Dictionary <decimal, decimal> moneyUsed = new Dictionary <decimal, decimal>(); foreach (string str2 in strUserGrade.Split(new char[] { ',' })) { UserGradeInfo info = UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(str2)); moneyUsed.Add(info.MinMoney, info.MaxMoney); } List <string> list = UserBLL.ReadUserEmailByMoneyUsed(moneyUsed); foreach (string str2 in list) { if (str == string.Empty) { str = str2; } else { str = str + "," + str2; } } return(str); }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); user = UserBLL.ReadUserMore(base.UserId); userGradeName = UserGradeBLL.Read(base.GradeID).Name; int currentPage = RequestHelper.GetQueryString <int>("Page"); if (currentPage < 1) { currentPage = 1; } int pageSize = 20; int count = 0; productReplyList = ProductReplyBLL.ReadProductReplyList(currentPage, pageSize, ref count, base.UserId); commonPagerClass.CurrentPage = currentPage; commonPagerClass.PageSize = pageSize; commonPagerClass.Count = count; commonPagerClass.FirstPage = "<<首页"; commonPagerClass.PreviewPage = "<<上一页"; commonPagerClass.NextPage = "下一页>>"; commonPagerClass.LastPage = "末页>>"; commonPagerClass.ListType = false; commonPagerClass.DisCount = false; commonPagerClass.PrenextType = true; }
protected void SubmitButton_Click(object sender, EventArgs e) { UserGradeInfo userGrade = new UserGradeInfo(); userGrade.ID = RequestHelper.GetQueryString <int>("ID"); userGrade.Name = this.Name.Text; userGrade.MinMoney = Convert.ToDecimal(this.MinMoney.Text); userGrade.MaxMoney = Convert.ToDecimal(this.MaxMoney.Text); userGrade.Discount = Convert.ToDecimal(this.Discount.Text); string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (userGrade.ID == -2147483648) { base.CheckAdminPower("AddUserGrade", PowerCheckType.Single); int id = UserGradeBLL.AddUserGrade(userGrade); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("UserGrade"), id); } else { base.CheckAdminPower("UpdateUserGrade", PowerCheckType.Single); UserGradeBLL.UpdateUserGrade(userGrade); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("UserGrade"), userGrade.ID); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl); }
protected override void PageLoad() { base.PageLoad(); int queryString = RequestHelper.GetQueryString <int>("ID"); this.favorableActivity = FavorableActivityBLL.ReadFavorableActivity(queryString); if (this.favorableActivity.UserGrade != string.Empty) { foreach (string str in this.favorableActivity.UserGrade.Split(new char[] { ',' })) { if (this.userGrade == string.Empty) { this.userGrade = UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(str)).Name; } else { this.userGrade = this.userGrade + "," + UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(str)).Name; } } } if (this.favorableActivity.GiftID != string.Empty) { GiftSearchInfo gift = new GiftSearchInfo(); gift.InGiftID = this.favorableActivity.GiftID; this.giftList = GiftBLL.SearchGiftList(gift); } base.Title = this.favorableActivity.Name; }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { this.UserGrade.DataSource = UserGradeBLL.ReadUserGradeCacheList(); this.UserGrade.DataTextField = "Name"; this.UserGrade.DataValueField = "ID"; this.UserGrade.DataBind(); this.RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass(); int queryString = RequestHelper.GetQueryString <int>("ID"); if (queryString != -2147483648) { base.CheckAdminPower("ReadFavorableActivity", PowerCheckType.Single); this.favorableActivity = FavorableActivityBLL.ReadFavorableActivity(queryString); this.Photo.Text = this.favorableActivity.Photo; this.Name.Text = this.favorableActivity.Name; this.Content.Text = this.favorableActivity.Content; this.StartDate.Text = this.favorableActivity.StartDate.ToString("yyyy-MM-dd"); this.EndDate.Text = this.favorableActivity.EndDate.ToString("yyyy-MM-dd"); ControlHelper.SetCheckBoxListValue(this.UserGrade, this.favorableActivity.UserGrade); this.OrderProductMoney.Text = this.favorableActivity.OrderProductMoney.ToString(); this.RegionID.ClassIDList = this.favorableActivity.RegionID; this.ReduceMoney.Text = this.favorableActivity.ReduceMoney.ToString(); this.ReduceDiscount.Text = this.favorableActivity.ReduceDiscount.ToString(); if (this.favorableActivity.GiftID != string.Empty) { GiftSearchInfo gift = new GiftSearchInfo(); gift.InGiftID = this.favorableActivity.GiftID; this.giftList = GiftBLL.SearchGiftList(gift); } } } }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); int id = RequestHelper.GetQueryString <int>("ID"); favorableActivity = FavorableActivityBLL.ReadFavorableActivity(id); if (favorableActivity.UserGrade != string.Empty) { foreach (string temp in favorableActivity.UserGrade.Split(',')) { if (userGrade == string.Empty) { userGrade = UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(temp)).Name; } else { userGrade += "," + UserGradeBLL.ReadUserGradeCache(Convert.ToInt32(temp)).Name; } } } if (favorableActivity.GiftID != string.Empty) { GiftSearchInfo giftSearch = new GiftSearchInfo(); giftSearch.InGiftID = favorableActivity.GiftID; giftList = GiftBLL.SearchGiftList(giftSearch); } Title = favorableActivity.Name; }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); user = UserBLL.ReadUserMore(base.UserId); userGradeId = UserGradeBLL.Read(base.GradeID).Id; string action = RequestHelper.GetQueryString <string>("Action"); if (action == "Delete") { string deleteID = RequestHelper.GetQueryString <string>("ID"); ProductCollectBLL.Delete(Array.ConvertAll(deleteID.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), k => Convert.ToInt32(k)), base.UserId); ResponseHelper.Write("ok"); ResponseHelper.End(); } int currentPage = RequestHelper.GetQueryString <int>("Page"); if (currentPage < 1) { currentPage = 1; } int pageSize = 20; int count = 0; productCollectList = ProductCollectBLL.ReadList(currentPage, pageSize, ref count, base.UserId); //commonPagerClass.CurrentPage = currentPage; //commonPagerClass.PageSize = pageSize; //commonPagerClass.Count = count; //commonPagerClass.FirstPage = "<<首页"; //commonPagerClass.PreviewPage = "<<上一页"; //commonPagerClass.NextPage = "下一页>>"; //commonPagerClass.LastPage = "末页>>"; //commonPagerClass.ListType = false; //commonPagerClass.DisCount = false; //commonPagerClass.PrenextType = true; commonPagerClass.Init(currentPage, pageSize, count, !string.IsNullOrEmpty(isMobile)); string strProductID = string.Empty; foreach (ProductCollectInfo productCollect in productCollectList) { if (strProductID == string.Empty) { strProductID = productCollect.ProductId.ToString(); } else { strProductID += "," + productCollect.ProductId.ToString(); } } if (strProductID != string.Empty) { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductId = strProductID; productList = ProductBLL.SearchList(productSearch); } }
/// <summary> /// 拼团活动详情 /// </summary> /// <returns></returns> public ActionResult GroupBuyDetail() { int id = RequestHelper.GetForm <int>("id"); GroupBuyInfo entity = GroupBuyBLL.Read(id); if (entity.Id <= 0) { return(Json(new { ok = false, msg = "拼团商品不存在" })); } var product = ProductBLL.Read(entity.ProductId); if (product.Id <= 0) { return(Json(new { ok = false, msg = "拼团商品不存在" })); } if (product.OpenGroup != 1) { return(Json(new { ok = false, msg = "此商品暂不支持拼团" })); } //拼团状态 entity.VirtualStatus = (entity.EndTime <DateTime.Now && entity.Quantity> entity.SignCount) ? -1 : (entity.StartTime <= DateTime.Now && entity.EndTime >= DateTime.Now && entity.Quantity > entity.SignCount) ? 0 : (entity.StartTime <= DateTime.Now && entity.EndTime >= DateTime.Now && entity.Quantity <= entity.SignCount) ? 1 : -1; //除团长以外其他参与者 List <GroupSignInfo> signList = GroupSignBLL.ReadListByGroupId(id).Where(k => k.UserId != entity.Leader).ToList(); #region 推荐商品 int userGrade = UserGradeBLL.ReadByMoney(0).Id; int uid = RequestHelper.GetForm <int>("uid"); var user = UserBLL.ReadUserMore(uid); if (user != null && user.Id > 0) { userGrade = UserGradeBLL.ReadByMoney(user.MoneyUsed).Id; } int hotCount = 0; var prorecommend = ProductBLL.SearchList(1, 4, new ProductSearchInfo { IsSale = (int)BoolType.True, IsTop = (int)BoolType.True, IsDelete = (int)BoolType.False, NotInProductId = product.Id.ToString() }, ref hotCount); var prorelist = new List <ProductVirtualModel>(); foreach (var item in prorecommend) { var vp = new ProductVirtualModel() { id = item.Id, name = item.Name, img = ShopCommon.ShowImage(item.Photo.Replace("Original", "150-150")), imgbig = ShopCommon.ShowImage(item.Photo.Replace("Original", "350-350")), imgorg = ShopCommon.ShowImage(item.Photo), price = ProductBLL.GetCurrentPrice(item.SalePrice, userGrade), click = item.ViewCount, like = item.LikeNum, totalstore = item.StandardType == (int)ProductStandardType.Single ? ProductTypeStandardRecordBLL.GetSumStorageByProduct(item.Id) : item.TotalStorageCount, //ordercount = item.OrderCount //是否启用不限库存,分别计算销量 ordercount = item.UnlimitedStorage == 1 ? OrderBLL.GetProductOrderCountDaily(item.Id, item.StandardType, DateTime.Now) : item.OrderCount }; prorelist.Add(vp); } #endregion return(Json(new { ok = true, entity = entity, product = product, signlist = signList, topproductlist = prorelist })); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadUserGrade", PowerCheckType.Single); base.BindControl(UserGradeBLL.ReadUserGradeCacheList(), this.RecordList); } }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); user = UserBLL.Read(base.UserId); userGradeName = UserGradeBLL.Read(base.GradeID).Name; singleUnlimitClass.DataSource = RegionBLL.ReadRegionUnlimitClass(); singleUnlimitClass.ClassID = user.RegionId; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadUserGrade", PowerCheckType.Single); BindControl(UserGradeBLL.ReadList(), RecordList); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ProductBatchEdit", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); string queryString = RequestHelper.GetQueryString <string>("Action"); if (queryString != null) { if (!(queryString == "UnionEdit")) { if (queryString == "search") { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassID = RequestHelper.GetQueryString <string>("ClassID"); productSearch.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); productSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); this.Name.Text = RequestHelper.GetQueryString <string>("Name"); this.StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); this.EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); base.BindControl(ProductBLL.SearchProductList(productSearch), this.RecordList); } } else { this.UnionEdit(); } } this.userGradeList = UserGradeBLL.ReadUserGradeCacheList(); foreach (UserGradeInfo info3 in this.userGradeList) { if (this.userGradeIDList == string.Empty) { this.userGradeIDList = info3.ID.ToString(); this.userGradeNameList = info3.Name; } else { this.userGradeIDList = this.userGradeIDList + "," + info3.ID.ToString(); this.userGradeNameList = this.userGradeNameList + "," + info3.Name; } } } }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); int id = RequestHelper.GetQueryString <int>("ID"); userMessage = UserMessageBLL.Read(id, base.UserId); user = UserBLL.ReadUserMore(base.UserId); userGradeName = UserGradeBLL.Read(base.GradeID).Name; }
protected void DeleteButton_Click(object sender, EventArgs e) { CheckAdminPower("DeleteUserGrade", PowerCheckType.Single); string[] ids = RequestHelper.GetIntsForm("SelectID").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (ids.Length > 0) { UserGradeBLL.Delete(Array.ConvertAll <string, int>(ids, k => Convert.ToInt32(k))); AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("UserGrade"), string.Join(",", ids)); ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl); } }
protected bool isPL = true; //是否已评论 /// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); user = UserBLL.ReadUserMore(base.UserId); userGradeName = UserGradeBLL.Read(base.GradeID).Name; int orderID = RequestHelper.GetQueryString <int>("ID"); order = OrderBLL.Read(orderID, base.UserId); if (order.OrderStatus != (int)OrderStatus.ReceiveShipping) { ScriptHelper.AlertFront("只能评论已收货订单"); } orderDetailList = OrderDetailBLL.ReadList(orderID); #region 加载订单下产品 string strProductID = string.Empty; foreach (OrderDetailInfo orderDetail in orderDetailList) { if (strProductID == string.Empty) { strProductID = orderDetail.ProductId.ToString(); } else { strProductID += "," + orderDetail.ProductId.ToString(); } } if (strProductID != string.Empty) { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductId = strProductID; productList = ProductBLL.SearchList(productSearch); } #endregion #region 判断是否已评论 List <ProductCommentInfo>[] listPinfoArr = new List <ProductCommentInfo> [productList.Count]; int pi = 0; foreach (ProductInfo item in productList) { ProductCommentSearchInfo psi = new ProductCommentSearchInfo(); psi.ProductId = item.Id; psi.UserId = base.UserId; psi.OrderID = orderID; listPinfoArr[pi] = ProductCommentBLL.SearchProductCommentList(psi); if (listPinfoArr[pi].Count <= 0) { isPL = false; } } #endregion if (isPL) { Response.Redirect("/User/OrderDetail.html?ID=" + orderID); } }
protected void DeleteButton_Click(object sender, EventArgs e) { base.CheckAdminPower("DeleteUserGrade", PowerCheckType.Single); string intsForm = RequestHelper.GetIntsForm("SelectID"); if (intsForm != string.Empty) { UserGradeBLL.DeleteUserGrade(intsForm); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("UserGrade"), intsForm); ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl); } }
protected override void PageLoad() { base.PageLoad(); this.user = UserBLL.ReadUserMore(base.UserID); this.userGradeName = UserGradeBLL.ReadUserGradeCache(base.GradeID).Name; this.dt = UserBLL.UserIndexStatistics(base.UserID); OrderSearchInfo order = new OrderSearchInfo(); order.UserID = base.UserID; int count = -2147483648; this.orderList = OrderBLL.SearchOrderList(1, 10, order, ref count); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { this.UserGrade.DataSource = UserGradeBLL.ReadUserGradeCacheList(); this.UserGrade.DataValueField = "ID"; this.UserGrade.DataTextField = "Name"; this.UserGrade.DataBind(); this.Key.DataSource = EmailContentHelper.ReadCommonEmailContentList(); this.Key.DataTextField = "EmailTitle"; this.Key.DataValueField = "Key"; this.Key.DataBind(); } }
protected bool isPL = true;//是否已评论 protected override void PageLoad() { base.PageLoad(); //检查用户的待付款订单是否超时失效,超时则更新为失效状态 OrderBLL.CheckOrderPayTime(base.UserId); int orderId = RequestHelper.GetQueryString <int>("id"); userGradeName = UserGradeBLL.Read(base.GradeID).Name; order = OrderBLL.Read(orderId, base.UserId); if (order.Id <= 0) { ScriptHelper.AlertFront("订单不存在", "/user/index.html"); } //礼品 if (order.GiftId > 0) { gift = FavorableActivityGiftBLL.Read(order.GiftId); } orderDetailList = OrderDetailBLL.ReadList(orderId); int[] productIds = orderDetailList.Select(k => k.ProductId).ToArray(); if (productIds.Length > 0) { int count = 0; productList = ProductBLL.SearchList(1, productIds.Length, new ProductSearchInfo { InProductId = string.Join(",", productIds) }, ref count); } #region 判断是否已评论 List <ProductCommentInfo>[] listPinfoArr = new List <ProductCommentInfo> [productList.Count]; int pi = 0; foreach (ProductInfo item in productList) { ProductCommentSearchInfo psi = new ProductCommentSearchInfo(); psi.ProductId = item.Id; psi.UserId = base.UserId; psi.OrderID = orderId; listPinfoArr[pi] = ProductCommentBLL.SearchProductCommentList(psi); if (listPinfoArr[pi].Count <= 0) { isPL = false; } } #endregion Title = "我的订单"; }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); user = UserBLL.ReadUserMore(base.UserID); userGradeName = UserGradeBLL.ReadUserGradeCache(base.GradeID).Name; int id = RequestHelper.GetQueryString <int>("ID"); receiveMessage = ReceiveMessageBLL.ReadReceiveMessage(id, base.UserID); if (receiveMessage.ID > 0 && receiveMessage.IsRead == (int)BoolType.False) { receiveMessage.IsRead = (int)BoolType.True; ReceiveMessageBLL.UpdateReceiveMessage(receiveMessage); } }
public UserController() { uid = RequestHelper.GetForm <int>("uid"); if (uid <= 0) { uid = RequestHelper.GetQueryString <int>("uid"); } user = UserBLL.ReadUserMore(uid); if (user != null && user.Id > 0) { userGradeInfo = UserGradeBLL.ReadByMoney(user.MoneyUsed); userGrade = userGradeInfo.Id; } }
protected void Page_Load(object sender, EventArgs e) { if (companyID < 0) { companyID = CompanyBLL.SystemCompanyId; } if (!this.Page.IsPostBack) { this.BindClassBrandAttributeClassStandardType(); this.ProductClass.DataSource = ProductClassBLL.ReadProductClassUnlimitClass(); this.productID = RequestHelper.GetQueryString <int>("ID"); if (this.productID != -2147483648) { base.CheckAdminPower("ReadProduct", PowerCheckType.Single); ProductInfo product = ProductBLL.ReadProduct(this.productID); companyID = product.CompanyID; companyName = CompanyBLL.ReadCompany(product.CompanyID).CompanyName; this.Name.Text = product.Name; this.Name.Attributes.Add("style", "color:" + product.Color); this.color = product.Color; //this.FontStyle.Text = product.FontStyle; this.ProductNumber.Text = product.ProductNumber; this.ProductClass.ClassIDList = product.ClassID; this.Keywords.Text = product.Keywords; brandIDStr = product.BrandID; this.MarketPrice.Text = product.MarketPrice.ToString(); this.Photo.Text = product.Photo; this.Summary.Text = product.Summary; this.Introduction.Value = product.Introduction; this.IsSpecial.Text = product.IsSpecial.ToString(); this.IsNew.Text = product.IsNew.ToString(); this.IsHot.Text = product.IsHot.ToString(); this.IsSale.Text = product.IsSale.ToString(); this.IsTop.Text = product.IsTop.ToString(); this.Remark.Text = product.Remark; this.AllowComment.Text = product.AllowComment.ToString(); this.AttributeClassID.Text = product.AttributeClassID.ToString(); this.StandardType.Text = product.StandardType.ToString(); this.sendCount = product.SendCount; this.Sort.Text = product.Sort.ToString(); this.Editor.Text = product.Editor; this.BindRelation(product); this.BindTestSetting(product); this.productPhotoList = ProductPhotoBLL.ReadProductPhotoByProduct(this.productID); } this.BindSystemTestSetting(); this.userGradeList = UserGradeBLL.JoinUserGrade(this.productID); } }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); topNav = 12; if (RequestHelper.RawUrl.ToLower().IndexOf("/mobile/") >= 0) { base.CheckUserLogin(1); } else { base.CheckUserLogin(0); } userGradeName = UserGradeBLL.Read(base.GradeID).Name; }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { int queryString = RequestHelper.GetQueryString <int>("ID"); if (queryString != -2147483648) { // base.CheckAdminPower("ReadUserGrade", PowerCheckType.Single); UserGradeInfo info = UserGradeBLL.ReadUserGradeCache(queryString); this.Name.Text = info.Name; this.MinMoney.Text = info.MinMoney.ToString(); this.MaxMoney.Text = info.MaxMoney.ToString(); this.Discount.Text = info.Discount.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int userGradeID = RequestHelper.GetQueryString <int>("ID"); if (userGradeID != int.MinValue) { CheckAdminPower("ReadUserGrade", PowerCheckType.Single); UserGradeInfo userGrade = UserGradeBLL.Read(userGradeID); Name.Text = userGrade.Name; MinMoney.Text = userGrade.MinMoney.ToString(); MaxMoney.Text = userGrade.MaxMoney.ToString(); Discount.Text = userGrade.Discount.ToString(); } } }
public UserController() { uid = RequestHelper.GetForm <int>("uid"); if (uid <= 0) { uid = RequestHelper.GetQueryString <int>("uid"); } user = UserBLL.ReadUserMore(uid); if (user != null && user.Id > 0) { userGradeInfo = UserGradeBLL.ReadByMoney(user.MoneyUsed); userGrade = userGradeInfo.Id; } user.UserName = System.Web.HttpUtility.UrlDecode(user.UserName, System.Text.Encoding.UTF8); //分销商等级标题 user.Distributor_Grade_Title = (DistributorGradeBLL.ReadList().FirstOrDefault(d => user.Total_Commission >= d.Min_Amount && user.Total_Commission < d.Max_Amount) ?? new DistributorGradeInfo()).Title; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { UserGrade.DataSource = UserGradeBLL.ReadList(); UserGrade.DataTextField = "Name"; UserGrade.DataValueField = "Id"; UserGrade.DataBind(); RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass(); ProductClass.DataSource = ProductClassBLL.ReadUnlimitClassList(); favorableActivityID = RequestHelper.GetQueryString <int>("ID"); if (favorableActivityID != int.MinValue) { CheckAdminPower("ReadFavorableActivity", PowerCheckType.Single); favorableActivity = FavorableActivityBLL.Read(favorableActivityID); Photo.Text = favorableActivity.Photo; Name.Text = favorableActivity.Name; Content.Text = favorableActivity.Content; StartDate.Text = favorableActivity.StartDate.ToString("yyyy-MM-dd"); EndDate.Text = favorableActivity.EndDate.ToString("yyyy-MM-dd"); ControlHelper.SetCheckBoxListValue(UserGrade, favorableActivity.UserGrade); OrderProductMoney.Text = favorableActivity.OrderProductMoney.ToString(); RegionID.ClassIDList = favorableActivity.RegionId ?? ""; ReduceMoney.Text = favorableActivity.ReduceMoney.ToString(); ReduceDiscount.Text = favorableActivity.ReduceDiscount.ToString(); favorableType = favorableActivity.Type; ProductClass.ClassIDList = favorableActivity.ClassIds ?? ""; if (!string.IsNullOrEmpty(favorableActivity.GiftId)) { var giftSearch = new FavorableActivityGiftSearchInfo(); giftSearch.InGiftIds = Array.ConvertAll <string, int>(favorableActivity.GiftId.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), k => Convert.ToInt32(k)); giftList = FavorableActivityGiftBLL.SearchList(giftSearch); } } else {//新增:默认所有会员等级全部选中 foreach (ListItem item in UserGrade.Items) { item.Selected = true; } } } }
private void ReadUserCookies() { string userCookies = ShopConfig.ReadConfigInfo().UserCookies; string userCookiesValue = CookiesHelper.ReadCookieValue(userCookies); if (!string.IsNullOrEmpty(userCookiesValue)) { try { string[] strArray = userCookiesValue.Split(new char[] { '|' }); string ciphertext = strArray[0]; string userID = strArray[1]; string userName = strArray[2]; string moneyUsed = strArray[3]; string gradeID = strArray[4]; string mobile = strArray[5]; string groupID = strArray[6]; string companyID = strArray[7]; string realName = strArray[8]; if (FormsAuthentication.HashPasswordForStoringInConfigFile(userID + userName + moneyUsed.ToString() + gradeID.ToString() + mobile + groupID.ToString() + companyID.ToString() + realName + ShopConfig.ReadConfigInfo().SecureKey + ClientHelper.Agent, "MD5").ToLower() == ciphertext.ToLower()) { this.UserID = Convert.ToInt32(userID); this.UserName = HttpContext.Current.Server.UrlDecode(userName); this.MoneyUsed = Convert.ToDecimal(moneyUsed); this.GradeID = Convert.ToInt32(gradeID); this.UserMobile = mobile; this.UserGroupID = Convert.ToInt32(groupID); this.UserCompanyID = Convert.ToInt32(companyID); this.UserRealName = HttpContext.Current.Server.UrlDecode(realName); } else { CookiesHelper.DeleteCookie(userCookies); } } catch { CookiesHelper.DeleteCookie(userCookies); } } if (this.GradeID == 0) { this.GradeID = UserGradeBLL.ReadUserGradeByMoney(0M).ID; } }
/// <summary> /// 检查cookies /// </summary> /// <returns></returns> private void ReadUserCookies() { string cookiesName = ShopConfig.ReadConfigInfo().UserCookies; if (CookiesHelper.ReadCookie(cookiesName) != null) { string cookiesValue = CookiesHelper.ReadCookieValue(cookiesName); if (!string.IsNullOrEmpty(cookiesValue)) { try { string[] strArray = cookiesValue.Split(new char[] { '|' }); string sign = strArray[0]; string userID = strArray[1]; string userName = strArray[2]; string gradeID = strArray[3]; if (FormsAuthentication.HashPasswordForStoringInConfigFile(userID + userName + gradeID.ToString() + ShopConfig.ReadConfigInfo().SecureKey + ClientHelper.Agent, "MD5").ToLower() == sign.ToLower()) { UserId = Convert.ToInt32(userID); UserName = HttpContext.Current.Server.UrlDecode(userName); GradeID = Convert.ToInt32(gradeID); } else { CookiesHelper.DeleteCookie(cookiesName); } } catch { CookiesHelper.DeleteCookie(cookiesName); } } } if (GradeID == 0) { GradeID = UserGradeBLL.ReadByMoney(0).Id; } UserGrade = UserGradeBLL.Read(GradeID).Name; UserGrade = string.IsNullOrEmpty(UserGrade) ? "游客" : UserGrade; }
protected void HanderMemberPrice(int productID) { if (productID > 0) { MemberPriceBLL.DeleteMemberPriceByProductID(productID.ToString()); } List <UserGradeInfo> list = UserGradeBLL.ReadUserGradeCacheList(); decimal form = -1M; foreach (UserGradeInfo info in list) { form = RequestHelper.GetForm <decimal>("MemberPrice" + info.ID); if (form != -1M) { MemberPriceInfo memberPrice = new MemberPriceInfo(); memberPrice.ProductID = productID; memberPrice.GradeID = info.ID; memberPrice.Price = form; MemberPriceBLL.AddMemberPrice(memberPrice); } } }