public static decimal ReadCurrentMemberPrice(List <MemberPriceInfo> MemberPriceList, int gradeID, ProductInfo product) { decimal d = (product.MarketPrice * UserGradeBLL.ReadUserGradeCache(gradeID).Discount) / 100M; foreach (MemberPriceInfo info in MemberPriceList) { if ((info.GradeID == gradeID) && (info.ProductID == product.ID)) { d = info.Price; break; } } return(Math.Round(d, 2)); }
public static void UserLoginInit(UserInfo user) { int iD = UserGradeBLL.ReadUserGradeByMoney(user.MoneyUsed).ID; string str = FormsAuthentication.HashPasswordForStoringInConfigFile(user.ID.ToString() + HttpContext.Current.Server.UrlEncode(user.UserName) + user.MoneyUsed.ToString() + iD.ToString() + user.Mobile + user.GroupID.ToString() + user.CompanyID.ToString() + HttpContext.Current.Server.UrlEncode(user.RealName) + ShopConfig.ReadConfigInfo().SecureKey + ClientHelper.Agent, "MD5"); string str2 = string.Concat(new object[] { str, "|", user.ID.ToString(), "|", HttpContext.Current.Server.UrlEncode(user.UserName), "|", user.MoneyUsed, "|", iD, "|", user.Mobile, "|", user.GroupID, "|", user.CompanyID, "|", HttpContext.Current.Server.UrlEncode(user.RealName) }); CookiesHelper.AddCookie(ShopConfig.ReadConfigInfo().UserCookies, str2); CookiesHelper.AddCookie("UserPhoto", user.Photo); CookiesHelper.AddCookie("UserEmail", user.Email); CookiesHelper.AddCookie("UserWorkingPostId", user.WorkingPostID.ToString()); CookiesHelper.AddCookie("UserStudyPostId", user.StudyPostID.ToString()); CompanyInfo CompanyModel = CompanyBLL.ReadCompany(user.CompanyID); CookiesHelper.AddCookie("UserCompanyType", CompanyModel.GroupId.ToString()); CookiesHelper.AddCookie("UserCompanyPostSetting", CompanyModel.Post); CookiesHelper.AddCookie("UserCompanyBrandID", CompanyModel.BrandId); CookiesHelper.AddCookie("UserCompanySonCompanyID", CompanyBLL.ReadCompanyIdList(user.CompanyID.ToString())); CookiesHelper.AddCookie("UserCompanyParentCompanyID", CompanyBLL.ReadParentCompanyIDWithSelf(user.CompanyID)); CartBLL.CookiesImportDataBase(user.ID, user.UserName); CartBLL.StaticsCart(user.ID, iD); }