Login
|
Shopping Cart (0)
Home
Features
Products
Testimonials
Portfolio
DevNet Partners
Customer Service
Customer Service
Your Account
Downloads
View/Manage Licenses
Contact Us
Technical Support
Knowledge Base
Community Forums
Online Manual
Site Map
DevNet Partners
Custom Solutions
Vendor System Integrations
Features
Features Matrix
Developer SDK/Source Code
FAQs
PABP Certified/Visa Approved
DevNet Partners
Marketplace Add-Ons
3rd Party System Integrations
Hosting Partners
Merchant Accounts
Verified By Visa Info
Home
About Us
News & Announcements
Press Room
Free Trial
Sales Webinars
Portfolio
Client Gallery
More Customer Sites
Products
AspDotNetStorefront ML/Express
AspDotNetStorefront ML
AspDotNetStorefront ML/64
AspDotNetStorefront Multi-Store
Developer Packs
Reseller Discounts
View All Products
Click Here to Buy Now!
Click here to Start a Free Trial!
AspDotNetStorefront Shopping Cart ECommerce - C# Source Code Samples
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
|
FAQs
|
Testimonials
|
Custom Development
|
E-Commerce 101
|
Merchant Accounts
|
Marketplace
Copyright ©1997-2010. All Rights Reserved.
Powered by the AspDotNetStorefront,
(ML v9/asp.net 3.5).
Patent Pending.
All logos and brands trademarks of respective companies shown.
shopping cart software
shopping cart
asp.net shopping cart
asp.net e-commerce
asp shopping cart
ecommerce
ecommerce software
selling online
online storefront