English
Español
Chinese
AspDotNetStorefront ML v7.0 is VISA Payment Application Best Practices (PABP) Certified.
Attend our next Webinar
about
news
free trial
gallery
products
features
downloads
site map
contact
Login
shopping cart :
0 items
home
features matrix
VISA PABP certified
Verified By Visa/3-D Secure
testimonials
SEO friendly
no monthly fees
hosting
FAQs
DevNet: custom projects
Marketplace: Add-Ons
Merchant Accounts
account
support
upgrades
Learn More
SAMPLE C# CODE FRAGMENTS
// age the cart based on store admin settings: int AgeCartDays = AppLogic.AppConfigUSInt("AgeCartDays"); if(AgeCartDays == 0) { AgeCartDays = 7; // apply a default } ShoppingCart.Age(ThisCustomer.CustomerID,AgeCartDays,CartTypeEnum.ShoppingCart); // now load the cart: ShoppingCart cart = new ShoppingCart(base.EntityHelpers,SiteID,ThisCustomer, CartTypeEnum.ShoppingCart,0,false); // developer has specified that this page should be rendered in XmlPackage engine: String CartXmlPackage = AppLogic.AppConfig("Xml.ShoppingCartPage"); if(CartXmlPackage.Length != 0) { writer.Write(AppLogic.RunXmlPackage(CartXmlPackage,base.GetParser,ThisCustomer, SiteID,String.Empty,String.Empty,true,true)); } else { ... }
// very typical page setup logic, leveraging SkinBase base class: if(AppLogic.AppConfigBool("GoNonSecureAgain")) { SkinBase.GoNonSecureAgain(); } if(Common.IsInteger(Common.QueryString("topic"))) { t = new Topic(Common.QueryStringUSInt("topic"),ThisCustomer.LocaleSetting,SiteID,base.GetParser); } else { t = new Topic(Common.QueryString("topic"),ThisCustomer.LocaleSetting,SiteID,base.GetParser); } if(t.ContentsBGColor.Length != 0) { SkinBase.ContentsBGColor = t.ContentsBGColor; } if(t.PageBGColor.Length != 0) { SkinBase.PageBGColor = t.PageBGColor; } if(t.GraphicsColor.Length != 0) { SkinBase.GraphicsColor = t.GraphicsColor; } SectionTitle = t.SectionTitle; SETitle = t.SETitle; SEKeywords = t.SEKeywords; SEDescription = t.SEDescription; ...
using System.Globalization; using AspDotNetStorefrontCommon; namespace AspDotNetStorefrontGateways { ///
/// Summary description for AuthorizeNet. ///
public class AuthorizeNet { public AuthorizeNet() {} static public String CaptureOrder(int OrderNumber) { HttpContext.Current.Session["GatewayMsg"] = String.Empty; String result = "OK"; bool useLiveTransactions = AppLogic.AppConfigBool("UseLiveTransactions"); String TransID = LookupOrder(OrderNumber); ... } ... } }
// example class routine to build up part of the Yahoo! Site Map public String GetEntityYahooSiteMap(int ForParentEntityID, String LocaleSetting, bool AllowCaching, bool RecurseChildren) { // check for prebuilt cache hit: String CacheName = String.Format("GetEntityYahooSiteMap_{0}_{1}_{2}_{3}",m_EntitySpecs.m_EntityName,ForParentEntityID.ToString(),LocaleSetting,RecurseChildren.ToString()); bool CachingOn = AllowCaching && AppLogic.CachingOn && m_CacheMinutes != 0 && ForParentEntityID != 0; if(CachingOn) // just cache the root one :) { String Menu = (String)HttpContext.Current.Cache.Get(CacheName); if(Menu != null) { return Menu; } } String StoreLoc = AppLogic.GetStoreHTTPLocation(false); StringWriter tmpS = new StringWriter(); String XslFile = "EntityYahooSiteMap"; XslTransform xForm = new XslTransform(); xForm.Load(Common.SafeMapPath("EntityHelper/" + XslFile + ".xslt")); XsltArgumentList xslArgs = new XsltArgumentList(); xslArgs.AddParam("entity", "", m_EntitySpecs.m_EntityName); xslArgs.AddParam("ForParentEntityID", "", ForParentEntityID); xslArgs.AddParam("StoreLoc", "", StoreLoc); xForm.Transform(m_TblMgr.XmlDoc, xslArgs, tmpS, null); if(AppLogic.AppConfigBool("Xml.DumpTransform")) { try // don't let logging crash the site { StreamWriter sw = File.CreateText(Common.SafeMapPath(String.Format("{0}images/{1}_{2}_{3}.xfrm.xml",Common.IIF(AppLogic.IsAdminSite,"../",""),XslFile,m_EntitySpecs.m_EntityName,Common.IIF(AppLogic.IsAdminSite,"admin","store")))); sw.WriteLine(XmlCommon.PrettyPrintXml(tmpS.ToString())); sw.Close(); } catch {} } if(CachingOn) { HttpContext.Current.Cache.Insert(CacheName,tmpS.ToString(),null,System.DateTime.Now.AddMinutes(AppLogic.CacheDurationMinutes()),TimeSpan.Zero); } return tmpS.ToString(); }
Home
|
Contact
|
Terms Of Use
|
Privacy
|
Site Map
|
Features
|
Portfolio
|
Press
|
Products
|
Support
|
FAQs
|
Testimonials
|
Custom Development
Copyright ©1995-2008. All Rights Reserved.
Powered by AspDotNetStorefront
Shopping Cart
Software, (v7.0/asp.net 2.0). Patent Pending.
All logos and brands trademarks of respective companies shown.