Ejemplo n.º 1
0
        public static bool Delete(int userId)
        {
            bool flag = new MemberDao().Delete(userId);

            if (flag)
            {
                HiCache.Remove(string.Format("DataCache-Member-{0}", userId));
            }
            return(flag);
        }
Ejemplo n.º 2
0
 private static System.Data.DataTable GetCategories()
 {
     System.Data.DataTable dataTable = HiCache.Get("DataCache-Categories") as System.Data.DataTable;
     if (null == dataTable)
     {
         dataTable = ProductProvider.Instance().GetCategories();
         HiCache.Insert("DataCache-Categories", dataTable, 360, CacheItemPriority.Normal);
     }
     return(dataTable);
 }
Ejemplo n.º 3
0
        public static bool SetBrandCategoryThemes(int brandid, string themeName)
        {
            bool result;

            if (result = ProductProvider.Instance().SetBrandCategoryThemes(brandid, themeName))
            {
                HiCache.Remove("DataCache-Categories");
            }
            return(result);
        }
Ejemplo n.º 4
0
        public static bool SetBrandCategoryThemes(int brandid, string themeName)
        {
            bool flag = new BrandCategoryDao().SetBrandCategoryThemes(brandid, themeName);

            if (flag)
            {
                HiCache.Remove("DataCache-Categories");
            }
            return(flag);
        }
        public static DataSet GetCategoryList()
        {
            DataSet categoryList = HiCache.Get("DataCache-CategoryList") as DataSet;

            if (categoryList == null)
            {
                categoryList = new CategoryDao().GetCategoryList();
                HiCache.Insert("DataCache-CategoryList", categoryList, 360, CacheItemPriority.Normal);
            }
            return(categoryList);
        }
Ejemplo n.º 6
0
        public static bool Update(MemberInfo member)
        {
            bool flag = new MemberDao().Update(member);

            if (flag)
            {
                HiCache.Remove(string.Format("DataCache-Member-{0}", member.UserId));
                EventLogs.WriteOperationLog(Privilege.EditMember, string.Format(CultureInfo.InvariantCulture, "修改了编号为 “{0}” 的会员", new object[] { member.UserId }));
            }
            return(flag);
        }
Ejemplo n.º 7
0
 public static void UpdateSettings(IList <MessageTemplate> templates, string wid)
 {
     if ((templates != null) && (templates.Count != 0))
     {
         new MessageTemplateHelperDao().UpdateSettings(templates, wid);
         foreach (MessageTemplate template in templates)
         {
             HiCache.Remove(string.Format("Message-{0}", template.MessageType.ToLower()));
         }
     }
 }
Ejemplo n.º 8
0
 public static void UpdateSettings(IList <MessageTemplate> templates)
 {
     if ((templates != null) && (templates.Count != 0))
     {
         MessageTemplateProvider.Instance().UpdateSettings(templates);
         foreach (MessageTemplate template in templates)
         {
             HiCache.Remove(string.Format("Message-{0}", template.MessageType.ToLower()));
         }
     }
 }
Ejemplo n.º 9
0
        public bool AppCheckEmailVerifyCode(string email, string verifyCode)
        {
            string text = HiCache.Get($"DataCache-EmailCode-{email}").ToNullString();

            if (!string.IsNullOrEmpty(text))
            {
                text = HiCryptographer.Decrypt(text);
                return(string.Compare(text, verifyCode, true, CultureInfo.InvariantCulture) == 0);
            }
            return(false);
        }
Ejemplo n.º 10
0
        public static ManagerInfo GetManager(int userId)
        {
            ManagerInfo manager = HiCache.Get(string.Format("DataCache-Manager-{0}", userId)) as ManagerInfo;

            if (manager == null)
            {
                manager = (new MessageDao()).GetManager(userId);
                HiCache.Insert(string.Format("DataCache-Manager-{0}", userId), manager, 360, CacheItemPriority.Normal);
            }
            return(manager);
        }
Ejemplo n.º 11
0
        public static DataTable GetCategoriesRange(ProductInfo.ProductRanage productRange = ProductInfo.ProductRanage.NormalSelect)
        {
            DataTable categories = HiCache.Get("DataCache-CategoriesRange") as DataTable;

            if (categories == null)
            {
                categories = new CategoryDao().GetCategoriesRange(productRange);
                HiCache.Insert("DataCache-CategoriesRange", categories, 360, CacheItemPriority.Normal);
            }
            return(categories);
        }
