protected void DisplayPageDs_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { WebpageType webpageType = WebpageType.ProductDisplay; switch (_pageType) { case PageType.Product: webpageType = WebpageType.ProductDisplay; break; case PageType.Category: webpageType = WebpageType.CategoryDisplay; break; } e.InputParameters["webpageType"] = webpageType; }
private Webpage AddNewWebpage(string name, string summary, string description, string layoutpath, WebpageType webpageType, IList <string> errorList) { try { Layout layout = null; if (!string.IsNullOrEmpty(layoutpath)) { layout = new Layout(layoutpath); } Webpage webpage = new Webpage(AbleContext.Current.Store, name, summary, description, null, null, layout, null, (byte)CatalogVisibility.Public); webpage.WebpageTypeId = (byte)webpageType; webpage.Save(); return(webpage); } catch (Exception ex) { errorList.Add(string.Format("An error occurred while adding webpage: '{0}', error: {1}", name, ex.Message)); } return(null); }