Login
|
View Cart (0)
Questions? (602) 490-0243
Platforms
Shopping Cart Software
MSx
MS Express
MoreStores
Source Code for MSx
Source Code for ML8
MSx Features
Portfolio
DotFeed
About DotFeed
Amazon Product Ads
Google Product Search
TheFind
FAQ
Add-Ons
E-commerce Hosting
Hosting Packages
PCI, Security & SSL Certificates
Hosting FAQ
Hosting Specification
Hosting Agreement
Partners
Custom Development Partners
Payment Partners
All Partners
Technology
PCI Course for Developers
Developer Knowledge
C# Code Samples
VB.Net Code Samples
Skinning and Themes
SQL Schema
Academy
Blog
Webinars
Conference
Knowledgebase
Community Forums
Online Manual
Support
My Account
My Licenses
My DotFeed
My Mobile Manager
Update Rights
About Us
Contact Us
Technical Support
Testimonials
News & Announcements
Jobs
Knowledge Base
Online Manual
Site Map
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(); }