Ejemplo n.º 12
0
        public static DataTable GetBrandRange(ProductInfo.ProductRanage productRange = ProductInfo.ProductRanage.NormalSelect)
        {
            DataTable Brand = HiCache.Get("DataCache-CategoriesRange") as DataTable;

            if (Brand == null)
            {
                Brand = new CategoryDao().GetBrandRange(productRange);
                HiCache.Insert("DataCache-CategoriesRange", Brand, 360, CacheItemPriority.Normal);
            }
            return(Brand);
        }
Ejemplo n.º 13
0
        public XmlDocument GetXmlNode()
        {
            XmlDocument document = HiCache.Get("TemplateFileCache") as XmlDocument;

            if (document == null)
            {
                document = new XmlDocument();
                document.Load(HttpContext.Current.Request.MapPath(Globals.GetVshopSkinPath(null) + "/template.xml"));
            }
            return(document);
        }
Ejemplo n.º 14
0
        public static void Check(out bool isValid, out bool expired, out int siteQty)
        {
            siteQty = 0;
            isValid = false;
            expired = true;
            HiContext    current        = HiContext.Current;
            XmlDocument  xmlDocument    = HiCache.Get("FileCache_CommercialLicenser") as XmlDocument;
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            if (xmlDocument == null)
            {
                string text = (current.Context != null) ? current.Context.Request.MapPath("~/config/Certificates.cer") : System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "config\\Certificates.cer");
                if (!System.IO.File.Exists(text))
                {
                    return;
                }
                xmlDocument = new XmlDocument();
                xmlDocument.LoadXml(System.IO.File.ReadAllText(text));
                HiCache.Max("FileCache_CommercialLicenser", xmlDocument, new CacheDependency(text));
            }
            XmlNode xmlNode  = xmlDocument.DocumentElement.SelectSingleNode("//Host");
            XmlNode xmlNode2 = xmlDocument.DocumentElement.SelectSingleNode("//LicenseDate");
            XmlNode xmlNode3 = xmlDocument.DocumentElement.SelectSingleNode("//Expires");
            XmlNode xmlNode4 = xmlDocument.DocumentElement.SelectSingleNode("//SiteQty");
            XmlNode xmlNode5 = xmlDocument.DocumentElement.SelectSingleNode("//Signature");
            //if (string.Compare(xmlNode.InnerText, masterSettings.SiteUrl, true, System.Globalization.CultureInfo.InvariantCulture) == 0)
            //{

            //}

            string s = string.Format(System.Globalization.CultureInfo.InvariantCulture, "Host={0}&Expires={1}&SiteQty={2}&LicenseDate={3}", new object[]
            {
                masterSettings.SiteUrl,
                xmlNode3.InnerText,
                xmlNode4.InnerText,
                xmlNode2.InnerText
            });

            using (System.Security.Cryptography.RSACryptoServiceProvider rSACryptoServiceProvider = new System.Security.Cryptography.RSACryptoServiceProvider())
            {
                rSACryptoServiceProvider.FromXmlString(LicenseHelper.GetPublicKey());
                System.Security.Cryptography.RSAPKCS1SignatureDeformatter rSAPKCS1SignatureDeformatter = new System.Security.Cryptography.RSAPKCS1SignatureDeformatter(rSACryptoServiceProvider);
                rSAPKCS1SignatureDeformatter.SetHashAlgorithm("SHA1");
                byte[] rgbSignature = System.Convert.FromBase64String(xmlNode5.InnerText);
                byte[] rgbHash      = new System.Security.Cryptography.SHA1Managed().ComputeHash(System.Text.Encoding.UTF8.GetBytes(s));
                isValid = rSAPKCS1SignatureDeformatter.VerifySignature(rgbHash, rgbSignature);
                isValid = true;
            }
            expired = (System.DateTime.Now > System.DateTime.Parse(xmlNode3.InnerText));
            if (isValid && !expired)
            {
                int.TryParse(xmlNode4.InnerText, out siteQty);
            }
        }
Ejemplo n.º 15
0
        public static DataTable GetCategories()
        {
            DataTable categories = HiCache.Get(string.Format("DataCache-SubsiteCategories{0}", HiContext.Current.User.UserId)) as DataTable;

            if (null == categories)
            {
                categories = SubsiteProductProvider.Instance().GetCategories();
                HiCache.Insert(string.Format("DataCache-SubsiteCategories{0}", HiContext.Current.User.UserId), categories, 360, CacheItemPriority.Normal);
            }
            return(categories);
        }
