Line 1: <script runat="server" language="C#">
Line 2:
Line 3: void GetTemplateFromCache(String HTMLFile)
Line 4: {
Line 5: int i;
Line 6: int CacheMinutes = 20;
Line 7: long tValid = 0;
Line 8: long tTotalTags = 0;
Line 9: long tOK = 1;
Line 10:
Line 11: if (Convert2Integer(Application["ShopId"])<=0) {
Line 12: SetStoreId();
Line 13: }
Line 14:
Line 15: try {
Line 16: tValid = Convert2Integer(Cache.Get(HTMLFile + "_Valid"));
Line 17: tTotalTags = Convert2Integer(Cache.Get(HTMLFile + "_TotalTags"));
Line 18:
Line 19: if (tValid<=0 || tTotalTags<=0) {
Line 20: tOK = 0;
Line 21: }
Line 22:
Line 23: if (tOK==1) {
Line 24: for (i=1;i<=tTotalTags; i++) {
Line 25: String ttag = Trim(Cache.Get(HTMLFile + "_tag" + i));
Line 26: String tSection = Trim(Cache.Get(HTMLFile + "_Section" + i));
Line 27:
Line 28: if (ttag=="" || tSection=="") {
Line 29: tOK = 0;
Line 30: break;
Line 31: }
Line 32:
Line 33: tSection = Trim(Cache.Get(HTMLFile + "_Section" + (tTotalTags+1)));
Line 34: if (tSection=="") {
Line 35: tOK = 0;
Line 36: }
Line 37: }
Line 38: }
Line 39: }
Line 40: catch (Exception E) {
Line 41: tOK = 0;
Line 42: }
Line 43:
Line 44: Random r1 = new Random();
Line 45: int r2 = r1.Next(1000);
Line 46: if (r2==500) {
Line 47: ClearCache();
Line 48: }
Line 49: r1 = null;
Line 50:
Line 51: if (Cache[HTMLFile] == null || tOK==0) {
Line 52: SAN_Template.Template myTemplate = new SAN_Template.Template();
Line 53:
Line 54: try {
Line 55: Cache.Remove(HTMLFile);
Line 56: }
Line 57: catch (Exception E) {
Line 58: ;
Line 59: }
Line 60: Cache.Insert(HTMLFile, HTMLFile, new CacheDependency(HTMLFile), DateTime.MaxValue, TimeSpan.FromMinutes(60));
Line 61:
Line 62: myTemplate.HTMLFile = HTMLFile;
Line 63:
Line 64: long a = 0;
Line 65: try {
Line 66: a = myTemplate.ParseTemplate();
Line 67: }
Line 68: catch (Exception E) {
Line 69: ;
Line 70: }
Line 71:
Line 72: try {
Line 73: Cache.Remove(HTMLFile + "_Valid");
Line 74: }
Line 75: catch (Exception E) {
Line 76: ;
Line 77: }
Line 78: Cache.Insert(HTMLFile + "_Valid", a, new CacheDependency(HTMLFile));
Line 79:
Line 80: if (a>0) {
Line 81: String tag, Section, LastSection;
Line 82: long TotalTags = myTemplate.GetTotalTags();
Line 83:
Line 84: try {
Line 85: Cache.Remove(HTMLFile + "_TotalTags");
Line 86: }
Line 87: catch (Exception E) {
Line 88: ;
Line 89: }
Line 90: Cache.Insert(HTMLFile + "_TotalTags", TotalTags, new CacheDependency(HTMLFile));
Line 91:
Line 92: for (i=1;i<=TotalTags; i++) {
Line 93: tag = myTemplate.GetTag(i);
Line 94: Section = myTemplate.GetSection(i);
Line 95: try {
Line 96: Cache.Remove(HTMLFile + "_tag" + i);
Line 97: }
Line 98: catch (Exception E) {
Line 99: ;
Line 100: }
Line 101: try {
Line 102: Cache.Remove(HTMLFile + "_Section" + i);
Line 103: }
Line 104: catch (Exception E) {
Line 105: ;
Line 106: }
Line 107: Cache.Insert(HTMLFile + "_tag" + i, tag, new CacheDependency(HTMLFile));
Line 108: Cache.Insert(HTMLFile + "_Section" + i, Section, new CacheDependency(HTMLFile));
Line 109: }
Line 110: LastSection = myTemplate.GetSection(TotalTags+1);
Line 111:
Line 112: try {
Line 113: Cache.Remove(HTMLFile + "_Section" + (TotalTags+1));
Line 114: }
Line 115: catch (Exception E) {
Line 116: ;
Line 117: }
Line 118: Cache.Insert(HTMLFile + "_Section" + (TotalTags+1), LastSection, new CacheDependency(HTMLFile));
Line 119: }
Line 120:
Line 121: myTemplate.Dispose();
Line 122: myTemplate = null;
Line 123: }
Line 124: }
Line 125:
Line 126: void ClearCache()
Line 127: {
Line 128: String strName = "";
Line 129: foreach (DictionaryEntry objItem in Cache) {
Line 130: try {
Line 131: strName = Trim(objItem.Key);
Line 132: Cache.Remove(strName);
Line 133: }
Line 134: catch (Exception myException) {
Line 135: }
Line 136: }
Line 137: }
Line 138:
Line 139:
Line 140:
Line 141:
Line 142:
Line 143: String GetCategoriesXMLFromCache()
Line 144: {
Line 145: String CatXML = "";
Line 146: int rc;
Line 147: if (Cache["CategoriesXML"] == null) {
Line 148: String XMLFile = Server.MapPath("XML/Categories/Categories.xml");
Line 149: CatXML += "<table width=\"100%\" cellpadding=2 cellspacing=2 border=0>";
Line 150:
Line 151: DataSet DS = new DataSet();
Line 152: try {
Line 153: DS.ReadXmlSchema(XMLFile);
Line 154: }
Line 155: catch(Exception E) {
Line 156: }
Line 157:
Line 158: if (DS.Tables.Count>0) {
Line 159: DataTable Table1 = DS.Tables[0];
Line 160: Table1.Columns["Id"].DataType = System.Type.GetType("System.Int32");
Line 161: Table1.Columns["ParentId"].DataType = System.Type.GetType("System.Int32");
Line 162: Table1.Columns["DisplayOrder"].DataType = System.Type.GetType("System.Int32");
Line 163:
Line 164: DS.ReadXml(Server.MapPath("XML/Categories/Categories.xml"));
Line 165: DataRow[] Rows1 = Table1.Select("ParentId=0", "DisplayOrder ASC");
Line 166:
Line 167: long Rows = Rows1.Length;
Line 168: for (rc=0;rc<Rows;rc++) {
Line 169: long CatId = Convert2Integer(Rows1[rc]["id"]);
Line 170: String CatDesc = Trim(Rows1[rc]["description"]);
Line 171: CatDesc = GetLanguagePart(CatDesc, Convert2Integer(Session["LangId"]));
Line 172: if (CatDesc!="") {
Line 173: CatXML += "<tr>";
Line 174: CatXML += "<td valign=top width=16><a href=\"ViewShopCategoryXML.aspx?Id=" + CatId + "\"><img align=absmiddle border=0 src=\"Images/dotred.gif\"></a></td>";
Line 175: CatXML += "<td valign=top><b><a class=categories href=\"ViewShopCategoryXML.aspx?Id=" + CatId + "\">" + CatDesc + "</a></b></td>";
Line 176: CatXML += "</tr>";
Line 177: }
Line 178: }
Line 179: }
Line 180: DS.Dispose();
Line 181: DS = null;
Line 182: CatXML += "</table>";
Line 183: Cache.Insert("CategoriesXML", CatXML, new CacheDependency(XMLFile));
Line 184: }
Line 185: else {
Line 186: CatXML = Trim(Cache.Get("CategoriesXML").ToString());
Line 187: }
Line 188:
Line 189: return(CatXML);
Line 190: }
Line 191:
Line 192: SAN_Shop.Shop GetShopObject()
Line 193: {
Line 194: SAN_Shop.Shop myShop = new SAN_Shop.Shop("Fido");
Line 195: return(myShop);
Line 196: }
Line 197:
Line 198: SAN_Helper.Helper GetHelperObject()
Line 199: {
Line 200: SAN_Helper.Helper myHelper = new SAN_Helper.Helper("Fido");
Line 201: return(myHelper);
Line 202: }
Line 203:
Line 204: SAN_User.User GetUserObject()
Line 205: {
Line 206: SAN_User.User myUser = new SAN_User.User("Fido");
Line 207: return(myUser);
Line 208: }
Line 209:
Line 210: SAN_StaticPage.StaticPage GetStaticPageObject()
Line 211: {
Line 212: SAN_StaticPage.StaticPage myStaticPage = new SAN_StaticPage.StaticPage("Fido");
Line 213: return(myStaticPage);
Line 214: }
Line 215:
Line 216: SAN_Shipping.Shipping GetShippingObject()
Line 217: {
Line 218: SAN_Shipping.Shipping myShipping = new SAN_Shipping.Shipping("Fido");
Line 219: return(myShipping);
Line 220: }
Line 221:
Line 222: SAN_Tax.Tax GetTaxObject()
Line 223: {
Line 224: SAN_Tax.Tax myTax = new SAN_Tax.Tax("Fido");
Line 225: return(myTax);
Line 226: }
Line 227:
Line 228: SAN_Coupons.Coupons GetCouponsObject()
Line 229: {
Line 230: SAN_Coupons.Coupons myCoupons = new SAN_Coupons.Coupons("Fido");
Line 231: return(myCoupons);
Line 232: }
Line 233:
Line 234: SAN_Article.Article GetArticleObject()
Line 235: {
Line 236: SAN_Article.Article myArticle = new SAN_Article.Article("Fido");
Line 237: return(myArticle);
Line 238: }
Line 239:
Line 240: SAN_Banner.Banner GetBannerObject()
Line 241: {
Line 242: SAN_Banner.Banner myBanner = new SAN_Banner.Banner("Fido");
Line 243: return(myBanner);
Line 244: }
Line 245:
Line 246: SAN_Stats.Stats GetStatsObject()
Line 247: {
Line 248: SAN_Stats.Stats myStats = new SAN_Stats.Stats("Fido");
Line 249: return(myStats);
Line 250: }
Line 251:
Line 252: SAN_Basket.Basket GetBasketObject()
Line 253: {
Line 254: SAN_Basket.Basket myBasket = new SAN_Basket.Basket("Fido");
Line 255: return(myBasket);
Line 256: }
Line 257:
Line 258: SAN_Board.Board GetBoardObject()
Line 259: {
Line 260: SAN_Board.Board myBoard = new SAN_Board.Board("Fido");
Line 261: return(myBoard);
Line 262: }
Line 263:
Line 264: SAN_CrossSell.CrossSell GetCrossSellObject()
Line 265: {
Line 266: SAN_CrossSell.CrossSell myCrossSell = new SAN_CrossSell.CrossSell("Fido");
Line 267: return(myCrossSell);
Line 268: }
Line 269:
Line 270: SAN_Language.Language GetLanguageObject()
Line 271: {
Line 272: SAN_Language.Language myLanguage = new SAN_Language.Language("Fido");
Line 273: return(myLanguage);
Line 274: }
Line 275:
Line 276: SAN_MailingList.MailingList GetMailingListObject()
Line 277: {
Line 278: SAN_MailingList.MailingList myMailingList = new SAN_MailingList.MailingList("Fido");
Line 279: return(myMailingList);
Line 280: }
Line 281:
Line 282: SAN_Megastore.Megastore GetMegastoreObject()
Line 283: {
Line 284: SAN_Megastore.Megastore myMegastore = new SAN_Megastore.Megastore("Fido");
Line 285: return(myMegastore);
Line 286: }
Line 287:
Line 288: SAN_Payment.Payment GetPaymentObject()
Line 289: {
Line 290: SAN_Payment.Payment myPayment = new SAN_Payment.Payment("Fido");
Line 291: return(myPayment);
Line 292: }
Line 293:
Line 294: SAN_Quiz.Quiz GetQuizObject()
Line 295: {
Line 296: SAN_Quiz.Quiz myQuiz = new SAN_Quiz.Quiz("Fido");
Line 297: return(myQuiz);
Line 298: }
Line 299:
Line 300: SAN_Referal.Referal GetReferalObject()
Line 301: {
Line 302: SAN_Referal.Referal myReferal = new SAN_Referal.Referal("Fido");
Line 303: return(myReferal);
Line 304: }
Line 305:
Line 306: SAN_Review.Review GetReviewObject()
Line 307: {
Line 308: SAN_Review.Review myReview = new SAN_Review.Review("Fido");
Line 309: return(myReview);
Line 310: }
Line 311:
Line 312: SAN_ShopTemplate.ShopTemplate GetShopTemplateObject()
Line 313: {
Line 314: SAN_ShopTemplate.ShopTemplate myShopTemplate = new SAN_ShopTemplate.ShopTemplate("Fido");
Line 315: return(myShopTemplate);
Line 316: }
Line 317:
Line 318: SAN_Poll.Poll GetPollObject()
Line 319: {
Line 320: SAN_Poll.Poll myPoll = new SAN_Poll.Poll("Fido");
Line 321: return(myPoll);
Line 322: }
Line 323:
Line 324: SAN_XMLIni.IniFileReader GetIniFileReaderObject()
Line 325: {
Line 326: SAN_XMLIni.IniFileReader myIniFileReader = (SAN_XMLIni.IniFileReader) Application["myIniFileReader"];
Line 327: if (myIniFileReader==null) {
Line 328: Application["myIniFileReader"] = new SAN_XMLIni.IniFileReader(Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\eshopkey.xml", true);
Line 329: myIniFileReader = (SAN_XMLIni.IniFileReader) Application["myIniFileReader"];
Line 330: }
Line 331: return(myIniFileReader);
Line 332: }
Line 333:
Line 334:
Line 335:
Line 336:
Line 337: void DiscardShopObject(SAN_Shop.Shop myShop)
Line 338: {
Line 339: try {
Line 340: myShop.Dispose();
Line 341: myShop = null;
Line 342: }
Line 343: catch (Exception E) {
Line 344: ;
Line 345: }
Line 346: }
Line 347:
Line 348: void DiscardHelperObject(SAN_Helper.Helper myHelper)
Line 349: {
Line 350: try {
Line 351: myHelper.Dispose();
Line 352: myHelper = null;
Line 353: }
Line 354: catch (Exception E) {
Line 355: ;
Line 356: }
Line 357: }
Line 358:
Line 359: void DiscardUserObject(SAN_User.User myUser)
Line 360: {
Line 361: try {
Line 362: myUser.Dispose();
Line 363: myUser = null;
Line 364: }
Line 365: catch (Exception E) {
Line 366: ;
Line 367: }
Line 368: }
Line 369:
Line 370: void DiscardStaticPageObject(SAN_StaticPage.StaticPage myStaticPage)
Line 371: {
Line 372: try {
Line 373: myStaticPage.Dispose();
Line 374: myStaticPage = null;
Line 375: }
Line 376: catch (Exception E) {
Line 377: ;
Line 378: }
Line 379: }
Line 380:
Line 381: void DiscardShippingObject(SAN_Shipping.Shipping myShipping)
Line 382: {
Line 383: try {
Line 384: myShipping.Dispose();
Line 385: myShipping = null;
Line 386: }
Line 387: catch (Exception E) {
Line 388: ;
Line 389: }
Line 390: }
Line 391:
Line 392: void DiscardTaxObject(SAN_Tax.Tax myTax)
Line 393: {
Line 394: try {
Line 395: myTax.Dispose();
Line 396: myTax = null;
Line 397: }
Line 398: catch (Exception E) {
Line 399: ;
Line 400: }
Line 401: }
Line 402:
Line 403: void DiscardCouponsObject(SAN_Coupons.Coupons myCoupons)
Line 404: {
Line 405: try {
Line 406: myCoupons.Dispose();
Line 407: myCoupons = null;
Line 408: }
Line 409: catch (Exception E) {
Line 410: ;
Line 411: }
Line 412: }
Line 413:
Line 414: void DiscardArticleObject(SAN_Article.Article myArticle)
Line 415: {
Line 416: try {
Line 417: myArticle.Dispose();
Line 418: myArticle = null;
Line 419: }
Line 420: catch (Exception E) {
Line 421: ;
Line 422: }
Line 423: }
Line 424:
Line 425: void DiscardBannerObject(SAN_Banner.Banner myBanner)
Line 426: {
Line 427: try {
Line 428: myBanner.Dispose();
Line 429: myBanner = null;
Line 430: }
Line 431: catch (Exception E) {
Line 432: ;
Line 433: }
Line 434: }
Line 435:
Line 436: void DiscardStatsObject(SAN_Stats.Stats myStats)
Line 437: {
Line 438: try {
Line 439: myStats.Dispose();
Line 440: myStats = null;
Line 441: }
Line 442: catch (Exception E) {
Line 443: ;
Line 444: }
Line 445: }
Line 446:
Line 447: void DiscardBasketObject(SAN_Basket.Basket myBasket)
Line 448: {
Line 449: try {
Line 450: myBasket.Dispose();
Line 451: myBasket = null;
Line 452: }
Line 453: catch (Exception E) {
Line 454: ;
Line 455: }
Line 456: }
Line 457:
Line 458: void DiscardBoardObject(SAN_Board.Board myBoard)
Line 459: {
Line 460: try {
Line 461: myBoard.Dispose();
Line 462: myBoard = null;
Line 463: }
Line 464: catch (Exception E) {
Line 465: ;
Line 466: }
Line 467: }
Line 468:
Line 469: void DiscardCrossSellObject(SAN_CrossSell.CrossSell myCrossSell)
Line 470: {
Line 471: try {
Line 472: myCrossSell.Dispose();
Line 473: myCrossSell = null;
Line 474: }
Line 475: catch (Exception E) {
Line 476: ;
Line 477: }
Line 478: }
Line 479:
Line 480: void DiscardLanguageObject(SAN_Language.Language myLanguage)
Line 481: {
Line 482: try {
Line 483: myLanguage.Dispose();
Line 484: myLanguage = null;
Line 485: }
Line 486: catch (Exception E) {
Line 487: ;
Line 488: }
Line 489: }
Line 490:
Line 491: void DiscardMailingListObject(SAN_MailingList.MailingList myMailingList)
Line 492: {
Line 493: try {
Line 494: myMailingList.Dispose();
Line 495: myMailingList = null;
Line 496: }
Line 497: catch (Exception E) {
Line 498: ;
Line 499: }
Line 500: }
Line 501:
Line 502: void DiscardMegastoreObject(SAN_Megastore.Megastore myMegastore)
Line 503: {
Line 504: try {
Line 505: myMegastore.Dispose();
Line 506: myMegastore = null;
Line 507: }
Line 508: catch (Exception E) {
Line 509: ;
Line 510: }
Line 511: }
Line 512:
Line 513: void DiscardPaymentObject(SAN_Payment.Payment myPayment)
Line 514: {
Line 515: try {
Line 516: myPayment.Dispose();
Line 517: myPayment = null;
Line 518: }
Line 519: catch (Exception E) {
Line 520: ;
Line 521: }
Line 522: }
Line 523:
Line 524: void DiscardQuizObject(SAN_Quiz.Quiz myQuiz)
Line 525: {
Line 526: try {
Line 527: myQuiz.Dispose();
Line 528: myQuiz = null;
Line 529: }
Line 530: catch (Exception E) {
Line 531: ;
Line 532: }
Line 533: }
Line 534:
Line 535: void DiscardReferalObject(SAN_Referal.Referal myReferal)
Line 536: {
Line 537: try {
Line 538: myReferal.Dispose();
Line 539: myReferal = null;
Line 540: }
Line 541: catch (Exception E) {
Line 542: ;
Line 543: }
Line 544: }
Line 545:
Line 546: void DiscardReviewObject(SAN_Review.Review myReview)
Line 547: {
Line 548: try {
Line 549: myReview.Dispose();
Line 550: myReview = null;
Line 551: }
Line 552: catch (Exception E) {
Line 553: ;
Line 554: }
Line 555: }
Line 556:
Line 557: void DiscardShopTemplateObject(SAN_ShopTemplate.ShopTemplate myShopTemplate)
Line 558: {
Line 559: try {
Line 560: myShopTemplate.Dispose();
Line 561: myShopTemplate = null;
Line 562: }
Line 563: catch (Exception E) {
Line 564: ;
Line 565: }
Line 566: }
Line 567:
Line 568: void DiscardPollObject(SAN_Poll.Poll myPoll)
Line 569: {
Line 570: try {
Line 571: myPoll.Dispose();
Line 572: myPoll = null;
Line 573: }
Line 574: catch (Exception E) {
Line 575: ;
Line 576: }
Line 577: }
Line 578:
Line 579: void TrackCacheStatistics(String CacheStr, long iType) {
Line 580: if (Convert2Integer(Application["CacheStatistics"])==1) {
Line 581: String CacheKey = "";
Line 582: if (iType==1) {
Line 583: CacheKey = "CacheKey_" + CacheStr;
Line 584: }
Line 585: else if (iType==2) {
Line 586: CacheKey = "CacheKeyHit_" + CacheStr;
Line 587: }
Line 588: else {
Line 589: CacheKey = "CacheKeyMethod_" + CacheStr;
Line 590: }
Line 591:
Line 592:
Line 593: if (iType==1 || iType==2) {
Line 594: Application.Lock();
Line 595: Application[CacheKey] = Convert2Integer(Application[CacheKey]) + 1;
Line 596: Application.UnLock();
Line 597: }
Line 598: else {
Line 599: if (Convert2Integer(Application[CacheKey])!=iType) {
Line 600: Application.Lock();
Line 601: Application[CacheKey] = iType;
Line 602: Application.UnLock();
Line 603: }
Line 604: }
Line 605: }
Line 606: }
Line 607:
Line 608: void InitAppLock(String CacheStr) {
Line 609: /*
Line 610: if (Application[CacheStr]==null) {
Line 611: Application[CacheStr] = new Object();
Line 612: }
Line 613: */
Line 614: }
Line 615:
Line 616: String GetNativeCacheString(String CacheStr, ref Boolean HasValue) {
Line 617: HasValue = false;
Line 618: String res = "";
Line 619:
Line 620: try {
Line 621: if (Cache[CacheStr]==null) {
Line 622: InitAppLock(CacheStr);
Line 623: lock(CacheStr) {
Line 624: if (Cache[CacheStr]!=null) {
Line 625: res = Trim(Cache[CacheStr]);
Line 626: HasValue = true;
Line 627: }
Line 628: }
Line 629: }
Line 630: else {
Line 631: res = Trim(Cache[CacheStr]);
Line 632: HasValue = true;
Line 633: }
Line 634: }
Line 635: catch (Exception) {
Line 636: ;
Line 637: }
Line 638:
Line 639: return(res);
Line 640: }
Line 641:
Line 642: long GetNativeCacheLong(String CacheStr, ref Boolean HasValue) {
Line 643: HasValue = false;
Line 644: long res = 0;
Line 645:
Line 646: try {
Line 647: if (Cache[CacheStr]==null) {
Line 648: InitAppLock(CacheStr);
Line 649: lock(CacheStr) {
Line 650: if (Cache[CacheStr]!=null) {
Line 651: res = Convert2Integer(Cache[CacheStr]);
Line 652: HasValue = true;
Line 653: }
Line 654: }
Line 655: }
Line 656: else {
Line 657: res = Convert2Integer(Cache[CacheStr]);
Line 658: HasValue = true;
Line 659: }
Line 660: }
Line 661: catch (Exception) {
Line 662: ;
Line 663: }
Line 664:
Line 665: return(res);
Line 666: }
Line 667:
Line 668: double GetNativeCacheDouble(String CacheStr, ref Boolean HasValue) {
Line 669: HasValue = false;
Line 670: double res = 0;
Line 671:
Line 672: try {
Line 673: if (Cache[CacheStr]==null) {
Line 674: InitAppLock(CacheStr);
Line 675: lock(CacheStr) {
Line 676: if (Cache[CacheStr]!=null) {
Line 677: res = Convert2Float(Cache[CacheStr]);
Line 678: HasValue = true;
Line 679: }
Line 680: }
Line 681: }
Line 682: else {
Line 683: res = Convert2Float(Cache[CacheStr]);
Line 684: HasValue = true;
Line 685: }
Line 686: }
Line 687: catch (Exception) {
Line 688: ;
Line 689: }
Line 690:
Line 691: return(res);
Line 692: }
Line 693:
Line 694: DataSet GetNativeCacheDataSet(String CacheStr, ref Boolean HasValue) {
Line 695: HasValue = false;
Line 696: DataSet res = null;
Line 697:
Line 698: try {
Line 699: if (Cache[CacheStr]==null) {
Line 700: InitAppLock(CacheStr);
Line 701: lock(CacheStr) {
Line 702: if (Cache[CacheStr]!=null) {
Line 703: res = (DataSet)Cache[CacheStr];
Line 704: HasValue = true;
Line 705: }
Line 706: }
Line 707: }
Line 708: else {
Line 709: res = (DataSet)Cache[CacheStr];
Line 710: HasValue = true;
Line 711: }
Line 712: }
Line 713: catch (Exception) {
Line 714: ;
Line 715: }
Line 716:
Line 717: return(res);
Line 718: }
Line 719:
Line 720: void SetNativeCacheString(String CacheStr, String strValue, long iMinutes) {
Line 721: if (iMinutes<=0) iMinutes = 30;
Line 722: InitAppLock(CacheStr);
Line 723: lock(CacheStr) {
Line 724: try {
Line 725: Cache.Insert(CacheStr, strValue, null, DateTime.Now.AddMinutes(iMinutes), System.Web.Caching.Cache.NoSlidingExpiration);
Line 726: }
Line 727: catch (Exception E) {
Line 728: ;
Line 729: }
Line 730: }
Line 731: }
Line 732:
Line 733: void SetNativeCacheLong(String CacheStr, long strValue, long iMinutes) {
Line 734: if (iMinutes<=0) iMinutes = 30;
Line 735: InitAppLock(CacheStr);
Line 736: lock(CacheStr) {
Line 737: try {
Line 738: Cache.Insert(CacheStr, strValue, null, DateTime.Now.AddMinutes(iMinutes), System.Web.Caching.Cache.NoSlidingExpiration);
Line 739: }
Line 740: catch (Exception E) {
Line 741: ;
Line 742: }
Line 743: }
Line 744: }
Line 745:
Line 746: void SetNativeCacheDouble(String CacheStr, double strValue, long iMinutes) {
Line 747: if (iMinutes<=0) iMinutes = 30;
Line 748: InitAppLock(CacheStr);
Line 749: lock(CacheStr) {
Line 750: try {
Line 751: Cache.Insert(CacheStr, strValue, null, DateTime.Now.AddMinutes(iMinutes), System.Web.Caching.Cache.NoSlidingExpiration);
Line 752: }
Line 753: catch (Exception E) {
Line 754: ;
Line 755: }
Line 756: }
Line 757: }
Line 758:
Line 759: void SetNativeCacheDataSet(String CacheStr, DataSet DS, long iMinutes) {
Line 760: if (iMinutes<=0) iMinutes = 30;
Line 761: InitAppLock(CacheStr);
Line 762: lock(CacheStr) {
Line 763: try {
Line 764: Cache.Insert(CacheStr, DS, null, DateTime.Now.AddMinutes(iMinutes), System.Web.Caching.Cache.NoSlidingExpiration);
Line 765: }
Line 766: catch (Exception E) {
Line 767: ;
Line 768: }
Line 769: }
Line 770: }
Line 771:
Line 772:
Line 773:
Line 774: DataSet SearchShopProductsCache(long UseFullText, long SearchType, long BooleanSearch, String Title, long CategoryId, long ActiveFlag, double Price1, double Price2, String Serial, long HotDeal, String AttrStr, String TableStr, String TableLookupStr, long OrderBy, long Direction, long PageNo, long PageSize, ref long NoPages, SAN_Shop.Shop myShop) {
Line 775: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 776: NoPages = 0;
Line 777:
Line 778: DataSet DS = null;
Line 779: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_SearchShopProductsMFF4444Cache_" + Trim(UseFullText) + "_" + Trim(SearchType) + "_" + Trim(BooleanSearch) + "_" + Trim(GenerateFriendlyName(Title)) + "_" + Trim(CategoryId) + "_" + Trim(ActiveFlag) + "_" + Trim(Price1) + "_" + Trim(Price2) + "_" + Trim(GenerateFriendlyName(Serial)) + "_" + Trim(HotDeal) + "_" + Trim(GenerateFriendlyName(AttrStr)) + "_" + Trim(GenerateFriendlyName(TableStr)) + "_" + Trim(GenerateFriendlyName(TableLookupStr)) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 780: String CacheStr2 = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_SearchShopProductsNoPagesMFF4444Cache_" + Trim(UseFullText) + "_" + Trim(SearchType) + "_" + Trim(BooleanSearch) + "_" + Trim(GenerateFriendlyName(Title)) + "_" + Trim(CategoryId) + "_" + Trim(ActiveFlag) + "_" + Trim(Price1) + "_" + Trim(Price2) + "_" + Trim(GenerateFriendlyName(Serial)) + "_" + Trim(HotDeal) + "_" + Trim(GenerateFriendlyName(AttrStr)) + "_" + Trim(GenerateFriendlyName(TableStr)) + "_" + Trim(GenerateFriendlyName(TableLookupStr)) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 781: CacheStr = CalculateMD5Hash(CacheStr);
Line 782: CacheStr2 = CalculateMD5Hash(CacheStr2);
Line 783: TrackCacheStatistics("SearchShopProductsMFFCache", 1);
Line 784:
Line 785: if (CacheMethods == 1)
Line 786: {
Line 787: if (Cache[CacheStr] == null || Cache[CacheStr2] == null)
Line 788: {
Line 789: InitAppLock(CacheStr);
Line 790: lock (CacheStr)
Line 791: {
Line 792: if (Cache[CacheStr] == null || Cache[CacheStr2] == null)
Line 793: {
Line 794: TrackCacheStatistics("SearchShopProductsMFFCache", 2);
Line 795: DS = myShop.SearchShopProducts(Convert2Integer(Application["ShopId"]), UseFullText, SearchType, BooleanSearch, Title, CategoryId, ActiveFlag, Price1, Price2, Serial, HotDeal, "", "", AttrStr, TableStr, TableLookupStr, "", "", "", "", "", 0, 1, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 796: Cache.Insert(CacheStr, DS, null, DateTime.Now.AddMinutes(Convert2Integer(Application["CacheTime1"])), System.Web.Caching.Cache.NoSlidingExpiration);
Line 797: Cache.Insert(CacheStr2, NoPages, null, DateTime.Now.AddMinutes(Convert2Integer(Application["CacheTime1"])), System.Web.Caching.Cache.NoSlidingExpiration);
Line 798: }
Line 799: }
Line 800: }
Line 801: else
Line 802: {
Line 803: DS = (DataSet)Cache[CacheStr];
Line 804: NoPages = Convert2Integer(Cache[CacheStr2]);
Line 805: }
Line 806: }
Line 807: else
Line 808: {
Line 809: TrackCacheStatistics("SearchShopProductsMFFCache", 2);
Line 810: DS = myShop.SearchShopProducts(Convert2Integer(Application["ShopId"]), UseFullText, SearchType, BooleanSearch, Title, CategoryId, ActiveFlag, Price1, Price2, Serial, HotDeal, "", "", AttrStr, TableStr, TableLookupStr, "", "", "", "", "", 0, 1, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 811: }
Line 812: return(DS);
Line 813: }
Line 814:
Line 815: DataSet GetConfigurableProductsFromChildCache(long ProductId, SAN_Shop.Shop myShop) {
Line 816: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 817: String CacheLabel = "GetConfigurableProductsFromChildCache3MFF4";
Line 818: TrackCacheStatistics(CacheLabel, CacheMethods);
Line 819: Boolean HasException = false;
Line 820: Boolean HasValue = false;
Line 821:
Line 822: DataSet DS = null;
Line 823: String CacheStr = GenerateFriendlyName(Trim(Application["SiteURL"])) + "_GetConfigurableProductsFromChildCache2MFF_" + Trim(ProductId);
Line 824: CacheStr = CalculateMD5Hash(CacheStr);
Line 825: TrackCacheStatistics(CacheLabel, 1);
Line 826:
Line 827: if (CacheMethods==1) {
Line 828: DS = GetNativeCacheDataSet(CacheStr, ref HasValue);
Line 829: if (!HasValue) {
Line 830: TrackCacheStatistics(CacheLabel, 2);
Line 831: DS = myShop.GetConfigurableProductsFromChild(ProductId);
Line 832: SetNativeCacheDataSet(CacheStr, DS, Convert2Integer(Application["CacheTime1"]));
Line 833: }
Line 834: }
Line 835: else {
Line 836: TrackCacheStatistics(CacheLabel, 2);
Line 837: DS = myShop.GetConfigurableProductsFromChild(ProductId);
Line 838: }
Line 839:
Line 840: return(DS);
Line 841: }
Line 842:
Line 843:
Line 844: DataSet GetShopTableLookupValuesUsedInCategoryPathAdvancedCache(String Title, long CategoryId, long TableLookupId, String LookupStr, SAN_Shop.Shop myShop) {
Line 845: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 846: String CacheLabel = "GetShopTableLookupValuesUsedInCategoryPathAdvancedCache3MFF3";
Line 847: TrackCacheStatistics(CacheLabel, CacheMethods);
Line 848: Boolean HasException = false;
Line 849: Boolean HasValue = false;
Line 850:
Line 851: DataSet DS = null;
Line 852: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopTableLookupValuesUsedInCategoryPathAdvancedCacheMFF3_" + Trim(GenerateFriendlyName(Title)) + "_" + Trim(CategoryId) + "_" + Trim(TableLookupId) + "_" + Trim(GenerateFriendlyName(LookupStr)) + "_";
Line 853: CacheStr = CalculateMD5Hash(CacheStr);
Line 854: TrackCacheStatistics(CacheLabel, 1);
Line 855:
Line 856: if (CacheMethods==1) {
Line 857: DS = GetNativeCacheDataSet(CacheStr, ref HasValue);
Line 858: if (!HasValue) {
Line 859: TrackCacheStatistics(CacheLabel, 2);
Line 860: DS = myShop.GetShopTableLookupValuesUsedInCategoryPathAdvanced(Convert2Integer(Application["ShopId"]), Title, CategoryId, 1, -1, TableLookupId, "", LookupStr, 0, 0, 0);
Line 861: SetNativeCacheDataSet(CacheStr, DS, Convert2Integer(Application["CacheTime0"]));
Line 862: }
Line 863: }
Line 864: else {
Line 865: TrackCacheStatistics(CacheLabel, 2);
Line 866: DS = myShop.GetShopTableLookupValuesUsedInCategoryPathAdvanced(Convert2Integer(Application["ShopId"]), Title, CategoryId, 1, -1, TableLookupId, "", LookupStr, 0, 0, 0);
Line 867: }
Line 868:
Line 869: return(DS);
Line 870: }
Line 871:
Line 872: DataSet GetShopSpecificProductAttributesCache(long ProductId, SAN_Shop.Shop myShop) {
Line 873: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 874: String CacheLabel = "GetShopSpecificProductAttributesCacheMFF3";
Line 875: TrackCacheStatistics(CacheLabel, CacheMethods);
Line 876: Boolean HasException = false;
Line 877: Boolean HasValue = false;
Line 878:
Line 879: DataSet DS = null;
Line 880: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopSpecificProductAttributesCacheMFF2_" + Trim(ProductId);
Line 881: CacheStr = CalculateMD5Hash(CacheStr);
Line 882: TrackCacheStatistics(CacheLabel, 1);
Line 883:
Line 884: if (CacheMethods==1) {
Line 885: DS = GetNativeCacheDataSet(CacheStr, ref HasValue);
Line 886: if (!HasValue) {
Line 887: TrackCacheStatistics(CacheLabel, 2);
Line 888: DS = myShop.GetShopSpecificProductAttributes(Convert2Integer(Application["ShopId"]), ProductId);
Line 889: SetNativeCacheDataSet(CacheStr, DS, Convert2Integer(Application["CacheTime0"]));
Line 890: }
Line 891: }
Line 892: else {
Line 893: TrackCacheStatistics(CacheLabel, 2);
Line 894: DS = myShop.GetShopSpecificProductAttributes(Convert2Integer(Application["ShopId"]), ProductId);
Line 895: }
Line 896:
Line 897: return(DS);
Line 898: }
Line 899:
Line 900: DataSet GetShopTopLevelCategoriesCache(long Active, SAN_Shop.Shop myShop) {
Line 901: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 902: String CacheLabel = "GetShopTopLevelCategoriesCacheMFF4";
Line 903: TrackCacheStatistics(CacheLabel, CacheMethods);
Line 904: Boolean HasException = false;
Line 905: Boolean HasValue = false;
Line 906:
Line 907: DataSet DS = null;
Line 908: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopTopLevelCategoriesCacheMFF_" + Trim(Active);
Line 909: CacheStr = CalculateMD5Hash(CacheStr);
Line 910: TrackCacheStatistics(CacheLabel, 1);
Line 911:
Line 912: if (CacheMethods==1) {
Line 913: DS = GetNativeCacheDataSet(CacheStr, ref HasValue);
Line 914: if (!HasValue) {
Line 915: TrackCacheStatistics(CacheLabel, 2);
Line 916: DS = myShop.GetShopTopLevelCategories(Convert2Integer(Application["ShopId"]), Active);
Line 917: SetNativeCacheDataSet(CacheStr, DS, Convert2Integer(Application["CacheTime1"]));
Line 918: }
Line 919: }
Line 920: else {
Line 921: TrackCacheStatistics(CacheLabel, 2);
Line 922: DS = myShop.GetShopTopLevelCategories(Convert2Integer(Application["ShopId"]), Active);
Line 923: }
Line 924:
Line 925: return(DS);
Line 926: }
Line 927:
Line 928: long GetShopProductCategoryIdCache(long ProductId, SAN_Shop.Shop myShop) {
Line 929: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 930: String CacheLabel = "GetShopProductCategoryIdCacheMFF3";
Line 931: TrackCacheStatistics(CacheLabel, CacheMethods);
Line 932: Boolean HasException = false;
Line 933: Boolean HasValue = false;
Line 934:
Line 935: long strValue = 0;
Line 936: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopProductCategoryIdCacheMFF_" + Trim(ProductId);
Line 937: CacheStr = CalculateMD5Hash(CacheStr);
Line 938: TrackCacheStatistics(CacheLabel, 1);
Line 939:
Line 940: if (CacheMethods==1) {
Line 941: strValue = GetNativeCacheLong(CacheStr, ref HasValue);
Line 942: if (!HasValue) {
Line 943: TrackCacheStatistics(CacheLabel, 2);
Line 944: strValue = Convert2Integer(myShop.GetShopProductCategoryId(Convert2Integer(Application["ShopId"]), ProductId));
Line 945: SetNativeCacheLong(CacheStr, strValue, Convert2Integer(Application["CacheTime1"]));
Line 946: }
Line 947: }
Line 948: else {
Line 949: TrackCacheStatistics(CacheLabel, 2);
Line 950: strValue = Convert2Integer(myShop.GetShopProductCategoryId(Convert2Integer(Application["ShopId"]), ProductId));
Line 951: }
Line 952:
Line 953: return(strValue);
Line 954: }
Line 955:
Line 956: String GetShopProductNameCache(long ProductId, long LangId, SAN_Shop.Shop myShop) {
Line 957: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 958: String CacheLabel = "GetShopProductNameCacheMFF3";
Line 959: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 960: Boolean HasException = false;
Line 961: Boolean HasValue = false;
Line 962:
Line 963: String strValue = "";
Line 964: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopProductNameCacheMFF_" + Trim(ProductId) + "_" + Trim(LangId);
Line 965: CacheStr = CalculateMD5Hash(CacheStr);
Line 966: TrackCacheStatistics(CacheLabel, 1);
Line 967:
Line 968: if (CacheMethods==1) {
Line 969: strValue = GetNativeCacheString(CacheStr, ref HasValue);
Line 970: if (!HasValue) {
Line 971: TrackCacheStatistics(CacheLabel, 2);
Line 972: strValue = Trim(myShop.GetShopProductName(Convert2Integer(Application["ShopId"]), ProductId));
Line 973: strValue = GetLanguagePart(strValue, LangId);
Line 974:
Line 975: SetNativeCacheString(CacheStr, strValue, Convert2Integer(Application["CacheTime1"]));
Line 976: }
Line 977: }
Line 978: else {
Line 979: TrackCacheStatistics(CacheLabel, 2);
Line 980: strValue = Trim(myShop.GetShopProductName(Convert2Integer(Application["ShopId"]), ProductId));
Line 981: strValue = GetLanguagePart(strValue, LangId);
Line 982: }
Line 983:
Line 984: return(strValue);
Line 985: }
Line 986:
Line 987: String GetShopCategoryFullPathCache(long CategoryId, SAN_Shop.Shop myShop) {
Line 988: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 989: String CacheLabel = "GetShopCategoryFullMFFCache";
Line 990: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 991: Boolean HasException = false;
Line 992: Boolean HasValue = false;
Line 993:
Line 994: long LangId = 1;
Line 995: String strValue = "";
Line 996: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopProductNameCacheMFF_" + Trim(CategoryId) + "_" + Trim(LangId);
Line 997: CacheStr = CalculateMD5Hash(CacheStr);
Line 998: TrackCacheStatistics(CacheLabel, 1);
Line 999:
Line 1000: if (CacheMethods==1) {
Line 1001: strValue = GetNativeCacheString(CacheStr, ref HasValue);
Line 1002: if (!HasValue) {
Line 1003: TrackCacheStatistics(CacheLabel, 2);
Line 1004: strValue = Trim(myShop.GetShopCategoryFullPath(Convert2Integer(Application["ShopId"]), CategoryId));
Line 1005: strValue = GetLanguagePart(strValue, Convert2Integer(Application["LangId"]));
Line 1006: SetNativeCacheString(CacheStr, strValue, Convert2Integer(Application["CacheTime1"]));
Line 1007: }
Line 1008: }
Line 1009: else {
Line 1010: TrackCacheStatistics(CacheLabel, 2);
Line 1011: strValue = Trim(myShop.GetShopCategoryFullPath(Convert2Integer(Application["ShopId"]), CategoryId));
Line 1012: strValue = GetLanguagePart(strValue, Convert2Integer(Application["LangId"]));
Line 1013: }
Line 1014: return(strValue);
Line 1015: }
Line 1016:
Line 1017:
Line 1018: long GetConfigurableProductFromChildCache(long ProductId, SAN_Shop.Shop myShop) {
Line 1019: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1020: String CacheLabel = "GetShopProductNameCacheMFF3";
Line 1021: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 1022: long LangId = 1;
Line 1023: Boolean HasException = false;
Line 1024: Boolean HasValue = false;
Line 1025:
Line 1026: long strValue = 0;
Line 1027: String CacheStr = GenerateFriendlyName(Trim(Application["SiteURL"])) + "_GetShopProductNameCacheMFF_" + Trim(ProductId) + "_" + Trim(LangId);
Line 1028: CacheStr = CalculateMD5Hash(CacheStr);
Line 1029: TrackCacheStatistics(CacheLabel, 1);
Line 1030:
Line 1031: if (CacheMethods==1) {
Line 1032: strValue = GetNativeCacheLong(CacheStr, ref HasValue);
Line 1033: if (!HasValue) {
Line 1034: TrackCacheStatistics(CacheLabel, 2);
Line 1035: strValue = GetConfigurableProductFromChild(ProductId, myShop);
Line 1036:
Line 1037:
Line 1038: SetNativeCacheLong(CacheStr, strValue, Convert2Integer(Application["CacheTime1"]));
Line 1039: }
Line 1040: }
Line 1041: else {
Line 1042: TrackCacheStatistics(CacheLabel, 2);
Line 1043: strValue = GetConfigurableProductFromChild(ProductId, myShop);
Line 1044:
Line 1045: }
Line 1046:
Line 1047: return(strValue);
Line 1048: }
Line 1049:
Line 1050: long IsShopProductConfigurableCache(long ProductId, SAN_Shop.Shop myShop) {
Line 1051: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1052: String CacheLabel = "IsShopProductConfigurableCacheMFF";
Line 1053: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 1054: long LangId = 1;
Line 1055: Boolean HasException = false;
Line 1056: Boolean HasValue = false;
Line 1057:
Line 1058: long strValue = 0;
Line 1059: String CacheStr = GenerateFriendlyName(Trim(Application["SiteURL"])) + "_GetShopProductNameCacheMFF_" + Trim(ProductId) + "_" + Trim(LangId);
Line 1060: CacheStr = CalculateMD5Hash(CacheStr);
Line 1061: TrackCacheStatistics(CacheLabel, 1);
Line 1062:
Line 1063: if (CacheMethods==1) {
Line 1064: strValue = GetNativeCacheLong(CacheStr, ref HasValue);
Line 1065: if (!HasValue) {
Line 1066: TrackCacheStatistics(CacheLabel, 2);
Line 1067: strValue = Convert2Integer(myShop.IsShopProductConfigurable(Convert2Integer(Application["ShopId"]), ProductId));
Line 1068: SetNativeCacheLong(CacheStr, strValue, Convert2Integer(Application["CacheTime"]));
Line 1069: }
Line 1070: }
Line 1071: else {
Line 1072: TrackCacheStatistics(CacheLabel, 2);
Line 1073: strValue = Convert2Integer(myShop.IsShopProductConfigurable(Convert2Integer(Application["ShopId"]), ProductId));
Line 1074:
Line 1075: }
Line 1076:
Line 1077: return(strValue);
Line 1078: }
Line 1079:
Line 1080:
Line 1081:
Line 1082: String GetShopCategoryDescriptionCache(long CategoryId, long LangId, SAN_Shop.Shop myShop) {
Line 1083: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1084: String CacheLabel = "GetShopCategoryDescriptionCacheMFF3";
Line 1085: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 1086: Boolean HasException = false;
Line 1087: Boolean HasValue = false;
Line 1088:
Line 1089: String strValue = "";
Line 1090: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopCategoryDescriptionCacheMFF_" + Trim(CategoryId) + "_" + Trim(LangId);
Line 1091: CacheStr = CalculateMD5Hash(CacheStr);
Line 1092: TrackCacheStatistics(CacheLabel, 1);
Line 1093:
Line 1094: if (CacheMethods==1) {
Line 1095: strValue = GetNativeCacheString(CacheStr, ref HasValue);
Line 1096: if (!HasValue) {
Line 1097: TrackCacheStatistics(CacheLabel, 2);
Line 1098: strValue = Trim(myShop.GetShopCategoryDescription(Convert2Integer(Application["ShopId"]), CategoryId));
Line 1099: strValue = GetLanguagePart(strValue, LangId);
Line 1100:
Line 1101: SetNativeCacheString(CacheStr, strValue, Convert2Integer(Application["CacheTime1"]));
Line 1102: }
Line 1103: }
Line 1104: else {
Line 1105: TrackCacheStatistics(CacheLabel, 2);
Line 1106: strValue = Trim(myShop.GetShopCategoryDescription(Convert2Integer(Application["ShopId"]), CategoryId));
Line 1107: strValue = GetLanguagePart(strValue, LangId);
Line 1108: }
Line 1109:
Line 1110: return(strValue);
Line 1111: }
Line 1112:
Line 1113: DataSet GetShopItemsInCategoryMiscCache(long CategoryId, double fField1, double fField2, String sField1, String sField2, long HotDeal, long ActiveFlag, long ShowMaster, long ShowCombos, long OrderBy, long Direction, long PageNo, long PageSize, ref long NoPages, SAN_Shop.Shop myShop) {
Line 1114: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1115: NoPages = 0;
Line 1116:
Line 1117: DataSet DS = null;
Line 1118: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopItemsInCategoryMiscMFFCache_" + Trim(CategoryId) + "_" + Trim(fField1) + "_" + Trim(fField2) + "_" + Trim(GenerateFriendlyName(sField1)) + "_" + Trim(GenerateFriendlyName(sField2)) + "_" + Trim(HotDeal) + "_" + Trim(ActiveFlag) + "_" + Trim(ShowMaster) + "_" + Trim(ShowCombos) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 1119: String CacheStr2 = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopItemsInCategoryMiscNoPagesMFFCache_" + Trim(CategoryId) + "_" + Trim(fField1) + "_" + Trim(fField2) + "_" + Trim(GenerateFriendlyName(sField1)) + "_" + Trim(GenerateFriendlyName(sField2)) + "_" + Trim(HotDeal) + "_" + Trim(ActiveFlag) + "_" + Trim(ShowMaster) + "_" + Trim(ShowCombos) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 1120: CacheStr = CalculateMD5Hash(CacheStr);
Line 1121: CacheStr2 = CalculateMD5Hash(CacheStr2);
Line 1122: TrackCacheStatistics("GetShopItemsInCategoryMiscMFFCache", 1);
Line 1123:
Line 1124: if (CacheMethods == 1)
Line 1125: {
Line 1126: if (Cache[CacheStr] == null || Cache[CacheStr2] == null)
Line 1127: {
Line 1128: InitAppLock(CacheStr);
Line 1129: lock (CacheStr)
Line 1130: {
Line 1131: if (Cache[CacheStr] == null || Cache[CacheStr2] == null)
Line 1132: {
Line 1133: TrackCacheStatistics("GetShopItemsInCategoryMiscMFFCache", 2);
Line 1134:
Line 1135: DS = myShop.GetShopItemsInCategoryMisc(Convert2Integer(Application["ShopId"]), CategoryId, fField1, fField2, sField1, sField2, HotDeal, ActiveFlag, ShowMaster, ShowCombos, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 1136: Cache.Insert(CacheStr, DS, null, DateTime.Now.AddMinutes(Convert2Integer(Application["CacheTime2"])), System.Web.Caching.Cache.NoSlidingExpiration);
Line 1137: Cache.Insert(CacheStr2, NoPages, null, DateTime.Now.AddMinutes(Convert2Integer(Application["CacheTime2"])), System.Web.Caching.Cache.NoSlidingExpiration);
Line 1138: }
Line 1139: }
Line 1140: }
Line 1141: else
Line 1142: {
Line 1143: DS = (DataSet)Cache[CacheStr];
Line 1144: NoPages = Convert2Integer(Cache[CacheStr2]);
Line 1145: }
Line 1146: }
Line 1147: else
Line 1148: {
Line 1149: TrackCacheStatistics("GetShopItemsInCategoryMiscMFFCache", 2);
Line 1150: DS = myShop.GetShopItemsInCategoryMisc(Convert2Integer(Application["ShopId"]), CategoryId, fField1, fField2, sField1, sField2, HotDeal, ActiveFlag, ShowMaster, ShowCombos, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 1151: }
Line 1152: return(DS);
Line 1153: }
Line 1154:
Line 1155: DataSet GetShopItemsInCategoryMiscPathCache(long CategoryId, long OrderBy, long Direction, long PageNo, long PageSize, ref long NoPages, SAN_Shop.Shop myShop) {
Line 1156: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1157: NoPages = 0;
Line 1158:
Line 1159: DataSet DS = null;
Line 1160: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopItemsInCategoryMiscPathCacheMFFCache_" + Trim(CategoryId) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 1161: String CacheStr2 = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopItemsInCategoryMiscPathCacheNoPagesMFFCache_" + Trim(CategoryId) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 1162: CacheStr = CalculateMD5Hash(CacheStr);
Line 1163: CacheStr2 = CalculateMD5Hash(CacheStr2);
Line 1164: TrackCacheStatistics("GetShopItemsInCategoryMiscPathCacheMFFCache", 1);
Line 1165:
Line 1166: if (CacheMethods == 1)
Line 1167: {
Line 1168: if (Cache[CacheStr] == null || Cache[CacheStr2] == null)
Line 1169: {
Line 1170: InitAppLock(CacheStr);
Line 1171: lock (CacheStr)
Line 1172: {
Line 1173: if (Cache[CacheStr] == null || Cache[CacheStr2] == null)
Line 1174: {
Line 1175: TrackCacheStatistics("GetShopItemsInCategoryMiscPathCacheMFFCache", 2);
Line 1176: DS = myShop.GetShopItemsInCategoryMiscPath(Convert2Integer(Application["ShopId"]), CategoryId, -9999, -9999, "@@Not count@@", "@@Not count@@", -1, 1, 0, 1, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 1177: Cache.Insert(CacheStr, DS, null, DateTime.Now.AddMinutes(Convert2Integer(Application["CacheTime1"])), System.Web.Caching.Cache.NoSlidingExpiration);
Line 1178: Cache.Insert(CacheStr2, NoPages, null, DateTime.Now.AddMinutes(Convert2Integer(Application["CacheTime1"])), System.Web.Caching.Cache.NoSlidingExpiration);
Line 1179: }
Line 1180: }
Line 1181: }
Line 1182: else
Line 1183: {
Line 1184: DS = (DataSet)Cache[CacheStr];
Line 1185: NoPages = Convert2Integer(Cache[CacheStr2]);
Line 1186: }
Line 1187: }
Line 1188: else
Line 1189: {
Line 1190: TrackCacheStatistics("GetShopItemsInCategoryMiscPathCacheMFFCache", 2);
Line 1191: DS = myShop.GetShopItemsInCategoryMiscPath(Convert2Integer(Application["ShopId"]), CategoryId, -9999, -9999, "@@Not count@@", "@@Not count@@", -1, 1, 0, 1, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 1192: }
Line 1193: return(DS);
Line 1194: }
Line 1195:
Line 1196: DataSet SearchShopStaticPagesCache(String SearchStr, long TypeId, long SearchContent, long LangId, long OrderBy, long Direction, long PageNo, long PageSize, ref long NoPages, SAN_StaticPage.StaticPage myStaticPage) {
Line 1197: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1198: NoPages = 0;
Line 1199:
Line 1200: DataSet DS = null;
Line 1201: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_SearchShopStaticPagesMFFCache_" + Trim(GenerateFriendlyName(SearchStr)) + Trim(TypeId) + "_" + Trim(SearchContent) + "_" + Trim(LangId) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 1202: String CacheStr2 = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_SearchShopStaticPagesNoPagesMFFCache_" + Trim(GenerateFriendlyName(SearchStr)) + Trim(TypeId) + "_" + Trim(SearchContent) + "_" + Trim(LangId) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 1203: CacheStr = CalculateMD5Hash(CacheStr);
Line 1204: CacheStr2 = CalculateMD5Hash(CacheStr2);
Line 1205: TrackCacheStatistics("SearchShopStaticPagesMFFCache", 1);
Line 1206:
Line 1207: if (CacheMethods == 1)
Line 1208: {
Line 1209: if (Cache[CacheStr] == null || Cache[CacheStr2] == null)
Line 1210: {
Line 1211: InitAppLock(CacheStr);
Line 1212: lock (CacheStr)
Line 1213: {
Line 1214: if (Cache[CacheStr] == null || Cache[CacheStr2] == null)
Line 1215: {
Line 1216: TrackCacheStatistics("SearchShopStaticPagesMFFCache1", 2);
Line 1217:
Line 1218: DS = myStaticPage.SearchShopStaticPages(Convert2Integer(Application["ShopId"]), SearchStr, TypeId, SearchContent, LangId, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 1219: Cache.Insert(CacheStr, DS, null, DateTime.Now.AddMinutes(Convert2Integer(Application["CacheTime3"])), System.Web.Caching.Cache.NoSlidingExpiration);
Line 1220: Cache.Insert(CacheStr2, NoPages, null, DateTime.Now.AddMinutes(Convert2Integer(Application["CacheTime3"])), System.Web.Caching.Cache.NoSlidingExpiration);
Line 1221: }
Line 1222: }
Line 1223: }
Line 1224: else
Line 1225: {
Line 1226: DS = (DataSet)Cache[CacheStr];
Line 1227: NoPages = Convert2Integer(Cache[CacheStr2]);
Line 1228: }
Line 1229: }
Line 1230: else
Line 1231: {
Line 1232: TrackCacheStatistics("SearchShopStaticPagesMFFCache", 2);
Line 1233: DS = myStaticPage.SearchShopStaticPages(Convert2Integer(Application["ShopId"]), SearchStr, TypeId, SearchContent, LangId, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 1234: }
Line 1235: return(DS);
Line 1236: }
Line 1237:
Line 1238:
Line 1239: DataSet GetShopItemsInCategoryStaticPathCache(long CategoryId, SAN_StaticPage.StaticPage myStaticPage) {
Line 1240: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1241: String CacheLabel = "GetShopItemsInCategoryStaticPathCacheMFF3";
Line 1242: TrackCacheStatistics(CacheLabel, CacheMethods);
Line 1243: Boolean HasException = false;
Line 1244: Boolean HasValue = false;
Line 1245: long NoPages = 0;
Line 1246:
Line 1247: DataSet DS = null;
Line 1248: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopItemsInCategoryStaticPathCacheMFF_" + Trim(CategoryId);
Line 1249: CacheStr = CalculateMD5Hash(CacheStr);
Line 1250: TrackCacheStatistics(CacheLabel, 1);
Line 1251:
Line 1252: if (CacheMethods==1) {
Line 1253: DS = GetNativeCacheDataSet(CacheStr, ref HasValue);
Line 1254: if (!HasValue) {
Line 1255: TrackCacheStatistics(CacheLabel, 2);
Line 1256: DS = myStaticPage.GetShopItemsInCategoryStaticPath(Convert2Integer(Application["ShopId"]), CategoryId, 1, 1, 1, 10000, ref NoPages);
Line 1257: SetNativeCacheDataSet(CacheStr, DS, Convert2Integer(Application["CacheTime4"]));
Line 1258: }
Line 1259: }
Line 1260: else {
Line 1261: TrackCacheStatistics(CacheLabel, 2);
Line 1262: DS = myStaticPage.GetShopItemsInCategoryStaticPath(Convert2Integer(Application["ShopId"]), CategoryId, 1, 1, 1, 10000, ref NoPages);
Line 1263: }
Line 1264:
Line 1265: return(DS);
Line 1266: }
Line 1267:
Line 1268: DataSet GetShopTablesLookupWithCategoryCache(long CategoryId, SAN_Shop.Shop myShop) {
Line 1269: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1270: String CacheLabel = "GetShopTablesLookupWithCategoryCacheMFF13";
Line 1271: TrackCacheStatistics(CacheLabel, CacheMethods);
Line 1272: Boolean HasException = false;
Line 1273: Boolean HasValue = false;
Line 1274: long NoPages = 0;
Line 1275:
Line 1276: DataSet DS = null;
Line 1277: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopTablesLookupWithCategoryCacheMFF_" + Trim(CategoryId);
Line 1278: CacheStr = CalculateMD5Hash(CacheStr);
Line 1279: TrackCacheStatistics(CacheLabel, 1);
Line 1280:
Line 1281: if (CacheMethods==1) {
Line 1282: DS = GetNativeCacheDataSet(CacheStr, ref HasValue);
Line 1283: if (!HasValue) {
Line 1284: TrackCacheStatistics(CacheLabel, 2);
Line 1285: DS = myShop.GetShopTablesLookupWithCategory(Convert2Integer(Application["ShopId"]), CategoryId);
Line 1286: SetNativeCacheDataSet(CacheStr, DS, Convert2Integer(Application["CacheTime3"]));
Line 1287: }
Line 1288: }
Line 1289: else {
Line 1290: TrackCacheStatistics(CacheLabel, 2);
Line 1291: DS = myShop.GetShopTablesLookupWithCategory(Convert2Integer(Application["ShopId"]), CategoryId);
Line 1292: }
Line 1293:
Line 1294: return(DS);
Line 1295: }
Line 1296:
Line 1297: String GetShopCategoryStaticDescriptionCache(long CategoryId, long LangId, SAN_StaticPage.StaticPage myStaticPage) {
Line 1298: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1299: String CacheLabel = "GetShopCategoryStaticDescriptionCacheMFF3";
Line 1300: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 1301: Boolean HasException = false;
Line 1302: Boolean HasValue = false;
Line 1303:
Line 1304: String strValue = "";
Line 1305: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopCategoryStaticDescriptionCacheMFF_" + Trim(CategoryId) + "_" + Trim(LangId);
Line 1306: CacheStr = CalculateMD5Hash(CacheStr);
Line 1307: TrackCacheStatistics(CacheLabel, 1);
Line 1308:
Line 1309: if (CacheMethods==1) {
Line 1310: strValue = GetNativeCacheString(CacheStr, ref HasValue);
Line 1311: if (!HasValue) {
Line 1312: TrackCacheStatistics(CacheLabel, 2);
Line 1313: strValue = Trim(myStaticPage.GetShopCategoryStaticDescription(Convert2Integer(Application["ShopId"]), CategoryId));
Line 1314: strValue = GetLanguagePart(strValue, LangId);
Line 1315:
Line 1316: SetNativeCacheString(CacheStr, strValue, Convert2Integer(Application["CacheTime1"]));
Line 1317: }
Line 1318: }
Line 1319: else {
Line 1320: TrackCacheStatistics(CacheLabel, 2);
Line 1321: strValue = Trim(myStaticPage.GetShopCategoryStaticDescription(Convert2Integer(Application["ShopId"]), CategoryId));
Line 1322: strValue = GetLanguagePart(strValue, LangId);
Line 1323: }
Line 1324:
Line 1325: return(strValue);
Line 1326: }
Line 1327:
Line 1328: String GetProductURLCache(long ProductId, String QString, long LangId, SAN_Shop.Shop myShop) {
Line 1329: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1330: String CacheLabel = "GetProductURLMFF111";
Line 1331: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 1332: long CacheTime = Convert2Integer(Application["CacheTime1"]);
Line 1333: Boolean HasException = false;
Line 1334: Boolean HasValue = false;
Line 1335:
Line 1336: String strValue = "";
Line 1337: String CacheStr = GenerateFriendlyName(Trim(Application["SiteURL"]).Replace(".myfashionfruit.com", "myfashionfruit")) + "_" + CacheLabel + "_" + Trim(ProductId) + "_" + Trim(GenerateFriendlyName(QString)) + "_" + Trim(LangId);
Line 1338: CacheStr = CalculateMD5Hash(CacheStr);
Line 1339: TrackCacheStatistics(CacheLabel, 1);
Line 1340:
Line 1341: if (CacheMethods==1) {
Line 1342: strValue = GetNativeCacheString(CacheStr, ref HasValue);
Line 1343: if (!HasValue) {
Line 1344: TrackCacheStatistics(CacheLabel, 2);
Line 1345: strValue = GenerateProductURL(ProductId, QString, LangId, myShop);
Line 1346: SetNativeCacheString(CacheStr, strValue, CacheTime);
Line 1347: }
Line 1348: }
Line 1349: else {
Line 1350: TrackCacheStatistics(CacheLabel, 2);
Line 1351: strValue = GenerateProductURL(ProductId, QString, LangId, myShop);
Line 1352: }
Line 1353: return(strValue);
Line 1354: }
Line 1355:
Line 1356: String GetSearchURLCache(long CategoryId, String QString, long LangId, SAN_Shop.Shop myShop)
Line 1357: {
Line 1358: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1359: String CacheLabel = "GetSearchURLCacheMFFF1";
Line 1360: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 1361: long CacheTime = Convert2Integer(Application["CacheTime1"]);
Line 1362: Boolean HasException = false;
Line 1363: Boolean HasValue = false;
Line 1364:
Line 1365: String strValue = "";
Line 1366: String CacheStr = GenerateFriendlyName(Trim(Application["SiteURL"]).Replace(".myfashionfruit.com", "myfashionfruit")) + "_" + CacheLabel + "_" + Trim(CategoryId) + "_" + Trim(GenerateFriendlyName(QString)) + "_" + Trim(LangId);
Line 1367: CacheStr = CalculateMD5Hash(CacheStr);
Line 1368: TrackCacheStatistics(CacheLabel, 1);
Line 1369:
Line 1370: if (CacheMethods==1) {
Line 1371: strValue = GetNativeCacheString(CacheStr, ref HasValue);
Line 1372: if (!HasValue) {
Line 1373: TrackCacheStatistics(CacheLabel, 2);
Line 1374: strValue = GenerateSearchURL(CategoryId, QString, LangId, myShop);
Line 1375: SetNativeCacheString(CacheStr, strValue, CacheTime);
Line 1376: }
Line 1377: }
Line 1378: else {
Line 1379: TrackCacheStatistics(CacheLabel, 2);
Line 1380: strValue = GenerateSearchURL(CategoryId, QString, LangId, myShop);
Line 1381: }
Line 1382: return(strValue);
Line 1383:
Line 1384: }
Line 1385:
Line 1386: String GetBannerAdvertismentCache(long FarmId, long ZoneId, long CategoryId, String ScriptName, long border) {
Line 1387: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1388: String CacheLabel = "GetBannerAdvertismentCacheMFF3";
Line 1389: TrackCacheStatistics(CacheLabel, CacheMethods + 10);
Line 1390: Boolean HasException = false;
Line 1391: Boolean HasValue = false;
Line 1392:
Line 1393: String strValue = "";
Line 1394: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetBannerAdvertismentCacheMFF4_" + Trim(FarmId) + "_" + Trim(ZoneId) + "_" + Trim(CategoryId) + "_" + Trim(border) + "_" + Trim(ScriptName);
Line 1395: CacheStr = CalculateMD5Hash(CacheStr);
Line 1396: TrackCacheStatistics(CacheLabel, 1);
Line 1397:
Line 1398: if (CacheMethods==1) {
Line 1399: strValue = GetNativeCacheString(CacheStr, ref HasValue);
Line 1400: if (!HasValue) {
Line 1401: TrackCacheStatistics(CacheLabel, 2);
Line 1402: strValue = GetBannerAdvertisment(FarmId, ZoneId, CategoryId, ScriptName, border);
Line 1403:
Line 1404: SetNativeCacheString(CacheStr, strValue, Convert2Integer(Application["CacheTime4"]));
Line 1405: }
Line 1406: }
Line 1407: else {
Line 1408: TrackCacheStatistics(CacheLabel, 2);
Line 1409: strValue = GetBannerAdvertisment(FarmId, ZoneId, CategoryId, ScriptName, border);
Line 1410: }
Line 1411:
Line 1412: return(strValue);
Line 1413: }
Line 1414:
Line 1415: DataSet GetShopFilesInCategoryPathCache(long CategoryId, String Name, long TypeId, long Active, long OrderBy, long Direction, long PageNo, long PageSize, SAN_Shop.Shop myShop) {
Line 1416: long CacheMethods = Convert2Integer(Application["CacheMethods"]);
Line 1417: String CacheLabel = "GetShopFilesInCategoryPathCacheMFF3";
Line 1418: TrackCacheStatistics(CacheLabel, CacheMethods);
Line 1419: Boolean HasException = false;
Line 1420: Boolean HasValue = false;
Line 1421: long NoPages = 0;
Line 1422:
Line 1423: DataSet DS = null;
Line 1424: String CacheStr = GenerateFriendlyName(Trim(Session["SiteURL"])) + "_GetShopFilesInCategoryPathCacheMFF3_" + Trim(CategoryId) + "_" + Trim(GenerateFriendlyName(Name)) + "_" + Trim(TypeId) + "_" + Trim(Active) + "_" + Trim(OrderBy) + "_" + Trim(Direction) + "_" + Trim(PageNo) + "_" + Trim(PageSize);
Line 1425: CacheStr = CalculateMD5Hash(CacheStr);
Line 1426: TrackCacheStatistics(CacheLabel, 1);
Line 1427:
Line 1428: if (CacheMethods==1) {
Line 1429: DS = GetNativeCacheDataSet(CacheStr, ref HasValue);
Line 1430: if (!HasValue) {
Line 1431: TrackCacheStatistics(CacheLabel, 2);
Line 1432: DS = myShop.GetShopFilesInCategoryPath(Convert2Integer(Application["ShopId"]), CategoryId, Name, TypeId, Active, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 1433: SetNativeCacheDataSet(CacheStr, DS, Convert2Integer(Application["CacheTime1"]));
Line 1434: }
Line 1435: }
Line 1436: else {
Line 1437: TrackCacheStatistics(CacheLabel, 2);
Line 1438: DS = myShop.GetShopFilesInCategoryPath(Convert2Integer(Application["ShopId"]), CategoryId, Name, TypeId, Active, OrderBy, Direction, PageNo, PageSize, ref NoPages);
Line 1439: }
Line 1440:
Line 1441: return(DS);
Line 1442: }
Line 1443:
Line 1444: </SCRIPT>
Line 1445:
|