Ejemplo n.º 16
0
 public static void UpdateAliFuWuSettings(IList <MessageTemplate> templates)
 {
     if ((templates == null ? false : templates.Count != 0))
     {
         (new MessageTemplateHelperDao()).UpdateAliFuWuSettings(templates);
         foreach (MessageTemplate template in templates)
         {
             HiCache.Remove(string.Format("Message-{0}", template.MessageType.ToLower()));
         }
     }
 }
Ejemplo n.º 17
0
 public static void UpdateSettings(IList <MessageTemplate> templates)
 {
     if (templates != null && templates.Count != 0)
     {
         new MessageTemplateDao().UpdateSettings(templates);
         foreach (MessageTemplate current in templates)
         {
             HiCache.Remove(string.Format("Message-{0}", current.MessageType.ToLower()));
         }
     }
 }
Ejemplo n.º 18
0
 public static void UpdateSettings(System.Collections.Generic.IList <EcShop.Entities.Store.MessageTemplate> templates)
 {
     if (templates != null && templates.Count != 0)
     {
         new MessageTemplateDao().UpdateSettings(templates);
         foreach (EcShop.Entities.Store.MessageTemplate current in templates)
         {
             HiCache.Remove(string.Format("Message-{0}", current.MessageType.ToLower()));
         }
     }
 }
        private static DataTable GetCategories()
        {
            DataTable categories = HiCache.Get("DataCache-Categories") as DataTable;

            if (null == categories)
            {
                categories = ProductProvider.Instance().GetCategories();
                HiCache.Insert("DataCache-Categories", categories, 360, CacheItemPriority.Normal);
            }
            return(categories);
        }
Ejemplo n.º 20
0
        private static IList <Hidistro.Entities.Store.RegionInfo> GetAllRegions()
        {
            IList <Hidistro.Entities.Store.RegionInfo> list = HiCache.Get <IList <Hidistro.Entities.Store.RegionInfo> >("FileCache-Regions");

            if (list == null)
            {
                list = new RegionDao().GetProvinceCityAreaRegions();
                HiCache.Insert("FileCache-Regions", list);
            }
            return(list);
        }
Ejemplo n.º 21
0
        public static MemberInfo GetMember(int userId)
        {
            MemberInfo member = HiCache.Get(string.Format("DataCache-Member-{0}", userId)) as MemberInfo;

            if (member == null)
            {
                member = new MemberDao().GetMember(userId);
                HiCache.Insert(string.Format("DataCache-Member-{0}", userId), member, 360, CacheItemPriority.Normal);
            }
            return(member);
        }
Ejemplo n.º 22
0
        public static SiteSettings GetMasterSettings()
        {
            SiteSettings siteSettings = HiCache.Get <SiteSettings>("FileCache-MasterSettings");

            if (siteSettings == null)
            {
                siteSettings = SettingsManager.DecrySettings(DataHelper.ConvertDictionaryToEntity <SiteSettings>(new SiteSettingsDao().GetSiteSettings()));
                HiCache.Insert("FileCache-MasterSettings", siteSettings, 1800);
            }
            return(siteSettings);
        }
Ejemplo n.º 23
0
        public static DataTable GetSites()
        {
            DataTable dtSites = HiCache.Get("DataCache-Sites") as DataTable;

            if (dtSites == null)
            {
                dtSites = new SitesManagementDao().GetSites();
                HiCache.Insert("DataCache-Sites", dtSites);
            }
            return(dtSites);
        }
Ejemplo n.º 24
0
        private void btnSaveSubject_Click(object sender, EventArgs e)
        {
            decimal num;
            decimal num2;
            string  str = string.Empty;

            if (string.IsNullOrEmpty(txtSubjectName.Text) || (txtSubjectName.Text.Length > 30))
            {
                str = str + Formatter.FormatErrorMessage("主题名称不能为空,限制在30个字符以内");
            }
            if (!(string.IsNullOrEmpty(txtMinPrice.Text) || decimal.TryParse(txtMinPrice.Text, out num)))
            {
                str = str + Formatter.FormatErrorMessage("价格区间最小值必须为数值");
            }
            if (!(string.IsNullOrEmpty(txtMaxPrice.Text) || decimal.TryParse(txtMaxPrice.Text, out num2)))
            {
                str = str + Formatter.FormatErrorMessage("价格区间最大值必须为数值");
            }
            if (!string.IsNullOrEmpty(str))
            {
                ShowMsg(str, false);
            }
            else
            {
                string str2 = string.Empty;
                string str3 = string.Empty;
                if (listProductCategories.SelectedValue.Count > 0)
                {
                    foreach (int num3 in listProductCategories.SelectedValue)
                    {
                        str2 = str2 + num3 + ",";
                        str3 = str3 + listProductCategories.Items.FindByValue(num3.ToString()).Text.Trim() + ",";
                    }
                    str2 = str2.Substring(0, str2.Length - 1);
                    str3 = str3.Substring(0, str3.Length - 1);
                }
                string      filename = HttpContext.Current.Request.MapPath(Globals.ApplicationPath + string.Format("/Templates/sites/{0}/{1}/ProductSubjects.xml", HiContext.Current.User.UserId, themName));
                XmlDocument document = new XmlDocument();
                document.Load(filename);
                XmlNode entity = document.SelectSingleNode("root/Subject[SubjectId='" + subjectId + "']");
                entity.SelectSingleNode("SubjectName").InnerText  = txtSubjectName.Text;
                entity.SelectSingleNode("Type").InnerText         = radProductTags.SelectedValue;
                entity.SelectSingleNode("Categories").InnerText   = str2;
                entity.SelectSingleNode("CategoryName").InnerText = str3;
                entity.SelectSingleNode("MinPrice").InnerText     = txtMinPrice.Text;
                entity.SelectSingleNode("MaxPrice").InnerText     = txtMaxPrice.Text;
                entity.SelectSingleNode("Keywords").InnerText     = txtKeywords.Text;
                entity.SelectSingleNode("MaxNum").InnerText       = txtMaxNum.Text;
                Globals.EntityCoding(entity, true);
                document.Save(filename);
                HiCache.Remove(string.Format("ProductSubjectFileCache-{0}", HiContext.Current.User.UserId));
                ShowMsg("成功的修改了商品栏目", true);
            }
        }
Ejemplo n.º 25
0
        public static DistributorsInfo GetCurrentDistributors(int userId)
        {
            DistributorsInfo distributorInfo = HiCache.Get(string.Format("DataCache-Distributor-{0}", userId)) as DistributorsInfo;

            if ((distributorInfo == null) || (distributorInfo.UserId == 0))
            {
                distributorInfo = new DistributorsDao().GetDistributorInfo(userId);
                HiCache.Insert(string.Format("DataCache-Distributor-{0}", userId), distributorInfo, 360, CacheItemPriority.Normal);
            }
            return(distributorInfo);
        }
Ejemplo n.º 26
0
        public XmlDocument GetXmlNode()
        {
            XmlDocument xmlDocument = HiCache.Get("WapTemplateFileCache") as XmlDocument;

            if (xmlDocument == null)
            {
                xmlDocument = new XmlDocument();
                xmlDocument.Load(HttpContext.Current.Request.MapPath(HiContext.Current.GetWapshopSkinPath(null) + "/template.xml"));
            }
            return(xmlDocument);
        }
Ejemplo n.º 27
0
        public static DataTable GetCategories()
        {
            DataTable categories = HiCache.Get("DataCache-Categories") as DataTable;

            if (categories == null)
            {
                categories = new CategoryDao().GetCategories();
                HiCache.Insert("DataCache-Categories", categories, 360, CacheItemPriority.Normal);
            }
            return(categories);
        }
Ejemplo n.º 28
0
        public static IEnumerable <ProductReviewMode> GetProductReviews(int maxNum)
        {
            IEnumerable <ProductReviewMode> enumerable = HiCache.Get <IEnumerable <ProductReviewMode> >("DataCache-LatestReviews");

            if (enumerable == null)
            {
                enumerable = new ProductReviewDao().GetLastProductReviews(maxNum);
                HiCache.Insert("DataCache-LatestReviews", enumerable, 300);
            }
            return(enumerable);
        }
Ejemplo n.º 29
0
        private static Hashtable UserCache()
        {
            Hashtable hashtable = HiCache.Get("DataCache-UserLookuptable") as Hashtable;

            if (hashtable == null)
            {
                hashtable = new Hashtable();
                HiCache.Insert("DataCache-UserLookuptable", hashtable, 120);
            }
            return(hashtable);
        }
Ejemplo n.º 30
0
 public static void UpdateSettings(System.Collections.Generic.IList <MessageTemplate> templates)
 {
     if (templates != null && templates.Count != 0)
     {
         MessageTemplateProvider.Instance().UpdateSettings(templates);
         foreach (MessageTemplate current in templates)
         {
             HiCache.Remove(string.Format("Message-{0}", current.MessageType.ToLower()));
         }
     }
 }