Esempio n. 1
0
 protected void _cropCommand_Click(object sender, EventArgs e)
 {
     try
     {
         var    x         = int.Parse(_xField.Value);
         var    y         = int.Parse(_yField.Value);
         var    width     = int.Parse(_widthField.Value);
         var    height    = int.Parse(_heightField.Value);
         string imageName = Convert.ToString(ViewState["ImageToBeEdit"]);
         string source    = Server.MapPath("~/Modules/Sage_Banner/images/OriginalImage/" + imageName);
         string dest      = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Default/");
         InterceptImageController.ResizeBannerImageAndCrop(source, width, height, dest, imageName);
         string soruceFolder = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Default/");
         string SourcePath   = soruceFolder + imageName;
         string thumbMedium  = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Medium/");
         string thumbSmall   = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Small/");
         string thumbLarge   = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Large/");
         InterceptImageController.ResizeBannerImage(SourcePath, 965, thumbLarge, imageName);
         InterceptImageController.ResizeBannerImage(SourcePath, 768, thumbMedium, imageName);
         InterceptImageController.ResizeBannerImage(SourcePath, 320, thumbSmall, imageName);
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
     divImageEditor.Attributes.Add("style", "display:none");
     pnlBannercontainer.Attributes.Add("style", "display:block");
     ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/Sage_Banner/ModuleLocalText", "ImageEditedSuccesfully"), "", SageMessageType.Success);
 }
    private void BindAllServices()
    {
        string serviceModulePath      = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(serviceModulePath);
        string pageExtension = SageFrameSettingKeys.PageExtension;
        ServiceItemController         objService        = new ServiceItemController();
        List <ServiceItemSettingInfo> lstServiceSetting = objService.GetServiceItemSetting(aspxCommonObj);

        if (lstServiceSetting != null && lstServiceSetting.Count > 0)
        {
            foreach (var serviceSetting in lstServiceSetting)
            {
                isEnableService       = serviceSetting.IsEnableService.ToString();
                serviceCategoryInARow = serviceSetting.ServiceCategoryInARow.ToString();
                serviceCategoryCount  = serviceSetting.ServiceCategoryCount.ToString();
                isEnableServiceRss    = serviceSetting.IsEnableServiceRss.ToString();
                serviceRssCount       = serviceSetting.ServiceRssCount.ToString();
                serviceDetailsPage    = serviceSetting.ServiceDetailsPage;
                serviceRssPage        = serviceSetting.ServiceRssPage;
            }
        }
        List <ServiceCategoryInfo> lstAllService = objService.GetAllServices(aspxCommonObj);
        StringBuilder allServiceViewBld          = new StringBuilder();

        allServiceViewBld.Append("<div id=\"divBindAllServices\" class=\"cssClassAllService\">");
        if (lstAllService != null && lstAllService.Count > 0)
        {
            foreach (var allserviceInfo in lstAllService)
            {
                string serviceName = allserviceInfo.ServiceName;
                string imagePath   = "Modules/AspxCommerce/AspxCategoryManagement/uploads/" + allserviceInfo.ServiceImagePath;
                if (allserviceInfo.ServiceImagePath == "")
                {
                    imagePath = NoImageService;
                }
                else
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(allserviceInfo.ServiceImagePath, ImageType.Medium, ImageCategoryType.Category, aspxCommonObj);
                }
                var hrefServices = aspxRedirectPath + serviceDetailsPage + "/" + AspxUtility.fixedEncodeURIComponent(serviceName) + pageExtension;
                allServiceViewBld.Append("<li><h3><a href=\"" + hrefServices + "\">");
                allServiceViewBld.Append("<div class=\"cssClassImgWrapper\">");
                allServiceViewBld.Append("<img src=\"" + aspxRootPath +
                                         imagePath.Replace("uploads", "uploads/Medium") +
                                         "\"/>");
                allServiceViewBld.Append("</div>" + serviceName + "</a></h3></li>");
            }
        }
        else
        {
            allServiceViewBld.Append("<span class=\"cssClassNotFound\">" + getLocale("There are no services available!") +
                                     "</span>");
        }
        allServiceViewBld.Append("</div>");
        ltrBindAllServices.Text = allServiceViewBld.ToString();
    }
Esempio n. 3
0
    public void GetAllBrandForSlider()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        string aspxRootPath = ResolveUrl("~/");

        hst = AppLocalized.getLocale(BrandModulePath);
        string pageExtension             = SageFrameSettingKeys.PageExtension;
        AspxBrandViewController objBrand = new AspxBrandViewController();
        List <BrandViewInfo>    lstBrand = objBrand.GetAllBrandForSlider(aspxCommonObj, BrandCount);
        StringBuilder           element  = new StringBuilder();

        if (lstBrand != null && lstBrand.Count > 0)
        {
            element.Append("<ul id=\"brandSlider\">");
            foreach (BrandViewInfo value in lstBrand)
            {
                var       imagepath = aspxRootPath + value.BrandImageUrl;
                string [] imageFile = value.BrandImageUrl.ToString().Split('/');
                if (value.BrandImageUrl != "")
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(imageFile[imageFile.Length - 1], ImageType.Small, ImageCategoryType.Brand, aspxCommonObj);
                }
                element.Append("<li><a href=\"");
                element.Append(aspxRedirectPath);
                element.Append("brand/");
                element.Append(AspxUtility.fixedEncodeURIComponent(value.BrandName));
                element.Append(pageExtension);
                element.Append("\"><img brandId=\"");
                element.Append(value.BrandID);
                element.Append("\" src=\"");
                element.Append(imagepath.Replace("uploads", "uploads/Small"));
                element.Append("\" alt=\"");
                element.Append(value.BrandName);
                element.Append("\" title=\"");

                element.Append(value.BrandName);
                element.Append("\"  /></a></li>");
            }
            element.Append("</ul>");
            element.Append("<span class=\"cssClassViewMore\"><a href=\"");
            element.Append(aspxRedirectPath);
            element.Append(BrandAllPage);
            element.Append(pageExtension);
            element.Append("\">" + getLocale("View All Brands") + "</a></span>");
        }

        else
        {
            element.Append("<span class='cssClassNotFound'>");
            element.Append(getLocale("The store has no brand!"));
            element.Append("</span>");
        }
        litSlide.Text = element.ToString();
    }
Esempio n. 4
0
    private void GetNewItemTagRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
    {
        try
        {
            string             noImageUrl = string.Empty;
            StoreSettingConfig ssc        = new StoreSettingConfig();
            noImageUrl = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, aspxCommonObj.StoreID,
                                                   aspxCommonObj.PortalID, aspxCommonObj.CultureName);
            string[]             path          = pageURL.Split('?');
            string               pagepath      = path[0];
            string               x             = HttpContext.Current.Request.ApplicationPath;
            string               authority     = HttpContext.Current.Request.Url.Authority;
            string               pageUrl       = authority + x;
            List <RssFeedNewTag> popularTagRss = AspxRssFeedProvider.GetNewTagsRssContent(aspxCommonObj, rssOption, count);
            foreach (RssFeedNewTag rssItemData in popularTagRss)
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", rssItemData.TagName);
                rssXml.WriteElementString("link",
                                          "http://" + pageUrl + "/tagsitems/tags" +
                                          SageFrameSettingKeys.PageExtension + "?tagsId=" + rssItemData.TagIDs + "");
                rssXml.WriteStartElement("description");

                var description = "";

                description += "<div><h2>Tag Name: " + rssItemData.TagName + "</h2></br><h2><span>Tag Status: " +
                               rssItemData.TagStatus +
                               "</span></h2><ul style=list-style-type: none><h2> Taged Item:</h2>";
                foreach (var tagItemInfo in rssItemData.TagItemInfo)
                {
                    string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + tagItemInfo.ImagePath;
                    if (tagItemInfo.ImagePath == "")
                    {
                        imagePath = noImageUrl;
                    }
                    else
                    {   //Resize Image Dynamically
                        InterceptImageController.ImageBuilder(tagItemInfo.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                    }
                    description += "<li style=\"float: left;display: inline;padding-right: 50px\"><h2>" +
                                   tagItemInfo.ItemName + "</h2><a href=http://" + pageUrl + "/item/" +
                                   tagItemInfo.SKU + SageFrameSettingKeys.PageExtension + "><img alt=" +
                                   tagItemInfo.ItemName + " src=http://" + pageUrl + "/" +
                                   imagePath.Replace("uploads", "uploads/Small") + " /></a></li>";
                }
                description += "</ul></div>";
                rssXml.WriteCData(description);
                rssXml.WriteEndElement();
                rssXml.WriteElementString("pubDate", rssItemData.AddedOn);
                rssXml.WriteEndElement();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 5
0
    private void GetLowStockItemRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
    {
        try
        {
            string             noImageUrl = string.Empty;
            StoreSettingConfig ssc        = new StoreSettingConfig();
            noImageUrl = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, aspxCommonObj.StoreID,
                                                   aspxCommonObj.PortalID, aspxCommonObj.CultureName);
            string[] path      = pageURL.Split('?');
            string   pagepath  = path[0];
            string   x         = HttpContext.Current.Request.ApplicationPath;
            string   authority = HttpContext.Current.Request.Url.Authority;
            string   pageUrl   = authority + x;
            List <RssFeedLowStock> bestSellItemRss = AspxRssFeedProvider.GetLowStockItemRssContent(aspxCommonObj, rssOption, count);
            foreach (RssFeedLowStock rssItemData in bestSellItemRss)
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", rssItemData.ItemName);
                rssXml.WriteElementString("link",
                                          "http://" + pageUrl + "/item/" + rssItemData.SKU +
                                          SageFrameSettingKeys.PageExtension);
                rssXml.WriteStartElement("description");
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + rssItemData.ImagePath;
                if (rssItemData.ImagePath == "")
                {
                    imagePath = noImageUrl;
                }
                else
                {   //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(rssItemData.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                }
                var description = "";
                description = "<div><a href=http://" + pageUrl + "/item/" + rssItemData.SKU +
                              SageFrameSettingKeys.PageExtension + "><img alt=" +
                              rssItemData.ItemName + " src=http://" + pageUrl + "/" +
                              imagePath.Replace("uploads", "uploads/Small") + " /> </a>";

                description += "<div class=\"itemTable\"><table width=\"20%\">";
                description += "<tr><td><h2>Price: </h2>" + rssItemData.Price + "</td><td><h2>Quantity: </h2>" +
                               rssItemData.Quantity + "</td></tr>";
                description += "<tr><td><h2>Status: </h2>" + rssItemData.Status + "</td><td></td></tr>";
                description += "</table></div>";
                description += "</div>";
                rssXml.WriteCData(description);
                rssXml.WriteEndElement();
                rssXml.WriteElementString("pubDate", "");
                rssXml.WriteEndElement();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    public string BindChildCategory(List <MegaCategoryViewInfo> response, int categoryID, AspxCommonInfo aspxCommonObj)
    {
        StringBuilder strListmaker = new StringBuilder();
        string        childNodes   = string.Empty;

        foreach (MegaCategoryViewInfo eachCat in response)
        {
            if (eachCat.CategoryLevel > 0)
            {
                if (eachCat.ParentID == categoryID)
                {
                    strListmaker.Append("<li>");
                    strListmaker.Append("<a href=\"");
                    strListmaker.Append(aspxRedirectPath);
                    strListmaker.Append("category/");
                    string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue);
                    strListmaker.Append(strRet);
                    strListmaker.Append(SageFrameSettingKeys.PageExtension);
                    strListmaker.Append("\">");
                    strListmaker.Append(eachCat.AttributeValue);
                    strListmaker.Append("</a>");
                    childNodes = BindChildCategory(response, eachCat.CategoryID, aspxCommonObj);
                    if (childNodes != string.Empty)
                    {
                        strListmaker.Append("<ul>");
                        strListmaker.Append(childNodes);
                        strListmaker.Append("</ul>");
                    }
                    if (showSubCatImage == true)
                    {
                        if (eachCat.CategoryLevel == 1)
                        {
                            if (eachCat.CategoryImagePath != null && eachCat.CategoryImagePath != "")
                            {
                                //Resize Image Dynamically
                                InterceptImageController.ImageBuilder(eachCat.CategoryImagePath, ImageType.Medium, ImageCategoryType.Category, aspxCommonObj);
                                string imagePath = aspxRedirectPath + categoryImagePath + eachCat.CategoryImagePath;
                                strListmaker.Append("<div class=\"classMegaSubCatImage\"><img src=\"");
                                strListmaker.Append(imagePath.Replace("uploads", "uploads/Small"));
                                strListmaker.Append("\" alt=\"");
                                strListmaker.Append(eachCat.AttributeValue);
                                strListmaker.Append("\" title=\"");
                                strListmaker.Append(eachCat.AttributeValue);
                                strListmaker.Append("\" /></div>");
                            }
                        }
                    }
                    strListmaker.Append("</li>");
                }
            }
        }
        return(strListmaker.ToString());
    }
Esempio n. 7
0
    private void GetBrandRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
    {
        try
        {
            string[]            path            = pageURL.Split('?');
            string              pagepath        = path[0];
            string              x               = HttpContext.Current.Request.ApplicationPath;
            string              authority       = HttpContext.Current.Request.Url.Authority;
            string              pageUrl         = authority + x;
            List <RssFeedBrand> brandRssContent = AspxRssFeedProvider.GetBrandRssContent(aspxCommonObj, rssOption, count);
            foreach (RssFeedBrand rssFeedBrand in brandRssContent)
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", rssFeedBrand.BrandName);
                rssXml.WriteElementString("link",
                                          "http://" + pageUrl + "/brand/" + rssFeedBrand.BrandName + SageFrameSettingKeys.PageExtension);
                rssXml.WriteStartElement("description");
                string description = "";
                description += "<div>";
                description += "<div><a href=http://" + pageUrl + "/brand/" + rssFeedBrand.BrandName + SageFrameSettingKeys.PageExtension + ">";
                string[] brandURL   = rssFeedBrand.BrandImageUrl.Split('/');
                string   brandImage = brandURL[brandURL.Length - 1];
                if (brandImage != "")
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(brandImage, ImageType.Small, ImageCategoryType.Brand, aspxCommonObj);
                }
                description += "<img src=http://" + pageUrl + "/" + rssFeedBrand.BrandImageUrl.Replace("uploads", "uploads/Small") + "  />";
                description += "</a></div>";
                description += "<p>" + HttpUtility.HtmlDecode(rssFeedBrand.BrandDescription) + "</p>";

                description += "</div>";
                rssXml.WriteCData(description);
                rssXml.WriteEndElement();
                rssXml.WriteElementString("pubDate", rssFeedBrand.AddedOn);
                rssXml.WriteEndElement();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    private void BindWishList(AspxCommonInfo aspxCommonObj)
    {
        string modulePath    = this.AppRelativeTemplateSourceDirectory;
        string pageExtension = SageFrameSettingKeys.PageExtension;

        hst = AppLocalized.getLocale(modulePath);
        string aspxTemplateFolderPath = resolveUrl + "Templates/" + TemplateName;
        string aspxRootPath           = resolveUrl;
        string cssClass;

        DataSet ds = WishItemController.GetWishItemListDataSet(aspxCommonObj);

        #region WishList Setting
        if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
        {
            DataTable dtWishListSetting = ds.Tables[0];
            if (dtWishListSetting.Rows.Count > 0)
            {
                ShowImageInWishlist = bool.Parse(dtWishListSetting.Rows[0]["IsEnableImageInWishlist"].ToString());
            }
        }
        #endregion

        #region WishList Content Html
        StringBuilder wishListItems = new StringBuilder();

        DataTable dtWishItems = ds.Tables[1];
        RowTotal    = dtWishItems.Rows.Count;
        ArrayLength = (int)dtWishItems.Rows[0]["RowTotal"];

        #region Variables
        string imagePath = string.Empty, imagePathColumn = string.Empty, alternateText = string.Empty;
        string WishDate = string.Empty, cartUrl = string.Empty, href = string.Empty;

        int i = 0;

        StringBuilder dataContent = new StringBuilder();
        StringBuilder currencyContent;
        #endregion
        if (dtWishItems != null && RowTotal > 0)
        {
            wishListItems.Append("<thead><tr class=\"cssClassCommonCenterBoxTableHeading\"><th class=\"cssClassWishItemChkbox\"> <input type=\"checkbox\" id=\"chkHeading\"/></th>");
            if (ShowImageInWishlist)
            {
                wishListItems.Append("<th class=\"cssClassWishItemImg\"> <label class=\"sfLocale\">Image</label></th>");
            }
            wishListItems.Append("<th class=\"cssClassWishItemDetails\"><label id=\"lblItem\" class=\"sfLocale\">Item Details and Comment</label></th><th class=\"row-variants\"><label id=\"lblVariant\" class=\"sfLocale\">Variants</label></th>");
            if (bool.Parse(AllowAddToCart))
            {
                wishListItems.Append("<th class=\"cssClassAddToCart\"><span id=\"lblAddToCart\" class=\"sfLocale\">Add To Cart</span></th>");
            }
            wishListItems.Append("<th class=\"cssClassDelete\"><span class=\"\">Action</span></th></tr></thead><tbody>");

            foreach (DataRow dr in dtWishItems.Rows)
            {
                imagePath = string.Empty; imagePathColumn = string.Empty; alternateText = string.Empty;
                WishDate  = string.Empty; cartUrl = string.Empty; href = string.Empty;
                href      = "";
                cartUrl   = "";

                i++;

                imagePathColumn = dr["ImagePath"].ToString();
                alternateText   = dr["AlternateText"].ToString();
                imagePath       = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + imagePathColumn;
                if (string.IsNullOrEmpty(imagePathColumn))
                {
                    imagePath = NoImageWishList;
                }
                else if (string.IsNullOrEmpty(alternateText))
                {
                    alternateText = dr["ItemName"].ToString();
                    InterceptImageController.ImageBuilder(imagePathColumn, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                }
                else
                {
                    InterceptImageController.ImageBuilder(imagePathColumn, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                }
                WishDate = Convert.ToDateTime(dr["WishDate"]).ToShortDateString();
                var itemSKU     = new JavaScriptSerializer().Serialize(dr["SKU"]);
                var costVariant = new JavaScriptSerializer().Serialize(dr["CostVariantValueIDs"]);
                if (string.IsNullOrEmpty(dr["CostVariantValueIDs"].ToString()))
                {
                    cartUrl = "#";
                    href    = aspxRedirectPath + "item/" + dr["SKU"].ToString() + pageExtension;
                }
                else
                {
                    cartUrl = aspxRedirectPath + "item/" + dr["SKU"].ToString() + pageExtension + "?varId=" + dr["CostVariantValueIDs"];
                    href    = aspxRedirectPath + "item/" + dr["SKU"] + pageExtension + "?varId=" + dr["CostVariantValueIDs"];
                }

                #region DataContent StringBuilder
                dataContent = new StringBuilder();
                dataContent.Append("data-class=\"addtoCart\" data-type=\"button\" data-addtocart=\"");
                dataContent.Append("addtocart");
                dataContent.Append(dr["ItemID"]);
                dataContent.Append("\" data-title=\"");
                dataContent.Append(dr["ItemName"]);
                dataContent.Append("\" data-onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                dataContent.Append(dr["ItemID"]);
                dataContent.Append(",");
                dataContent.Append(dr["Price"]);
                dataContent.Append(",'");
                dataContent.Append(dr["SKU"]);
                dataContent.Append("',");
                dataContent.Append(1);
                dataContent.Append(",'");
                dataContent.Append(dr["IsCostVariantItem"]);
                dataContent.Append("',this);\"");
                #endregion

                if (i % 2 == 0)
                {
                    cssClass = "sfEven";
                    wishListItems.Append("<tr class=\"sfEven\" id=\"tr_");
                }
                else
                {
                    cssClass = "sfOdd";
                    wishListItems.Append("<tr class=\"sfOdd\" id=\"tr_");
                }
                #region Table Row
                wishListItems.Append("<tr class=\"");
                wishListItems.Append(cssClass);
                wishListItems.Append("\" id=\"tr_");
                wishListItems.Append(dr["ItemID"]);
                wishListItems.Append("\"><td class=\"cssClassWishItemChkbox\"><input type=\"checkbox\" id=\"");
                wishListItems.Append(dr["WishItemID"]);
                wishListItems.Append("\" class=\"cssClassWishItem\"/></td>");
                if (ShowImageInWishlist)
                {
                    wishListItems.Append("<td class=\"cssClassWishItemImg\">");
                    wishListItems.Append("<div class=\"cssClassImage\">");
                    wishListItems.Append("<img src=\"");
                    wishListItems.Append(aspxRootPath);
                    wishListItems.Append(imagePath.Replace("uploads", "uploads/Small"));
                    wishListItems.Append("\" alt=\"");
                    wishListItems.Append(alternateText);
                    wishListItems.Append("\" title=\"");
                    wishListItems.Append(alternateText);
                    wishListItems.Append("\"/>");
                    wishListItems.Append("</div></td>");
                }
                wishListItems.Append("<td class=\"cssClassWishItemDetails\"><a href=\"");
                wishListItems.Append(href);
                wishListItems.Append("\">");
                wishListItems.Append(dr["ItemName"]);
                wishListItems.Append("</a>");
                wishListItems.Append("<div class=\"cssClassWishDate\"><i class='i-calender'></i>");
                wishListItems.Append(WishDate);
                wishListItems.Append("</div>");
                wishListItems.Append("<div class=\"cssClassWishComment\"><textarea maxlength=\"600\" onkeyup=\"WishItem.ismaxlength(this);\"");
                wishListItems.Append(" id=\"comment_");
                wishListItems.Append(dr["WishItemID"]);
                wishListItems.Append("\" class=\"comment\">");
                wishListItems.Append(dr["Comment"]);
                wishListItems.Append("</textarea></div></td>");
                wishListItems.Append("<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=");
                wishListItems.Append(costVariant);
                wishListItems.Append("/>");
                wishListItems.Append("<span>");
                wishListItems.Append(dr["ItemCostVariantValue"]);
                wishListItems.Append("</span></td>");
                if (bool.Parse(AllowAddToCart))
                {
                    wishListItems.Append("<td class=\"cssClassWishToCart\">");
                    currencyContent = new StringBuilder();
                    currencyContent.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">");
                    currencyContent.Append(decimal.Parse(dr["Price"].ToString()).ToString("N2"));
                    currencyContent.Append("</span>");
                    if ((int)dr["ItemTypeID"] == 5)
                    {
                        wishListItems.Append("<p class=\"cssClassGroupPriceWrapper\">");
                        wishListItems.Append(getLocale("Starting At "));
                        wishListItems.Append(currencyContent);
                        wishListItems.Append("</p>");
                    }
                    else
                    {
                        wishListItems.Append(currencyContent);
                    }
                    wishListItems.Append("<div data-ItemTypeID=\"");
                    wishListItems.Append(dr["ItemTypeID"]);
                    wishListItems.Append("\" data-ItemID=\"");
                    wishListItems.Append(dr["ItemID"]);
                    wishListItems.Append("\"");
                    wishListItems.Append(dataContent);
                    wishListItems.Append(" class=\"sfButtonwrapper");
                    #region Allow Add To Cart
                    if (!bool.Parse(AllowOutStockPurchase))
                    {
                        #region Allow Out Stock Purchase True
                        if (dr["IsOutOfStock"] != null && (bool)dr["IsOutOfStock"])
                        {
                            #region Is Out Of Stock True
                            wishListItems.Append(" cssClassOutOfStock\">");
                            wishListItems.Append("<span class=\"cssClassOutStock\">");
                            wishListItems.Append(getLocale("Out Of Stock"));
                            wishListItems.Append("</span>");
                            #endregion
                        }
                        else
                        {
                            #region Is Out Of Stock False
                            wishListItems.Append("\">");
                            wishListItems.Append("<label class=\"i-cart cssClassCartLabel cssClassGreenBtn\"><button type=\"button\" class=\"addtoCart\"");
                            wishListItems.Append("addtocart=\"");
                            wishListItems.Append("addtocart");
                            wishListItems.Append(dr["ItemID"]);
                            wishListItems.Append("\" title=\"");
                            wishListItems.Append(dr["ItemName"]);
                            wishListItems.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            wishListItems.Append(dr["ItemID"]);
                            wishListItems.Append(",");
                            wishListItems.Append(dr["Price"]);
                            wishListItems.Append(",");
                            wishListItems.Append("'");
                            wishListItems.Append(dr["SKU"]);
                            wishListItems.Append("'");
                            wishListItems.Append(",");
                            wishListItems.Append(1);
                            wishListItems.Append(",'");
                            wishListItems.Append(dr["IsCostVariantItem"]);
                            wishListItems.Append("',this);\"><span>");
                            wishListItems.Append(getLocale("Cart +"));
                            wishListItems.Append("</span></button></label>");
                            #endregion
                        }
                        #endregion
                    }
                    else
                    {
                        #region Allow Out Stock Purchase False
                        wishListItems.Append("\">");
                        wishListItems.Append("<label class=\"i-cart cssClassCartLabel cssClassGreenBtn\"><button type=\"button\" class=\"addtoCart\"");
                        wishListItems.Append("addtocart=\"");
                        wishListItems.Append("addtocart");
                        wishListItems.Append(dr["ItemID"]);
                        wishListItems.Append("\" title=\"");
                        wishListItems.Append(dr["ItemName"]);
                        wishListItems.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                        wishListItems.Append(dr["ItemID"]);
                        wishListItems.Append(",");
                        wishListItems.Append(dr["Price"]);
                        wishListItems.Append(",");
                        wishListItems.Append("'");
                        wishListItems.Append(dr["SKU"]);
                        wishListItems.Append("'");
                        wishListItems.Append(",");
                        wishListItems.Append(1);
                        wishListItems.Append(",'");
                        wishListItems.Append(dr["IsCostVariantItem"]);
                        wishListItems.Append("',this);\"><span>");
                        wishListItems.Append(getLocale("Cart +"));
                        wishListItems.Append("</span></button></label>");
                        #endregion
                    }
                    wishListItems.Append("</div></td>");
                    #endregion
                }
                wishListItems.Append("<td class=\"cssClassDelete\">");
                wishListItems.Append("<a onclick=\"WishItem.Delete(");
                wishListItems.Append(dr["WishItemID"]);
                wishListItems.Append(")\" title=\"");
                wishListItems.Append(getLocale("Delete"));
                wishListItems.Append("\"><i class='i-delete' original-title=\"");
                wishListItems.Append(getLocale("Delete"));
                wishListItems.Append("\"></i></a>");
                wishListItems.Append("</td></tr>");
                #endregion
            }
            wishListItems.Append("</tbody>");
            /// wishListItems.Append("<script type=\"text/javascript\">$(document).ready(function(){$('.cssClassImage img[title]').tipsy({ gravity: 'n' });});</script>");

            StringBuilder wishLstButtonBdl = new StringBuilder();
            wishLstButtonBdl.Append("<label class='i-wishlist cssClassGreenBtn'><button type=\"button\" id=\"shareWishList\">");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Share Wishlist</span></button></label>");
            wishLstButtonBdl.Append(
                "<label class='i-update cssClassDarkBtn'><button type=\"button\" id=\"updateWishList\" onclick=\"WishItem.Update();\">");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Update Selected</span></button></label>");
            wishLstButtonBdl.Append(
                "<label class='i-clear cssClassGreyBtn'><button type=\"button\" id=\"clearWishList\" onclick=\"WishItem.Clear();\">");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Clear WishList</span></button></label>");
            wishLstButtonBdl.Append("<label class='i-delete cssClassGreenBtn'><button type=\"button\" id=\"btnDeletedMultiple\">");
            wishLstButtonBdl.Append("");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Delete Selected</span></button></label>");
            wishLstButtonBdl.Append("<label class='i-arrow-right cssClassDarkBtn'><button type=\"button\" id=\"continueInStore\">");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Continue Shopping</span></button ></label>");

            StringBuilder wishListPaginationBdl = new StringBuilder();
            wishListPaginationBdl.Append("<span class=\"sfLocale\">View Per Page: </span><select id=\"ddlWishListPageSize\" class=\"sfListmenu\"><option value=\"\"></option></select>");

            ltrWishListButon.Text      = wishLstButtonBdl.ToString();
            ltrWishListPagination.Text = wishListPaginationBdl.ToString();

            SortByList();
        }
        else
        {
            wishListItems.Append("<tr><td class=\"cssClassNotFound\">");
            wishListItems.Append(getLocale("Your wishlist is empty!"));
            wishListItems.Append("</td></tr>");
        }
        ltrWishList.Text = wishListItems.ToString();
        #endregion
    }
Esempio n. 9
0
    private void CompareItems(AspxCommonInfo aspxCommonObj)
    {
        string        aspxRootPath = ResolveUrl("~/");
        string        imagePath = string.Empty, ItemCostVariantValue = string.Empty, costVariantIds = string.Empty;
        int           totalRowsOfItem = 0;
        StringBuilder compareItemContent;
        DataSet       dsCompareItems = CompareItemController.GetCompareItemsDataSet(aspxCommonObj);

        if (dsCompareItems != null && dsCompareItems.Tables.Count == 2)
        {
            #region Compare Item Setting
            DataTable dtCompareItemSetting = dsCompareItems.Tables[0];
            if (dtCompareItemSetting != null && dtCompareItemSetting.Rows.Count > 0)
            {
                MaxCompareItemCount = int.Parse(dtCompareItemSetting.Rows[0]["CompareItemCount"].ToString());
                CompareItemListURL  = dtCompareItemSetting.Rows[0]["CompareDetailsPage"].ToString();
            }
            #endregion
            #region Bind Compare Items
            DataTable dtCompareItems = dsCompareItems.Tables[1];
            totalRowsOfItem    = dtCompareItems.Rows.Count;
            compareItemContent = new StringBuilder();
            int loopCount = (totalRowsOfItem < MaxCompareItemCount) ? totalRowsOfItem : MaxCompareItemCount;
            if (dtCompareItems != null && totalRowsOfItem > 0)
            {
                for (int i = 0; i < loopCount; i++)
                {
                    imagePath = dtCompareItems.Rows[i]["ImagePath"].ToString();
                    if (string.IsNullOrEmpty(imagePath.Trim()))
                    {
                        imagePath = DefaultImagePath;
                    }
                    else
                    {
                        imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + imagePath;
                        //Resize Image Dynamically
                        InterceptImageController.ImageBuilder(imagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                    }
                    compareItemContent.Append("<div class=\"productBox compareProduct\" id=\"compareProductBox-");
                    compareItemContent.Append(dtCompareItems.Rows[i]["CompareItemID"]);
                    compareItemContent.Append("\" data=");
                    compareItemContent.Append(dtCompareItems.Rows[i]["ItemID"]);
                    compareItemContent.Append(" costVariant=");
                    compareItemContent.Append(dtCompareItems.Rows[i]["CostVariantValueID"]);
                    compareItemContent.Append(">");
                    compareItemContent.Append("<div id=\"compareCompareClose-");
                    compareItemContent.Append(dtCompareItems.Rows[i]["ItemID"]);
                    compareItemContent.Append("\" onclick=\"ItemsCompareAPI.RemoveFromAddToCompareBox(");
                    compareItemContent.Append(dtCompareItems.Rows[i]["ItemID"]);
                    compareItemContent.Append(',');
                    compareItemContent.Append(dtCompareItems.Rows[i]["CompareItemID"]);
                    compareItemContent.Append(");\" class=\"compareProductClose\"><i class='i-close'>cancel</i></div>");
                    compareItemContent.Append("<div class=\"productImage\"><img src=");
                    compareItemContent.Append(aspxRootPath);
                    compareItemContent.Append(imagePath.Replace("uploads", "uploads/Small"));
                    compareItemContent.Append("></div>");
                    compareItemContent.Append("<div class=\"productName\">");
                    compareItemContent.Append(dtCompareItems.Rows[i]["ItemName"]);
                    ItemCostVariantValue = dtCompareItems.Rows[i]["ItemCostVariantValue"].ToString();
                    if (!string.IsNullOrEmpty(ItemCostVariantValue))
                    {
                        compareItemContent.Append("<br/>");
                        compareItemContent.Append(ItemCostVariantValue);
                    }
                    compareItemContent.Append("</div></div>");
                    costVariantIds += ItemCostVariantValue + "#";
                    compareLen++;
                }
            }
            if (MaxCompareItemCount - totalRowsOfItem > 0)
            {
                for (int i = 0; i < (MaxCompareItemCount - totalRowsOfItem); i++)
                {
                    compareItemContent.Append("<div class=\"empty productBox\"></div>");
                }
            }
            StringBuilder errorText = new StringBuilder();
            errorText.Append("<div id=\"compareErrorText\">");
            errorText.Append(getLocale("Sorry, You can not add more than"));
            errorText.Append("&nbsp;");
            errorText.Append(MaxCompareItemCount);
            errorText.Append("&nbsp;");
            errorText.Append(getLocale("items"));
            errorText.Append(".</div>");
            ltrCompareItem.Text = compareItemContent.ToString();
            ltrError.Text       = errorText.ToString();
            #endregion
        }
    }
Esempio n. 10
0
    private void GetLatestItemsByCount(AspxCommonInfo aspxCommonObj)
    {
        AspxLatestItemsController objLatestItems = new AspxLatestItemsController();
        DataSet ds = new DataSet();

        ds = objLatestItems.GetLatestItemsInfo(aspxCommonObj);
        if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
        {
            DataTable dtSettings = ds.Tables[0];
            if (dtSettings != null && dtSettings.Rows.Count > 0)
            {
                NoOfLatestItems       = int.Parse(dtSettings.Rows[0]["LatestItemCount"].ToString());
                EnableLatestItemRss   = bool.Parse(dtSettings.Rows[0]["IsEnableLatestRss"].ToString());
                NoOfLatestItemsInARow = int.Parse(dtSettings.Rows[0]["LatestItemInARow"].ToString());
                RssFeedUrl            = dtSettings.Rows[0]["LatestItemRssPage"].ToString();
            }

            StringBuilder RecentItemContents = new StringBuilder();
            string        modulePath         = this.AppRelativeTemplateSourceDirectory;//"~/Modules/AspxCommerce/AspxLatestItems/";
            hst = AppLocalized.getLocale(modulePath);
            string pageExtension          = SageFrameSettingKeys.PageExtension;
            string aspxTemplateFolderPath = resolveUrl + "Templates/" + TemplateName;
            string aspxRootPath           = resolveUrl;

            DataTable dtItems = ds.Tables[1];

            if (dtItems != null && dtItems.Rows.Count > 0)
            {
                for (int i = 0; i < dtItems.Rows.Count; i++)
                {
                    string imagePath    = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + dtItems.Rows[i]["ImagePath"];
                    string altImagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + dtItems.Rows[i]["AlternateImagePath"];
                    if (dtItems.Rows[i]["ImagePath"].ToString() == string.Empty)
                    {
                        imagePath = DefaultImagePath;
                    }
                    else
                    {   //Resize Image Dynamically
                        InterceptImageController.ImageBuilder(dtItems.Rows[i]["ImagePath"].ToString(), ImageType.Medium, ImageCategoryType.Item, aspxCommonObj);
                    }
                    if (dtItems.Rows[i]["AlternateText"].ToString() == string.Empty)
                    {
                        dtItems.Rows[i]["AlternateText"] = dtItems.Rows[i]["Name"];
                    }
                    if (dtItems.Rows[i]["AlternateImagePath"].ToString() == string.Empty)
                    {
                        altImagePath = imagePath;
                    }
                    string itemPrice      = Convert.ToDecimal(dtItems.Rows[i]["Price"]).ToString("N2");
                    string itemPriceValue = dtItems.Rows[i]["Price"].ToString();
                    string itemPriceRate  = Convert.ToDecimal(dtItems.Rows[i]["Price"]).ToString("N2");

                    if ((i + 1) % NoOfLatestItemsInARow == 0)
                    {
                        RecentItemContents.Append("<div class=\"cssClassProductsBox cssClassNoMargin\">");
                    }
                    else
                    {
                        RecentItemContents.Append("<div class=\"cssClassProductsBox\">");
                    }
                    var hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(dtItems.Rows[i]["SKU"].ToString()) + pageExtension;//dt.rows[i]["SKU"].tos();
                    RecentItemContents.Append("<div id=\"productImageWrapID_");
                    RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                    RecentItemContents.Append("\" class=\"cssClassProductsBoxInfo\" costvariantItem=");
                    RecentItemContents.Append(dtItems.Rows[i]["IsCostVariantItem"]);
                    RecentItemContents.Append("  itemid=\"");
                    RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                    RecentItemContents.Append("\">");
                    RecentItemContents.Append("<h3>");
                    RecentItemContents.Append(dtItems.Rows[i]["SKU"]);
                    RecentItemContents.Append("</h3><div><div class=\"divitemImage cssClassProductPicture\"><a href=\"");
                    RecentItemContents.Append(hrefItem);
                    RecentItemContents.Append("\" ><img id=\"img_");
                    RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                    RecentItemContents.Append("\"  alt=\"");
                    RecentItemContents.Append(dtItems.Rows[i]["AlternateText"]);
                    RecentItemContents.Append("\"  title=\"");
                    RecentItemContents.Append(dtItems.Rows[i]["AlternateText"]);
                    RecentItemContents.Append("\"");
                    RecentItemContents.Append("src=\"");
                    RecentItemContents.Append(aspxRootPath);
                    RecentItemContents.Append(imagePath.Replace("uploads", "uploads/Medium"));
                    RecentItemContents.Append("\" orignalPath=\"");
                    RecentItemContents.Append(imagePath.Replace("uploads", "uploads/Medium"));
                    RecentItemContents.Append("\" altImagePath=\"");
                    RecentItemContents.Append(altImagePath.Replace("uploads", "uploads/Medium"));
                    RecentItemContents.Append("\"/></a></div>");
                    RecentItemContents.Append("<div class='cssLatestItemInfo clearfix'>");
                    RecentItemContents.Append("<h2><a href=\"");
                    RecentItemContents.Append(hrefItem);
                    RecentItemContents.Append("\" title=\"");
                    RecentItemContents.Append(dtItems.Rows[i]["Name"]);
                    RecentItemContents.Append("\">");
                    string name = string.Empty;
                    if (dtItems.Rows[i]["Name"].ToString().Length > 50)
                    {
                        name = dtItems.Rows[i]["Name"].ToString().Substring(0, 50);
                        int index = 0;
                        index = name.LastIndexOf(' ');
                        name  = name.Substring(0, index);
                        name  = name + "...";
                    }
                    else
                    {
                        name = dtItems.Rows[i]["Name"].ToString();
                    }
                    RecentItemContents.Append(name);
                    RecentItemContents.Append("</a></h2>");
                    if (bool.Parse(dtItems.Rows[i]["HidePrice"].ToString()) != true)
                    {
                        if (dtItems.Rows[i]["ListPrice"] != null && dtItems.Rows[i]["ListPrice"].ToString() != string.Empty)
                        {
                            if ((int)dtItems.Rows[i]["ItemTypeID"] == 5)
                            {
                                RecentItemContents.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                                RecentItemContents.Append("<p class=\"cssClassProductRealPrice \">");
                                RecentItemContents.Append(getLocale("Starting At "));
                                RecentItemContents.Append("<span class=\"cssClassFormatCurrency\">");
                                RecentItemContents.Append(itemPriceRate);
                                RecentItemContents.Append("</span></p></div></div>");
                            }
                            else
                            {
                                string strAmount = Convert.ToDecimal((dtItems.Rows[i]["ListPrice"])).ToString("N2");
                                RecentItemContents.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                                RecentItemContents.Append("<p class=\"cssClassProductOffPrice\">");
                                RecentItemContents.Append("<span class=\"cssClassFormatCurrency\">");
                                RecentItemContents.Append(strAmount);
                                RecentItemContents.Append("</span></p><p class=\"cssClassProductRealPrice \">");
                                RecentItemContents.Append("<span class=\"cssClassFormatCurrency\">");
                                RecentItemContents.Append(itemPriceRate);
                                RecentItemContents.Append("</span></p></div></div>");
                            }
                        }
                        else
                        {
                            if ((int)dtItems.Rows[i]["ItemTypeID"] == 5)
                            {
                                RecentItemContents.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                                RecentItemContents.Append("<p class=\"cssClassProductRealPrice \">");
                                RecentItemContents.Append(getLocale("Starting At "));
                                RecentItemContents.Append("<span class=\"cssClassFormatCurrency\">");
                                RecentItemContents.Append(itemPriceRate);
                                RecentItemContents.Append("</span></p></div></div>");
                            }
                            else
                            {
                                RecentItemContents.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                                RecentItemContents.Append("<p class=\"cssClassProductRealPrice \">");
                                RecentItemContents.Append("<span class=\"cssClassFormatCurrency\">");
                                RecentItemContents.Append(itemPriceRate);
                                RecentItemContents.Append("</span></p></div></div>");
                            }
                        }
                    }
                    else
                    {
                        RecentItemContents.Append("<div class=\"cssClassProductPriceBox\"></div>");
                    }
                    RecentItemContents.Append("<div class=\"cssClassProductDetail\"><p><a href=\"");
                    RecentItemContents.Append(aspxRedirectPath);
                    RecentItemContents.Append("item/");
                    RecentItemContents.Append(dtItems.Rows[i]["SKU"]);
                    RecentItemContents.Append(pageExtension);
                    RecentItemContents.Append("\">");
                    RecentItemContents.Append(getLocale("Details"));
                    RecentItemContents.Append("</a></p></div>");
                    if (dtItems.Rows[i]["AttributeValues"] != null)
                    {
                        if (dtItems.Rows[i]["AttributeValues"].ToString() != string.Empty)
                        {
                            RecentItemContents.Append("<div class=\"cssGridDyanamicAttr\">");
                            string[] attributeValues = dtItems.Rows[i]["AttributeValues"].ToString().Split(',');
                            foreach (string element in attributeValues)
                            {
                                string[] attributes     = element.Split('#');
                                string   attributeName  = attributes[0];
                                string   attributeValue = attributes[1];
                                int      inputType      = Int32.Parse(attributes[2]);
                                string   validationType = attributes[3];
                                RecentItemContents.Append("<div class=\"cssDynamicAttributes\">");
                                RecentItemContents.Append("<span>");
                                RecentItemContents.Append(attributeName);
                                RecentItemContents.Append("</span> :");
                                if (inputType == 7)
                                {
                                    RecentItemContents.Append("<span class=\"cssClassFormatCurrency\">");
                                }
                                else
                                {
                                    RecentItemContents.Append("<span>");
                                }
                                RecentItemContents.Append(attributeValue);
                                RecentItemContents.Append("</span></div>");
                            }
                            RecentItemContents.Append("</div>");
                        }
                    }
                    string        itemSKU     = dtItems.Rows[i]["SKU"].ToString();
                    string        itemName    = dtItems.Rows[i]["Name"].ToString();
                    StringBuilder dataContent = new StringBuilder();
                    dataContent.Append("data-class=\"addtoCart\" data-type=\"button\" data-addtocart=\"");
                    dataContent.Append("addtocart");
                    dataContent.Append(dtItems.Rows[i]["ItemID"]);
                    dataContent.Append("\" data-title=\"");
                    dataContent.Append(itemName);
                    dataContent.Append("\" data-onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                    dataContent.Append(dtItems.Rows[i]["ItemID"]);
                    dataContent.Append(",");
                    dataContent.Append(itemPriceValue);
                    dataContent.Append(",'");
                    dataContent.Append(itemSKU);
                    dataContent.Append("',");
                    dataContent.Append(1);
                    dataContent.Append(",'");
                    dataContent.Append(dtItems.Rows[i]["IsCostVariantItem"]);
                    dataContent.Append("',this);\"");
                    RecentItemContents.Append("<div class=\"cssClassTMar20 clearfix\">");
                    if (AllowAddToCart.ToLower() == "true")
                    {
                        if (AllowOutStockPurchase.ToLower() == "false")
                        {
                            if (bool.Parse(dtItems.Rows[i]["IsOutOfStock"].ToString()) == true)
                            {
                                RecentItemContents.Append("<div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper cssClassOutOfStock\"  data-ItemTypeID=\"");
                                RecentItemContents.Append(dtItems.Rows[i]["ItemTypeID"]);
                                RecentItemContents.Append("\" data-ItemID=\"");
                                RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                                RecentItemContents.Append("\" ");
                                RecentItemContents.Append(dataContent);
                                RecentItemContents.Append(">");
                                RecentItemContents.Append("<button type=\"button\"><span>");
                                RecentItemContents.Append(getLocale("Out Of Stock"));
                                RecentItemContents.Append("</span></button></div></div>");
                            }
                            else
                            {
                                RecentItemContents.Append("<div class=\"cssClassAddtoCard\"><div data-ItemTypeID=\"");
                                RecentItemContents.Append(dtItems.Rows[i]["ItemTypeID"]);
                                RecentItemContents.Append("\" data-ItemID=\"");
                                RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                                RecentItemContents.Append("\" ");
                                RecentItemContents.Append(dataContent);
                                RecentItemContents.Append(" class=\"sfButtonwrapper\">");
                                RecentItemContents.Append("<label class='i-cart cssClassCartLabel cssClassGreenBtn'><button type=\"button\" class=\"addtoCart\"");
                                RecentItemContents.Append("addtocart=\"");
                                RecentItemContents.Append("addtocart");
                                RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                                RecentItemContents.Append("\" title=\"");
                                RecentItemContents.Append(itemName);
                                RecentItemContents.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                                RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                                RecentItemContents.Append(",");
                                RecentItemContents.Append(itemPriceValue);
                                RecentItemContents.Append(",'");
                                RecentItemContents.Append(itemSKU);
                                RecentItemContents.Append("',");
                                RecentItemContents.Append(1);
                                RecentItemContents.Append(",'");
                                RecentItemContents.Append(dtItems.Rows[i]["IsCostVariantItem"]);
                                RecentItemContents.Append("',this);\">");
                                RecentItemContents.Append(getLocale("Cart +"));
                                RecentItemContents.Append("</button></label></div></div>");
                            }
                        }
                        else
                        {
                            RecentItemContents.Append("<div class=\"cssClassAddtoCard\"><div data-ItemTypeID=\"");
                            RecentItemContents.Append(dtItems.Rows[i]["ItemTypeID"]);
                            RecentItemContents.Append("\" data-ItemID=\"");
                            RecentItemContents.Append(dtItems.Rows[i]["ItemID "]);
                            RecentItemContents.Append("\"");
                            RecentItemContents.Append(dataContent);
                            RecentItemContents.Append(" class=\"sfButtonwrapper\">");
                            RecentItemContents.Append("<label class='i-cart cssClassCartLabel cssClassGreenBtn'><button type=\"button\" class=\"addtoCart\"");
                            RecentItemContents.Append("addtocart=\"");
                            RecentItemContents.Append("addtocart");
                            RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                            RecentItemContents.Append("\" title=\"");
                            RecentItemContents.Append(itemName);
                            RecentItemContents.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                            RecentItemContents.Append(",");
                            RecentItemContents.Append(itemPriceValue);
                            RecentItemContents.Append(",'");
                            RecentItemContents.Append(itemSKU);
                            RecentItemContents.Append("',");
                            RecentItemContents.Append(1);
                            RecentItemContents.Append(",'");
                            RecentItemContents.Append(dtItems.Rows[i]["IsCostVariantItem"]);
                            RecentItemContents.Append("',this);\">");
                            RecentItemContents.Append(getLocale("Cart +"));
                            RecentItemContents.Append("</button></label></div></div>");
                        }
                    }
                    if (GetCustomerID > 0 && GetUsername.ToLower() != "anonymoususer")
                    {
                        RecentItemContents.Append("<div class=\"cssClassWishListButton\">");
                        RecentItemContents.Append("<label class='i-wishlist cssWishListLabel cssClassDarkBtn'><button type=\"button\" id=\"addWishList\" onclick=AspxCommerce.RootFunction.CheckWishListUniqueness(");
                        RecentItemContents.Append(dtItems.Rows[i]["ItemID"]);
                        RecentItemContents.Append(",'");
                        RecentItemContents.Append(dtItems.Rows[i]["SKU"]);
                        RecentItemContents.Append("',this);><span>");
                        RecentItemContents.Append(getLocale("Wishlist+"));
                        RecentItemContents.Append("</span></button></label></div>");
                    }
                    else
                    {
                        RecentItemContents.Append("<div class=\"cssClassWishListButton\">");
                        RecentItemContents.Append("<label class='i-wishlist cssWishListLabel cssClassDarkBtn'><button type=\"button\" id=\"addWishList\" onclick=\"AspxCommerce.RootFunction.Login();\">");
                        RecentItemContents.Append("<span>");
                        RecentItemContents.Append(getLocale("Wishlist+"));
                        RecentItemContents.Append("</span></button></label></div>");
                    }

                    RecentItemContents.Append("</div></div>");
                    RecentItemContents.Append("</div></div>");
                    RecentItemContents.Append("</div>");
                }
            }

            else
            {
                RecentItemContents.Append("<span class=\"cssClassNotFound\">");
                RecentItemContents.Append(getLocale("This store has no items listed yet!"));
                RecentItemContents.Append("</span>");
            }
            tblRecentItems.InnerHtml = RecentItemContents.ToString();
        }
    }
Esempio n. 11
0
    private void BindServiceItemDetail(int itemID)
    {
        decimal            rate = 1;
        StoreSettingConfig ssc  = new StoreSettingConfig();

        decimal additionalCCVR = decimal.Parse(ssc.GetStoreSettingsByKey(StoreSetting.AdditionalCVR, aspxCommonObj.StoreID, aspxCommonObj.PortalID, aspxCommonObj.CultureName));
        string  MainCurrency   = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, aspxCommonObj.StoreID, aspxCommonObj.PortalID, aspxCommonObj.CultureName);

        if (HttpContext.Current.Session["CurrencyRate"] != null)
        {
            if (Session["CurrencyCode"].ToString() != MainCurrency)
            {
                decimal rate1 = decimal.Parse(Session["CurrencyRate"].ToString());
                rate = Math.Round(rate1 + (rate1 * additionalCCVR / 100), 4);
            }
            else
            {
                rate = decimal.Parse(Session["CurrencyRate"].ToString());
            }
        }

        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(serviceModulePath);
        string pageExtension = SageFrameSettingKeys.PageExtension;
        ServiceItemController         objService        = new ServiceItemController();
        List <ServiceItemSettingInfo> lstServiceSetting = objService.GetServiceItemSetting(aspxCommonObj);

        if (lstServiceSetting != null && lstServiceSetting.Count > 0)
        {
            foreach (var serviceSetting in lstServiceSetting)
            {
                bookAnAppointmentPage = serviceSetting.BookAnAppointmentPage;
            }
        }
        List <ServiceCategoryDetailsInfo> lstSIDetail = objService.GetServiceItemDetails(itemID, aspxCommonObj);
        StringBuilder serviceIDetailBdl = new StringBuilder();

        serviceIDetailBdl.Append("<div id=\"divServiceItemDetails\" class=\"cssServiceItemDetails\">");
        if (lstSIDetail != null && lstSIDetail.Count > 0)
        {
            foreach (ServiceCategoryDetailsInfo item in lstSIDetail)
            {
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                if (item.ImagePath == "")
                {
                    imagePath = NoImageServiceItemPath;
                }
                else
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(item.ImagePath, ImageType.Large, ImageCategoryType.Item, aspxCommonObj);
                }
                serviceIDetailBdl.Append("<div class=\"cssItemName\"><h2 class='cssClassBMar25'><span>" + item.ItemName + "</span></h2></div>");
                serviceIDetailBdl.Append("<div class=\"cssItemImage\">");
                serviceIDetailBdl.Append("<a href=\"" + aspxRootPath + imagePath + "\">");
                serviceIDetailBdl.Append("<img alt=\"" + item.ItemName + "\" src=" + aspxRootPath + imagePath.Replace("uploads", "uploads/Large") + " title=\"Click To View Large Image\"></a></div>");
                serviceIDetailBdl.Append("<div class=\"cssDesc\">");
                serviceIDetailBdl.Append("<p>" + HttpUtility.HtmlDecode(item.Description) + "</p></div>");

                serviceIDetailBdl.Append("<span class=\"cssClassServiceDuration\" value=\"" +
                                         (item.ServiceDuration) + "\">" + '(' +
                                         (item.ServiceDuration) + ' ' + "minutes" + ')' +
                                         "</span>&nbsp;");
                serviceIDetailBdl.Append("<span class=\"cssClassFormatCurrency\" value=" + (item.Price) + ">" + (item.Price * rate).ToString("N2") + "</span>");
                serviceIDetailBdl.Append("<div class=\"sfButtonwrapper\">");
                serviceIDetailBdl.Append("<a href=" + aspxRedirectPath + bookAnAppointmentPage + pageExtension + "?cid=" + item.CategoryID + "&pid=" + item.ItemID + " class='cssClassGreenBtn'>Book Now</a>");
                serviceIDetailBdl.Append("</div></div>");
            }
        }
        else
        {
            serviceIDetailBdl.Append("<div class=\"cssClassNotFound\">");
            serviceIDetailBdl.Append("<p>There is no service description available</p></div>");
        }
        serviceIDetailBdl.Append("</div>");
        ltrServiceItemDetail.Text = serviceIDetailBdl.ToString();
    }
Esempio n. 12
0
    private void BindAllItems <T>(List <T> lst)
    {
        string modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(modulePath);
        string        pageExtension     = SageFrameSettingKeys.PageExtension;
        StringBuilder itemVLstStringBld = new StringBuilder();

        ArrayLength = lst.Count;
        if (lst != null && lst.Count > 0)
        {
            itemVLstStringBld.Append("<div class=\'clearfix\'>");
            foreach (T value in lst)
            {
                string  SKU = "", imagePath = "", alternateText = "", name = "", isFeatured = "", isSpecial = "";
                decimal price = 0;
                string  costVariants = "";
                bool    isOutOfStock = false;
                int     itemID = 0, itemTypeID = 1;

                var prop0 = value.GetType().GetProperty("RowTotal");
                RowTotal = (int)prop0.GetValue(value, null);

                var prop1 = value.GetType().GetProperty("SKU");
                if (prop1 != null)
                {
                    SKU = (string)Convert.ChangeType(prop1.GetValue(value, null), prop1.PropertyType);
                }
                var prop2 = value.GetType().GetProperty("ImagePath");
                if (prop2 != null)
                {
                    imagePath = (string)Convert.ChangeType(prop2.GetValue(value, null), prop2.PropertyType);
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(imagePath, ImageType.Medium, ImageCategoryType.Item, aspxCommonObj);
                }
                var prop3 = value.GetType().GetProperty("AlternateText");
                if (prop3 != null)
                {
                    alternateText = (string)Convert.ChangeType(prop3.GetValue(value, null), prop3.PropertyType);
                }
                var prop4 = value.GetType().GetProperty("Name");
                if (prop4 != null)
                {
                    name = (string)Convert.ChangeType(prop4.GetValue(value, null), prop4.PropertyType);
                }
                var prop5 = value.GetType().GetProperty("IsFeatured");
                if (prop5 != null)
                {
                    isFeatured = (string)Convert.ChangeType(prop5.GetValue(value, null), prop5.PropertyType);
                }
                var prop6 = value.GetType().GetProperty("IsSpecial");
                if (prop6 != null)
                {
                    isSpecial = (string)Convert.ChangeType(prop6.GetValue(value, null), prop6.PropertyType);
                }
                var prop7 = value.GetType().GetProperty("IsOutOfStock");

                if (prop7 != null)
                {
                    var val = prop7.GetValue(value, null);
                    if (val != null)
                    {
                        isOutOfStock = (bool)val;
                    }
                    else
                    {
                        isOutOfStock = false;
                    }
                }
                var prop8 = value.GetType().GetProperty("ItemID");
                if (prop8 != null)
                {
                    var val = prop8.GetValue(value, null);
                    if (val != null)
                    {
                        itemID = (int)val;
                    }
                }
                var prop9 = value.GetType().GetProperty("Price");
                if (prop9 != null)
                {
                    price = Convert.ToDecimal(prop9.GetValue(value, null));
                }
                var prop10 = value.GetType().GetProperty("CostVariants");
                if (prop10 != null)
                {
                    costVariants = (string)Convert.ChangeType(prop10.GetValue(value, null), prop10.PropertyType);
                }

                var prop11 = value.GetType().GetProperty("ItemTypeID");
                if (prop11 != null)
                {
                    var val = prop11.GetValue(value, null);
                    if (val != null)
                    {
                        itemTypeID = (int)val;
                    }
                }

                var hrefItem = "";
                if (itemTypeID == 4)
                {
                    hrefItem = aspxRedirectPath + "Service-Item-Details" + pageExtension + "?id=" + itemID;
                }
                else
                {
                    hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(SKU) + pageExtension;
                }
                if (string.IsNullOrEmpty(imagePath))
                {
                    imagePath = NoImageCategoryDetailPath;
                }
                else
                {
                    imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + imagePath;
                }
                if (string.IsNullOrEmpty(alternateText))
                {
                    alternateText = name;
                }
                string imageSize = "Medium";
                if (isFeatured == "Yes" || isSpecial == "True")
                {
                    itemVLstStringBld.Append("<div id=\"product_" + itemID + "\" class=\"classInfo\">");
                    itemVLstStringBld.Append("<div  id=\"productImageWrapID_" + itemID + "\" class=\"itemImageClass\">");
                    itemVLstStringBld.Append("<a href=\"" + hrefItem + "\">");
                    itemVLstStringBld.Append("<img class=\"lazy\"  alt=\"" + alternateText + "\"  title=\"" +
                                             alternateText + "\" src=\"" + aspxRootPath +
                                             imagePath.Replace("uploads", "uploads/" + imageSize + "") + " \" />");
                    itemVLstStringBld.Append("</a>");
                    itemVLstStringBld.Append(imageSize == "Small"
                                                 ? "<div class=\"classIsFeatureSmall\"></div>"
                                                 : "<div class=\"classIsFeatureMedium\"></div>");
                    if (isSpecial == "Yes" || isSpecial == "True")
                    {
                        itemVLstStringBld.Append(imageSize == "Small"
                                                     ? "<div class=\"classIsSpecialSmall\"></div>"
                                                     : "<div class=\"classIsSpecialMedium\"></div>");
                    }
                    itemVLstStringBld.Append("</div>");
                }
                else
                {
                    itemVLstStringBld.Append("<div id=\"product_" + itemID + "\" class=\"classInfo\">");
                    itemVLstStringBld.Append("<div  id=\"productImageWrapID_" + itemID + "\" class=\"itemImageClass\">");
                    itemVLstStringBld.Append("<a href=\"" + hrefItem + "\">");
                    itemVLstStringBld.Append("<img  alt=\"" + alternateText + "\"  title=\"" +
                                             alternateText + "\" src=\"" + aspxRootPath +
                                             imagePath.Replace("uploads", "uploads/" + imageSize + "") + " \" />");
                    itemVLstStringBld.Append("</a>");
                    if (isSpecial == "Yes" || isSpecial == "True")
                    {
                        itemVLstStringBld.Append(imageSize == "Small"
                                                     ? "<div class=\"classIsSpecialSmall\"></div>"
                                                     : "<div class=\"classIsSpecialMedium\"></div>");
                    }
                    itemVLstStringBld.Append("</div>");
                }
                itemVLstStringBld.Append("<div class=\"itemInfoClass\"><ul>");
                itemVLstStringBld.Append("<li>" + name + "</li>");
                itemVLstStringBld.Append("<div class=\"cssClassProductPrice\"></div>");
                itemVLstStringBld.Append("<li class=\"cssClassProductRealPrice \">");
                if (itemTypeID == 5)
                {
                    itemVLstStringBld.Append(getLocale("Starting At "));
                    itemVLstStringBld.Append("<span id=\"spanPrice_" + itemID + "\" class=\"cssClassFormatCurrency\">" +
                                             Math.Round((price), 2).ToString("N2") + "</span>");
                }
                else
                {
                    itemVLstStringBld.Append("<span id=\"spanPrice_" + itemID + "\" class=\"cssClassFormatCurrency\">" +
                                             Math.Round((price), 2).ToString("N2") + "</span>");
                }

                itemVLstStringBld.Append("<input type=\"hidden\"  id=\"hdnPrice_" + itemID +
                                         "\" class=\"cssClassFormatCurrency\">");
                itemVLstStringBld.Append("</li>");
                itemVLstStringBld.Append("</ul>");

                StringBuilder dataContent = new StringBuilder();
                dataContent.Append("data-class=\"addtoCart\" data-ItemTypeID=\"" + itemTypeID + "\" data-ItemID=\"" + itemID + "\" data-type=\"button\" data-addtocart=\"");
                dataContent.Append("addtocart");
                dataContent.Append(itemID);
                dataContent.Append("\" data-title=\"");
                dataContent.Append(name);
                dataContent.Append("\" data-onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                dataContent.Append(itemID);
                dataContent.Append(",");
                dataContent.Append(price);
                dataContent.Append(",'");
                dataContent.Append(SKU);
                dataContent.Append("',");
                dataContent.Append(1);
                dataContent.Append(",'");
                dataContent.Append(costVariants);
                dataContent.Append("',this);\"");

                if (AllowOutStockPurchase.ToLower() == "false")
                {
                    if (isOutOfStock)
                    {
                        itemVLstStringBld.Append("<div " + dataContent + " class=\"sfButtonwrapper cssClassOutOfStock\">");
                        itemVLstStringBld.Append("<button type=\"button\"><span>");
                        itemVLstStringBld.Append(getLocale("Out Of Stock"));
                        itemVLstStringBld.Append("</span></button></div>");
                    }
                    else
                    {
                        if (itemTypeID != 4)
                        {
                            itemVLstStringBld.Append("<div " + dataContent + " class=\"sfButtonwrapper\">");
                            itemVLstStringBld.Append("<label class=\"i-cart cssClassGreenBtn\"><button type=\"button\" class=\"addtoCart\" ");
                            itemVLstStringBld.Append("addtocart=\"");
                            itemVLstStringBld.Append("addtocart");
                            itemVLstStringBld.Append(itemID);
                            itemVLstStringBld.Append("\" title=\"");
                            itemVLstStringBld.Append(name);

                            itemVLstStringBld.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            itemVLstStringBld.Append(itemID + ",");
                            itemVLstStringBld.Append(price + ",");
                            itemVLstStringBld.Append("'" + SKU + "'" + "," + 1);
                            itemVLstStringBld.Append(",'");
                            itemVLstStringBld.Append(costVariants);
                            itemVLstStringBld.Append("',this);\">");
                            itemVLstStringBld.Append(getLocale("Cart +"));
                            itemVLstStringBld.Append("</button></label></div>");
                        }
                    }
                }
                else
                {
                    if (itemTypeID != 4)
                    {
                        itemVLstStringBld.Append("<div " + dataContent + " class=\"sfButtonwrapper\">");
                        itemVLstStringBld.Append("<label class=\"cssClassGreenBtn i-cart cssClassCartLabel\"><button type=\"button\" class=\"addtoCart\" ");
                        itemVLstStringBld.Append("addtocart=\"");
                        itemVLstStringBld.Append("addtocart");
                        itemVLstStringBld.Append(itemID);
                        itemVLstStringBld.Append("\" title=\"");
                        itemVLstStringBld.Append(name);

                        itemVLstStringBld.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                        itemVLstStringBld.Append(itemID + ",");
                        itemVLstStringBld.Append(price + ",");
                        itemVLstStringBld.Append("'" + SKU + "'" + "," + 1);
                        itemVLstStringBld.Append(",'");
                        itemVLstStringBld.Append(costVariants);
                        itemVLstStringBld.Append("',this);\">");
                        itemVLstStringBld.Append(getLocale("Cart +"));
                        itemVLstStringBld.Append("</button></label></div>");
                    }
                }

                itemVLstStringBld.Append("<div class=\"classButtons\">");
                itemVLstStringBld.Append("<div class=\"classWishlist\">");

                itemVLstStringBld.Append("<div class=\"cssClassWishListButton\">");
                itemVLstStringBld.Append("<input type=\"hidden\" name='itemwish' value=");
                itemVLstStringBld.Append(itemID);
                itemVLstStringBld.Append(",'");
                itemVLstStringBld.Append(SKU);
                itemVLstStringBld.Append("',this  />");
                itemVLstStringBld.Append("</div>");
                itemVLstStringBld.Append("</div>");
                itemVLstStringBld.Append("</div>");

                /*  itemVLstStringBld.Append("<div class=\"classViewDetails\">");
                 * itemVLstStringBld.Append("<a href=\"" + hrefItem + "\"><span>" + getLocale("View Details") +
                 *                         "</span></a></div>");*/
                itemVLstStringBld.Append("</div>");
                itemVLstStringBld.Append("</div>");
            }

            itemVLstStringBld.Append("</div>");
        }
        else
        {
            itemVLstStringBld.Append("<span class=\"cssClassNotFound\"><b>" +
                                     getLocale("This store has no items listed yet!") + "</b></span>");
        }
        ltrItemViewDetail.Text = itemVLstStringBld.ToString();
    }
    private void BindServiceDetails()
    {
        StoreSettingConfig ssc            = new StoreSettingConfig();
        decimal            additionalCCVR =
            decimal.Parse(ssc.GetStoreSettingsByKey(StoreSetting.AdditionalCVR, aspxCommonObj.StoreID,
                                                    aspxCommonObj.PortalID, aspxCommonObj.CultureName));
        string MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, aspxCommonObj.StoreID,
                                                        aspxCommonObj.PortalID, aspxCommonObj.CultureName);
        string modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(modulePath);
        string pageExtension = SageFrameSettingKeys.PageExtension;
        ServiceItemController     contrObj         = new ServiceItemController();
        List <ServiceDetailsInfo> lstServiceDetail = contrObj.GetServiceDetails(Servicekey, aspxCommonObj);
        StringBuilder             serviceDetailBld = new StringBuilder();
        var categoryImage   = "";
        var categoryDetails = "";
        int itemId          = 0;

        if (lstServiceDetail != null && lstServiceDetail.Count > 0)
        {
            itemId        = lstServiceDetail[0].ItemID;
            categoryImage = "Modules/AspxCommerce/AspxCategoryManagement/uploads/" +
                            lstServiceDetail[0].CategoryImagePath;
            categoryDetails = HttpUtility.HtmlDecode(lstServiceDetail[0].CategoryDetails);
            serviceDetailBld.Append("<div id=\"divServiceDetails\" class=\"cssServiceDetail\">");
            serviceDetailBld.Append("<div id=\"divServiceName\" class=\"cssServiceName\">");
            serviceDetailBld.Append("<h2 class='cssClassBMar25'><span>" + lstServiceDetail[0].CategoryName + "</span></h2>");
            serviceDetailBld.Append("<div class=\"cssImageWrapper\">");
            serviceDetailBld.Append("<img alt=\"" + lstServiceDetail[0].CategoryName + "\" title=\"" + lstServiceDetail[0].CategoryName + "\" src=\"" + aspxRootPath + categoryImage.Replace("uploads", "uploads/Large") + "\"/></div>");
            serviceDetailBld.Append("<div class=\"cssServiceDesc\"><p>" + categoryDetails + "</p></div>");
            serviceDetailBld.Append("</div>");
            StringBuilder serviceItemBld = new StringBuilder();
            serviceItemBld.Append("<div class=\"cssServiceItemWrapper\">");
            foreach (var serviceDetailsInfo in lstServiceDetail)
            {
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + serviceDetailsInfo.ItemImagePath;
                if (serviceDetailsInfo.ItemImagePath == null)
                {
                    imagePath = "";
                }
                else
                {
                    if (serviceDetailsInfo.ItemImagePath != "")
                    {
                        //Resize Image Dynamically
                        InterceptImageController.ImageBuilder(serviceDetailsInfo.ItemImagePath, ImageType.Large, ImageCategoryType.Category, aspxCommonObj);
                    }
                }
                if ((lstServiceDetail.IndexOf(serviceDetailsInfo) + 1) % NoOfItemInRow == 0)
                {
                    serviceItemBld.Append("<div class=\"cssClassItems cssClassNoMargin clearfix\">");
                }
                else
                {
                    serviceItemBld.Append("<div class=\"cssClassItems clearfix\">");
                }
                serviceItemBld.Append("<h3>");
                serviceItemBld.Append("<a href=\"" + aspxRootPath + "Service-Item-Details" + pageExtension + "?id=" + serviceDetailsInfo.ItemID + "\"><span>" + serviceDetailsInfo.ItemName + "</span></a></h3>");
                serviceItemBld.Append("<p>" + HttpUtility.HtmlDecode(serviceDetailsInfo.ShortDescription.Trim()) + "</p>");
                serviceItemBld.Append("<div class='cssClasstimewrap'><span class=\"cssClassServiceDuration\" value=\"" +
                                      (serviceDetailsInfo.ServiceDuration) + "\">" + '(' +
                                      (serviceDetailsInfo.ServiceDuration) + ' ' + getLocale("minutes") + ')' +
                                      "</span>&nbsp;");
                serviceItemBld.Append("<span class=\"cssClassFormatCurrency\" value=\"" + (serviceDetailsInfo.Price) + "\">" + (serviceDetailsInfo.Price).ToString("N2") + "</span></div>");
                serviceItemBld.Append("<div class=\"sfButtonwrapper\"><a href=\"" + aspxRedirectPath +
                                      "Book-An-Appointment" + pageExtension + "?cid=" + serviceDetailsInfo.CategoryID +
                                      "&amp;pid=" + serviceDetailsInfo.ItemID + "\" class='cssClassGreenBtn'>" + getLocale("Book Now") +
                                      "</a></div></div>");
            }
            serviceItemBld.Append("</div>");
            serviceDetailBld.Append(serviceItemBld);
            serviceDetailBld.Append("</div>");
        }
        else
        {
            serviceDetailBld.Append("<div id=\"divServiceDetails\" class=\"cssServiceDetail\">");
            serviceDetailBld.Append("<div id=\"divServiceName\" class=\"cssServiceName\"><h2><span>" + Servicekey + "</span></h2></div>");
            serviceDetailBld.Append("<span class=\"cssClassNotFound\">" +
                                    getLocale("No Service's Products are Available!") + "</span>");
            serviceDetailBld.Append("</div>");
        }
        ltrServiceDetails.Text = serviceDetailBld.ToString();
    }
    public void GetShoppingFilterItemsResult(AspxCommonInfo aspxCommonObj)
    {
        StringBuilder        strItemsResult  = new StringBuilder();
        JavaScriptSerializer json_serializer = new JavaScriptSerializer();
        string template      = AspxGetTemplates.GetAspxTemplate(ViewAsOptionsDefault);
        string itemImagePath = ResolveUrl("~/") + "Modules/AspxCommerce/AspxItemsManagement/uploads/";
        List <ItemBasicDetailsInfo> lstItems = AspxFilterController.GetShoppingFilterItemsResult(1, 9, "", "", minPrice, maxPrice, Categorykey, false, SortByOptionsDefault, aspxCommonObj);

        if (lstItems != null && lstItems.Count > 0)
        {
            if (ViewAsOptionsDefault == 1)
            {
                strItemsResult.Append("<div class='cssCatProductGridWrapper'>");
            }
            Page.ClientScript.RegisterArrayDeclaration("arrItemsOptionToBind", json_serializer.Serialize(lstItems));
            string price     = "0.00";
            string listPrice = "0.00";
            foreach (ItemBasicDetailsInfo value in lstItems)
            {
                string template1 = template;
                string imagePath = itemImagePath + value.BaseImage;
                if (value.BaseImage == string.Empty)
                {
                    imagePath = NoImageCategoryDetailPath;
                }
                else
                {
                    InterceptImageController.ImageBuilder(value.BaseImage, ImageType.Medium, ImageCategoryType.Item, aspxCommonObj);
                }
                string name = string.Empty;
                if (value.Name.Length > 50)
                {
                    name = value.Name.Substring(0, 50);
                    var i = 0;
                    i    = name.LastIndexOf(' ');
                    name = name.Substring(0, i);
                    name = name + "...";
                }
                else
                {
                    name = value.Name;
                }
                string sku = json_serializer.Serialize(value.SKU);

                string title = json_serializer.Serialize(value.Name);
                price     = (!string.IsNullOrEmpty(value.Price) ? Convert.ToDecimal(value.Price).ToString("N2") : "0.00");
                listPrice = (!string.IsNullOrEmpty(value.ListPrice) ? Convert.ToDecimal(value.ListPrice).ToString("N2") : "0.00");
                Dictionary <string, string> replacements = new Dictionary <string, string>();
                replacements.Add("${sku}", value.SKU);
                replacements.Add("${aspxRedirectPath}", aspxRedirectPath);
                replacements.Add("${pageExtension}", SageFrameSettingKeys.PageExtension);
                replacements.Add("${imagePath}", imagePath);
                replacements.Add("${alternateText}", value.AlternateText);
                replacements.Add("${name}", name);
                replacements.Add("${titleName}", title);
                replacements.Add("${parseFloat(price).toFixed(2)}", price);
                replacements.Add("${JSON2.stringify(sku)}", sku);
                replacements.Add("${isCostVariant}", json_serializer.Serialize(value.IsCostVariantItem.ToString()));
                replacements.Add("${1}", "1");
                replacements.Add("${price}", value.Price);
                if (value.ListPrice != string.Empty)
                {
                    replacements.Add("${parseFloat(listPrice).toFixed(2)}", listPrice);
                }
                else
                {
                    replacements.Add("<p class=\"cssClassProductOffPrice\">", string.Empty);
                    replacements.Add("<span class=\"cssRegularPrice_${itemID} cssClassFormatCurrency\">${parseFloat(listPrice).toFixed(2)}</span></p>", string.Empty);
                }
                // Replace
                if (value.AttributeValues != null)
                {
                    if (value.AttributeValues != string.Empty)
                    {
                        string   attrHtml   = string.Empty;
                        string[] attrValues = value.AttributeValues.Split(',');
                        for (var i = 0; i < attrValues.Length; i++)
                        {
                            string[] attributes     = attrValues[i].Split('#');
                            string   attributeName  = attributes[0];
                            string   attributeValue = attributes[1];
                            int      inputType      = Int32.Parse(attributes[2]);
                            string   validationType = attributes[3];
                            attrHtml += "<div class=\"cssDynamicAttributes\">";
                            if (inputType == 7)
                            {
                                attrHtml += "<span class=\"cssClassFormatCurrency\">";
                            }
                            else
                            {
                                attrHtml += "<span>";
                            }
                            attrHtml += attributeValue;
                            attrHtml += "</span></div>";
                        }
                        replacements.Add("$DynamicAttr", attrHtml);
                    }
                    else
                    {
                        if (ViewAsOptionsDefault == 1)
                        {
                            replacements.Add("<div class=\"cssGridDyanamicAttr\">$DynamicAttr</div>", string.Empty);
                        }
                        else
                        {
                            replacements.Add("<div class=\"cssListDyanamicAttr\">$DynamicAttr</div>", string.Empty);
                        }
                    }
                }
                else
                {
                    if (ViewAsOptionsDefault == 1)
                    {
                        replacements.Add("<div class=\"cssGridDyanamicAttr\">$DynamicAttr</div>", string.Empty);
                    }
                    else
                    {
                        replacements.Add("<div class=\"cssListDyanamicAttr\">$DynamicAttr</div>", string.Empty);
                    }
                }

                if (AllowAddToCart.ToLower() == "true")
                {
                    if (AllowOutStockPurchase.ToLower() == "false")
                    {
                        if ((bool)value.IsOutOfStock)
                        {
                            replacements.Add("<span class=\"sfLocale\">" + getLocale("Cart +") + "</span>", "<span class=\"sfLocale\">" + getLocale("Out Of Stock") + "</span>");
                            replacements.Add("<div class=\"cssClassAddtoCard_${itemID} cssClassAddtoCard\">", "<div class=\"cssClassAddtoCard_${itemID} cssClassOutOfStock\">");
                            replacements.Add("<label class=\"i-cart cssClassCartLabel cssClassGreenBtn\">", "<label class=\"cssClassCartLabel\">");
                            replacements.Add("onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(${itemID},${price},${JSON2.stringify(sku)},${1},${isCostVariant},this);", string.Empty);
                        }
                    }
                }
                else
                {
                    replacements.Add("<div class=\"cssClassAddtoCard_${itemID} cssClassAddtoCard\">", "<div class=\"cssClassAddtoCard_${itemID} cssClassAddtoCard\" style=\"display: none;\">");
                }
                if (value.ItemTypeID == 5)
                {
                    replacements.Add("<p class=\"cssClassProductRealPrice\">", "<p class=\"cssClassProductRealPrice\">" + getLocale("Starting At") + "");
                }
                if (ViewAsOptionsDefault == 2)
                {
                    replacements.Add("{{html shortDescription}}", Server.HtmlDecode(value.ShortDescription));
                }

                replacements.Add("${itemID}", value.ItemID.ToString());
                foreach (var replacement in replacements)
                {
                    template1 = template1.Replace(replacement.Key, replacement.Value);
                }
                strItemsResult.Append(template1);
            }
            if (ViewAsOptionsDefault == 1)
            {
                strItemsResult.Append("</div>");
                StringBuilder strScriptExecute = new StringBuilder();
                strScriptExecute.Append("var $container");
                strScriptExecute.Append("= ");
                strScriptExecute.Append("$('.cssCatProductGridWrapper');");
                strScriptExecute.Append("$container.imagesLoaded(function () {");
                strScriptExecute.Append("$container.masonry({");
                strScriptExecute.Append("itemSelector: '.cssClassProductsBox',");
                strScriptExecute.Append("EnableSorting: false");
                strScriptExecute.Append("});");
                strScriptExecute.Append("});");
                string script = GetStringScript(strScriptExecute.ToString());
                strItemsResult.Append(script);
            }

            ltrCategoryItems.Text = strItemsResult.ToString();
            CreateDropdownPageSize(lstItems.Count);
        }
        else
        {
            ltrCategoryItems.Text = ("<span class=\"cssClassNotFound\">" + getLocale("No items found or matched!") + "</span>").ToString();
        }
    }
    public void GetAllSubCategoryForFilter(AspxCommonInfo aspxCommonObj)
    {
        string resolvedUrl = ResolveUrl("~/");
        string modulePath  = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        string  aspxTemplateFolderPath = resolvedUrl + "Templates/" + TemplateName;
        DataSet ds = AspxFilterController.GetCategoryDetailInfoForFilter(Categorykey, aspxCommonObj);

        if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
        {
            StringBuilder elem = new StringBuilder();
            DataTable     dtSubCatWithItems = ds.Tables[0];
            elem.Append("<div class=\"filter\">");
            if (dtSubCatWithItems != null && dtSubCatWithItems.Rows.Count > 0)
            {
                elem.Append("<div id=\"divCat\" value=\"b01\" class=\"cssClasscategorgy\">");
                elem.Append("<div class=\"divTitle\"><b><label style=\"color:#006699\">");
                elem.Append(getLocale("Categories"));
                elem.Append("</label></b><img align=\"right\" src=\"");
                elem.Append(aspxTemplateFolderPath);
                elem.Append("/images/arrow_up.png\"/></div> <div id=\"scrollbar1\" class=\"cssClassScroll\"><div class=\"viewport\"><div class=\"overview\" id=\"catOverview\"><div class=\"divContentb01\"><ul id=\"cat\">");
                for (int i = 0; i < dtSubCatWithItems.Rows.Count; i++)
                {
                    elem.Append("<li><label><input class=\"chkCategory\" type=\"checkbox\" name=\"");
                    elem.Append(dtSubCatWithItems.Rows[i]["CategoryName"]);
                    elem.Append("\" ids=\"");
                    elem.Append(dtSubCatWithItems.Rows[i]["CategoryID"]);
                    elem.Append("\" value=\"");
                    elem.Append(dtSubCatWithItems.Rows[i]["CategoryName"]);
                    elem.Append("\"/> ");
                    elem.Append(dtSubCatWithItems.Rows[i]["CategoryName"]);
                    elem.Append("<span> (");
                    elem.Append(dtSubCatWithItems.Rows[i]["ItemCount"]);
                    elem.Append(")</span></label></li>");
                }
                elem.Append("</ul></div></div></div></div></div>");
            }

            string brandFilter = GetAllBrandForCategory(aspxCommonObj);
            elem.Append(brandFilter);
            elem.Append("</div>");
            ltrFilter.Text = elem.ToString();

            DataTable dtCatSlider = ds.Tables[1];
            if (dtCatSlider != null && dtCatSlider.Rows.Count > 0)
            {
                string        Imagelist         = string.Empty;
                StringBuilder strCatHeadSlider  = new StringBuilder();
                StringBuilder strCatHeadScript  = new StringBuilder();
                bool          isNoCategoryImage = false;
                string        categoryImagePath = "Modules/AspxCommerce/AspxCategoryManagement/uploads/";
                int           imgCount          = 0;
                strCatHeadSlider.Append("<div id=\"divHeader\" class=\"cssClassSlider\" style=\"display: none;\">");

                strCatHeadSlider.Append("<div id=\"slider-container\"><div id=\"sliderObj\" class=\"cat-slideshow-wrap\">");
                strCatHeadSlider.Append("<div class=\"cat_Slides cat-slide-container\">");

                for (int i = 0; i < dtCatSlider.Rows.Count; i++)
                {
                    if (dtCatSlider.Rows[i]["CategoryImage"].ToString() != string.Empty)
                    {
                        string[] imgUrlSegments = dtCatSlider.Rows[i]["CategoryImage"].ToString().Split('/');
                        string   imgToBeAdded   = imgUrlSegments[imgUrlSegments.Length - 1] + ';';
                        Imagelist        += imgToBeAdded;
                        isNoCategoryImage = true;
                        string catDesc = dtCatSlider.Rows[i]["CategoryShortDesc"].ToString();

                        if (catDesc.Length > 300)
                        {
                            catDesc = catDesc.Substring(0, 300);
                            int index = 0;
                            index   = catDesc.LastIndexOf(' ');
                            catDesc = catDesc.Substring(0, index);
                            catDesc = catDesc + "...";
                        }

                        //check for this
                        string href = resolvedUrl + "category/" + AspxUtility.fixedEncodeURIComponent(dtCatSlider.Rows[i]["CategoryName"].ToString()) + SageFrameSettingKeys.PageExtension;
                        imgCount++;
                        string catImagePath = dtCatSlider.Rows[i]["CategoryImage"].ToString();
                        strCatHeadSlider.Append("<div class=\"cat-slide-container-inner\"><div class=\"cssCatImage\"><a href=");
                        strCatHeadSlider.Append(href);
                        strCatHeadSlider.Append("><img src='");
                        strCatHeadSlider.Append(resolvedUrl);
                        strCatHeadSlider.Append(categoryImagePath);
                        strCatHeadSlider.Append(catImagePath);
                        strCatHeadSlider.Append("' alt='");
                        strCatHeadSlider.Append(dtCatSlider.Rows[i]["CategoryName"]);
                        strCatHeadSlider.Append("' title='");
                        strCatHeadSlider.Append(dtCatSlider.Rows[i]["CategoryName"]);
                        strCatHeadSlider.Append("' /></a></div><div class=\"cssCatDesc\"><span>");
                        strCatHeadSlider.Append(dtCatSlider.Rows[i]["CategoryName"]);
                        strCatHeadSlider.Append("</span><p>");
                        strCatHeadSlider.Append(catDesc);
                        strCatHeadSlider.Append("</p></div></div>");
                    }
                }
                if (isNoCategoryImage)
                {
                    InterceptImageController objImageResize = new InterceptImageController();
                    objImageResize.DynamicImageResizer(Imagelist, "Medium", "Category", aspxCommonObj);
                }
                strCatHeadSlider.Append("</div>");
                strCatHeadSlider.Append("<div class=\"slideshow-progress-bar-wrap\" style=\"display: none;\">");
                strCatHeadSlider.Append("<div class=\"highlight-bar\">");
                strCatHeadSlider.Append("<div class=\"edge left\"></div><div class=\"edge right\"></div>");
                strCatHeadSlider.Append("</div><div class=\"slideshow-progress-bar\"></div></div></div></div>");
                strCatHeadSlider.Append("</div>");
                strCatHeadScript.Append("$('#divHeader').show();");
                if (imgCount > 1)
                {
                    strCatHeadScript.Append("var catSlideshowWrap = jQuery('#slider-container').find('#sliderObj');");
                    strCatHeadScript.Append("var catSlidesContainer = catSlideshowWrap.find('div.cat-slide-container');");
                    strCatHeadScript.Append("var catSlides = catSlidesContainer.children('div');");
                    strCatHeadScript.Append("var pager = catSlideshowWrap.find('div.slideshow-progress-bar-wrap div.slideshow-progress-bar');");
                    strCatHeadScript.Append("var highlightBar = catSlideshowWrap.find('div.highlight-bar');");
                    strCatHeadScript.Append("var pagerMarkup = new Array();");
                    strCatHeadScript.Append("var pagerElPercentW = 1 / catSlides.length * 100;");
                    strCatHeadScript.Append("catSlides.each(function (i) {");
                    strCatHeadScript.Append("var oneBasedIndex = i + 1;");
                    strCatHeadScript.Append("pagerMarkup.push('<div class=pagerLink style=width: ' + pagerElPercentW + '%;><div class=pager' + oneBasedIndex + '></div></div>');");
                    strCatHeadScript.Append("});");
                    strCatHeadScript.Append("pager.append(pagerMarkup.join(''));");
                    strCatHeadScript.Append("highlightBar.css('width', pagerElPercentW + '%');");
                    strCatHeadScript.Append("var TRANSITION_SPEED = 500;");
                    strCatHeadScript.Append("catSlidesContainer.cycle({");
                    strCatHeadScript.Append("activePagerClass: 'active',");
                    strCatHeadScript.Append("before: function (curr, next, opts) {");
                    strCatHeadScript.Append("highlightBar.stop(true).animate(");
                    strCatHeadScript.Append("{");
                    strCatHeadScript.Append("'left': pager.find('div.pagerLink').eq(jQuery(next).index()).position().left");
                    strCatHeadScript.Append("},");
                    strCatHeadScript.Append("TRANSITION_SPEED");
                    strCatHeadScript.Append(");");
                    strCatHeadScript.Append("},");
                    strCatHeadScript.Append("fx: 'fade',");
                    strCatHeadScript.Append("speed: TRANSITION_SPEED,");
                    strCatHeadScript.Append("timeout: 5000,");
                    strCatHeadScript.Append("pause: 1,");
                    strCatHeadScript.Append("pauseOnPagerHover: 1,");
                    strCatHeadScript.Append("pager: '#slider-container #sliderObj div.slideshow-progress-bar-wrap div.slideshow-progress-bar',");
                    strCatHeadScript.Append("pagerAnchorBuilder: function (idx, slide) {");
                    strCatHeadScript.Append("return '#slider-container #sliderObj div.slideshow-progress-bar-wrap div.slideshow-progress-bar div.pagerLink:eq(' + idx + ')';");
                    strCatHeadScript.Append("},");
                    strCatHeadScript.Append("pagerEvent: 'mouseenter.cycle'");
                    strCatHeadScript.Append("});");
                    strCatHeadScript.Append("$('.slideshow-progress-bar-wrap').show();");
                    strCatHeadScript.Append("}");
                }
                if (!isNoCategoryImage)
                {
                    strCatHeadScript.Append(" $('#divHeader').remove();");
                }
                string script = GetStringScript(strCatHeadScript.ToString());
                strCatHeadSlider.Append(script);
                ltrCatSlider.Text = strCatHeadSlider.ToString();
            }
        }
    }
Esempio n. 16
0
    private void BindGiftGallery(List <GiftCardInfo> lstItemGallery)
    {
        string             aspxRootPath          = ResolveUrl("~/");
        StoreSettingConfig ssc                   = new StoreSettingConfig();
        string             NoImagePath           = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName);
        StringBuilder      galleryContainer      = new StringBuilder();
        StringBuilder      galleryThumbContainer = new StringBuilder();

        galleryThumbContainer.Append("<div id='divBindThumbs' class='jcarousel-skin'><ul id='thumblist'>");
        galleryContainer.Append("<div id='divMainImage'>");
        ImageCount = lstItemGallery.Count;
        if (lstItemGallery != null && lstItemGallery.Count > 0)
        {
            foreach (GiftCardInfo item in lstItemGallery)
            {
                string imagePath = item.GraphicImage;
                if (item.GraphicImage == "")
                {
                    imagePath = NoImagePath;
                }
                else
                {  //Resize Image Dynamically
                    InterceptImageController objImage = new InterceptImageController();
                    objImage.MultipleImageResizer(item.GraphicImage, (ImageType.Medium + ";" + ImageType.Large + ";" + ImageType.Small), ImageCategoryType.Item.ToString(), aspxCommonObj);
                }
                string rel = "useZoom: 'zoom1', smallImage: '" + aspxRootPath + imagePath + "' ";
                if (lstItemGallery.IndexOf(item) == 0)
                {
                    referImagePath = imagePath;
                    galleryContainer.Append("<a rel='' href=\"");
                    galleryContainer.Append(aspxRootPath);
                    galleryContainer.Append(imagePath);
                    galleryContainer.Append("\" id='zoom1' class='cloud-zoom'  title=\"");
                    galleryContainer.Append(item.GraphicName);
                    galleryContainer.Append("\"><img title=\"");
                    galleryContainer.Append(item.GraphicName);
                    galleryContainer.Append("\" src=\"");
                    galleryContainer.Append(aspxRootPath);
                    galleryContainer.Append(imagePath);
                    galleryContainer.Append("\"></a>");
                    galleryThumbContainer.Append("<li><a class='selected' rel=\"");
                    galleryThumbContainer.Append(rel);
                    galleryThumbContainer.Append("\" data-id=\"");
                    galleryThumbContainer.Append(item.GiftCardGraphicId);
                    galleryThumbContainer.Append("\" href=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" class='cloud-zoom-gallery'><img title=\"");
                    galleryThumbContainer.Append(item.GraphicName);
                    galleryThumbContainer.Append("\" src=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" class='zoom-tiny-image'></a></li>");
                }
                else
                {
                    galleryThumbContainer.Append("<li><a rel=\"");
                    galleryThumbContainer.Append(rel);
                    galleryThumbContainer.Append("\" data-id=\"");
                    galleryThumbContainer.Append(item.GiftCardGraphicId);
                    galleryThumbContainer.Append("\" href=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" class='cloud-zoom-gallery'><img title=\"");
                    galleryThumbContainer.Append(item.GraphicName);
                    galleryThumbContainer.Append("\" src=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" class='zoom-tiny-image'></a></li>");
                }
            }
        }
        else
        {
            galleryContainer.Append("<a rel='' href=\"");
            galleryContainer.Append(aspxRootPath);
            galleryContainer.Append(NoImagePath);
            galleryContainer.Append("\" id='zoom1' class='cloud-zoom' ");
            galleryContainer.Append("><img src=\"");
            galleryContainer.Append(aspxRootPath);
            galleryContainer.Append(NoImagePath.Replace("uploads", "uploads/Large"));
            galleryContainer.Append("\"></a>");
            string rel = "useZoom: 'zoom1', smallImage: '" + aspxRootPath + NoImagePath.Replace("uploads", "uploads/Large") + "' ";
            galleryThumbContainer.Append("<li><a rel=\"");
            galleryThumbContainer.Append(rel);
            galleryThumbContainer.Append("\" href=\"");
            galleryThumbContainer.Append(aspxRootPath);
            galleryThumbContainer.Append(NoImagePath);
            galleryThumbContainer.Append("\" class='cloud-zoom-gallery'><img src=\"");
            galleryThumbContainer.Append(aspxRootPath);
            galleryThumbContainer.Append(NoImagePath.Replace("uploads", "uploads/Small"));
            galleryThumbContainer.Append("\" class='zoom-tiny-image'></a></li>");
        }
        galleryContainer.Append("</ul></div>");
        galleryThumbContainer.Append("</div>");
        ltrItemGallery.Text = galleryContainer.ToString();
        ltrItemThumb.Text   = galleryThumbContainer.ToString();
    }
Esempio n. 17
0
    private void DisplayCartItems()
    {
        string modulePath = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        string pageExtension          = SageFrameSettingKeys.PageExtension;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        double arrRewardtotalPrice = 0;
        string arrRewardDetails    = "";
        string arrRewardSub        = "";


        List <CartInfo> itemsList = LoadCartItems();

        if (itemsList.Count > 0)
        {
            CartPRDiscount = AspxCartController.GetDiscountPriceRule(itemsList[0].CartID, aspxCommonObj, 0);
            GetDiscount();
        }
        itemsList = itemsList.Select(e => { e.KitData = Regex.Replace(e.KitData, "[\"\"]+", "'"); return(e); }).ToList();
        Items     = json_serializer.Serialize(itemsList);

        StringBuilder scriptBuilder_root = new StringBuilder();
        StringBuilder cartItemList       = new StringBuilder();

        if (itemsList.Count > 0)
        {
            CartItemCount = itemsList.Count;
            cartItemList.Append(
                GetStringScript(
                    " $('.cssClassSubTotalAmount,.cssClassLeftRightBtn,.cssClassapplycoupon,.cssClassBlueBtnWrapper').show();"));
            cartItemList.Append(
                "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" id=\"tblCartList\" class=\"sfGridTableWrapper\">");
            cartItemList.Append("<thead><tr class=\"cssClassHeadeTitle\" >");
            cartItemList.Append("<th class=\"cssClassSN\">Sn.");
            if (ShowItemImagesOnCart.ToLower() == "true")
            {
                cartItemList.Append("</th><th class=\"cssClassItemImageWidth\">");
                cartItemList.Append(getLocale("Item Description"));
            }
            cartItemList.Append("</th><th>");
            cartItemList.Append(getLocale("Variants"));
            cartItemList.Append("</th>");
            cartItemList.Append("<th class=\"cssClassQTY\">");
            cartItemList.Append(getLocale("Qty"));
            cartItemList.Append("</th>");
            cartItemList.Append("<th class=\"cssClassItemPrice\">");
            cartItemList.Append(getLocale("Unit Price"));
            cartItemList.Append("</th>");
            cartItemList.Append("<th class=\"cssClassSubTotal\">");
            cartItemList.Append(getLocale("Line Total"));
            cartItemList.Append("</th>");
            cartItemList.Append("<th class=\"cssClassAction\">");
            cartItemList.Append(getLocale("Action"));
            cartItemList.Append("</th>");
            cartItemList.Append(" </tr>");
            cartItemList.Append("</thead>");
            cartItemList.Append("<tbody>");
            List <BasketItem> basketItems = new List <BasketItem>();
            int index = 0;

            string bsketItems = "";
            bsketItems += "[";
            foreach (CartInfo item in itemsList)
            {
                if (item.ItemTypeID == 1)
                {
                    string bitems = "{" +
                                    string.Format(
                        "\'Height\':'{0}',\'ItemName\':'{1}',\'Length\':'{2}',\'Quantity\':'{3}',\'WeightValue\':'{4}',\'Width\':'{5}'",
                        item.Height ?? 0, item.ItemName,
                        item.Length ?? 0, item.Quantity.ToString(),
                        decimal.Parse(item.Weight.ToString()), item.Width ?? 0
                        )

                                    + "},";
                    bsketItems += bitems;
                }

                index = index + 1;
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                if (item.ImagePath == "")
                {
                    imagePath = NoImageMyCartPath;
                }
                else if (item.AlternateText == "")
                {
                    item.AlternateText = item.ItemName;
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(item.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                }
                else if (item.ImagePath != "")
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(item.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                }

                if ((itemsList.IndexOf(item)) % 2 == 0)
                {
                    cartItemList.Append("<tr class=\"sfEven\" >");
                }
                else
                {
                    cartItemList.Append("<tr class=\"sfOdd\" >");
                }
                cartItemList.Append("<td>");
                cartItemList.Append("<b>" + index + "." + "</b>");
                ;
                cartItemList.Append("</td>");
                if (item.ItemTypeID == 3)
                {
                    cartItemList.Append("<td>");

                    if (ShowItemImagesOnCart.ToLower() == "true")
                    {
                        cartItemList.Append("<p class=\"cssClassCartPicture\">");
                        cartItemList.Append("<img src='" + aspxRootPath +
                                            imagePath.Replace("uploads", "uploads/Small") + "'  alt=\"" +
                                            item.AlternateText + "\" title=\"" + item.AlternateText + "\" ></p>");
                    }
                    cartItemList.Append("<div class=\"cssClassCartPictureInformation\">");


                    cartItemList.Append("<a href=\"item/" + item.SKU + pageExtension + "\" costvariants=\"" +
                                        item.CostVariants +
                                        "\" onclick=\"AspxCart.SetCostVartSession(this);\" >" + item.ItemName +
                                        "</a>");
                    cartItemList.Append("<ul class='giftcardInfo'>");
                    cartItemList.Append("<li>");
                    cartItemList.Append(item.ShortDescription);
                    cartItemList.Append("</li>");
                    cartItemList.Append("</ul>");
                    cartItemList.Append("</div>");



                    cartItemList.Append("</td>");
                }
                else if (item.ItemTypeID == 6)
                {
                    cartItemList.Append("<td>");

                    if (ShowItemImagesOnCart.ToLower() == "true")
                    {
                        cartItemList.Append("<p class=\"cssClassCartPicture\">");
                        cartItemList.Append("<img src='" + aspxRootPath +
                                            imagePath.Replace("uploads", "uploads/Small") + "'  alt=\"" +
                                            item.AlternateText + "\" title=\"" + item.AlternateText + "\" ></p>");
                    }
                    cartItemList.Append("<div class=\"cssClassCartPictureInformation\">");


                    cartItemList.Append("<a href=\"item/" + item.SKU + pageExtension + "\" costvariants=\"" +
                                        item.CostVariants +
                                        "\" onclick=\"AspxCart.SetCostVartSession(this);\" >" + item.ItemName +
                                        "</a>");
                    string[] lis = Regex.Split(item.ShortDescription, "</br>");
                    cartItemList.Append("<ul class='kitInfo'>");

                    foreach (var li in lis)
                    {
                        cartItemList.Append("<li>" + li + "</li>");
                    }
                    cartItemList.Append("</ul>");
                    cartItemList.Append("</div>");


                    cartItemList.Append("</td>");
                }
                else
                {
                    cartItemList.Append("<td>");
                    if (ShowItemImagesOnCart.ToLower() == "true")
                    {
                        cartItemList.Append("<p class=\"cssClassCartPicture\">");
                        cartItemList.Append("<img src='" + aspxRootPath +
                                            imagePath.Replace("uploads", "uploads/Small") + "'  alt=\"" +
                                            item.AlternateText + "\" title=\"" + item.AlternateText + "\" ></p>");
                    }
                    cartItemList.Append("<div class=\"cssClassCartPictureInformation\">");

                    if (item.CostVariantsValueIDs != "")
                    {
                        cartItemList.Append("<a href=\"item/" + item.SKU + pageExtension + "?varId=" +
                                            item.CostVariantsValueIDs + "\"  costvariants=\"" + item.CostVariants +
                                            "\" onclick=\"AspxCart.SetCostVartSession(this);\" >" + item.ItemName +
                                            "</a>");
                    }
                    else
                    {
                        cartItemList.Append("<a href=\"item/" + item.SKU + pageExtension + "\" costvariants=\"" +
                                            item.CostVariants +
                                            "\" onclick=\"AspxCart.SetCostVartSession(this);\" >" + item.ItemName +
                                            "</a>");
                    }
                    cartItemList.Append("</div>");
                    cartItemList.Append("</td>");
                }
                cartItemList.Append("<td class=\"row-variants\">");
                cartItemList.Append(item.CostVariants);
                cartItemList.Append("</td>");
                cartItemList.Append("<td class=\"cssClassQTYInput\">");
                cartItemList.Append("<input class=\"num-pallets-input\" autocomplete=\"off\" price=\"" +
                                    Math.Round(double.Parse((item.Price).ToString()), 2).ToString() +
                                    "\" id=\"txtQuantity_" + item.CartItemID + "\" type=\"text\" cartID=\"" +
                                    item.CartID +
                                    "\" value=\"" + item.Quantity + "\" sku=\"" + item.SKU + "\"  quantityInCart=\"" + item.Quantity +
                                    "\" actualQty=\"" + item.ItemQuantity + "\" costVariantID=\"" +
                                    item.CostVariantsValueIDs + "\" itemID=\"" + item.ItemID + "\" addedValue=\"" +
                                    item.Quantity + "\" minCartQuantity=\"" + item.MinCartQuantity + "\" maxCartQuantity=\"" + item.MaxCartQuantity + "\">");
                cartItemList.Append("<label class=\"lblNotification\" style=\"color: #FF0000;\"></label></td>");
                cartItemList.Append("<td class=\"price-per-pallet\">");
                cartItemList.Append(
                    "<span class=\"cssClassFormatCurrency\">" +
                    Math.Round(double.Parse((item.Price).ToString()), 2).ToString("N2") + "</span>");
                cartItemList.Append("</td>");
                cartItemList.Append("<td class=\"row-total\">");
                cartItemList.Append("<input class=\"row-total-input cssClassFormatCurrency\" autocomplete=\"off\" id=\"txtRowTotal_" +
                                    item.CartID + "\" value=\"" +
                                    Math.Round(double.Parse((item.TotalItemCost).ToString()), 2).ToString("N2") +
                                    "\"  readonly=\"readonly\" type=\"text\" />");
                cartItemList.Append("</td>");
                cartItemList.Append("<td>");
                cartItemList.Append(" <a class=\"ClassDeleteCartItems\" title=\"Delete\" value=\"" +
                                    item.CartItemID + "\" cartID=\"" + item.CartID + "\"><i class=\"i-delete\"></i></a>");
                cartItemList.Append("</td>");
                cartItemList.Append("</tr>");

                arrRewardtotalPrice += Math.Round(double.Parse((item.Price * item.Quantity).ToString()), 2);

                arrRewardSub += "'<li>'+ " + item.Quantity + "+'X' +eval(" + (item.Price) +
                                "* rewardRate).toFixed(2)+ '</li>'+";
                arrRewardDetails += "'<li><b>'+eval( " + (item.TotalItemCost) +
                                    "* rewardRate).toFixed(2)+ '</b> " + getLocale("Points for Product:") + item.ItemName +
                                    "&nbsp &nbsp</li>'+";

                if (index == itemsList.Count)
                {
                    StringBuilder scriptBuilder = new StringBuilder();

                    scriptBuilder.Append("AspxCart.Vars.CartID =" + item.CartID + ";");
                    scriptBuilder.Append(" var rewardRate = parseFloat($('#hdnRewardRate').val());");
                    scriptBuilder.Append("var arrRewardDetails =" +
                                         arrRewardDetails.Substring(0, arrRewardDetails.Length - 1) + ";");
                    scriptBuilder.Append("var  arrRewardSub =" + arrRewardSub.Substring(0, arrRewardSub.Length - 1) +
                                         ";");
                    scriptBuilder.Append("if (isPurchaseActive == true){");
                    scriptBuilder.Append("$('#dvPointsTotal').empty(); $('#ulRewardDetails').html(arrRewardDetails);");
                    scriptBuilder.Append("$('#ulRewardSub').html(arrRewardSub);");
                    scriptBuilder.Append("$('#dvPointsTotal').append(eval(" + arrRewardtotalPrice + " * rewardRate).toFixed(2));");

                    scriptBuilder.Append("} ");
                    scriptBuilder.Append("AspxCart.GetDiscountCartPriceRule(AspxCart.Vars.CartID, 0);");
                    scriptBuilder.Append("$('#tblCartList tr:even ').addClass('sfEven');");
                    scriptBuilder.Append("$('#tblCartList tr:odd ').addClass('sfOdd');");
                    scriptBuilder.Append("$('.cssClassCartPicture img[title]').tipsy({ gravity: 'n' });");
                    scriptBuilder.Append("AspxCart.BindCartFunctions();");
                    bsketItems  = bsketItems.Substring(0, bsketItems.Length - 1);
                    bsketItems += "]";
                    scriptBuilder.Append(" AspxCart.SetBasketItems(eval(\"" + bsketItems + "\"));");
                }
            }
            cartItemList.Append("</table>");


            string rewardScript = LoadRewardPoints();
            scriptBuilder_root.Append(rewardScript);
            scriptBuilder_root.Append("if (isPurchaseActive == true){");
            scriptBuilder_root.Append(" var rewardRate = parseFloat($('#hdnRewardRate').val());");
            scriptBuilder_root.Append("var arrRewardDetails =" +
                                      arrRewardDetails.Substring(0, arrRewardDetails.Length - 1) + ";");
            scriptBuilder_root.Append("var  arrRewardSub =" + arrRewardSub.Substring(0, arrRewardSub.Length - 1) +
                                      ";");
            scriptBuilder_root.Append("$('#dvPointsTotal').empty(); $('#ulRewardDetails').html(arrRewardDetails);");
            scriptBuilder_root.Append("$('#ulRewardSub').html(arrRewardSub);");
            scriptBuilder_root.Append("$('#dvPointsTotal').append(eval(" + arrRewardtotalPrice + " * rewardRate).toFixed(2));");

            scriptBuilder_root.Append("} ");
            ltCartItems.Text = cartItemList.ToString();
        }
        else
        {
            StringBuilder scriptBuilder = new StringBuilder();

            scriptBuilder.Append("$('.cssClassCartInformation').html('<span class=\"cssClassNotFound\">" +
                                 getLocale("Your cart is empty!") + "</span>');");
            string script = GetStringScript(scriptBuilder.ToString());
            ltCartItems.Text = script;
        }
    }
Esempio n. 18
0
 private void GetItemRssFeedContents(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, int count)
 {
     try
     {
         string             noImageUrl = string.Empty;
         StoreSettingConfig ssc        = new StoreSettingConfig();
         noImageUrl = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, aspxCommonObj.StoreID,
                                                aspxCommonObj.PortalID, aspxCommonObj.CultureName);
         string[] path                 = pageURL.Split('?');
         string   pagepath             = path[0];
         string   x                    = HttpContext.Current.Request.ApplicationPath;
         string   authority            = HttpContext.Current.Request.Url.Authority;
         string   pageUrl              = authority + x;
         ServiceItemController sic     = new ServiceItemController();
         List <ServiceItemRss> itemRss = sic.GetServiceTypeRssFeedContent(aspxCommonObj, count);
         if (itemRss.Count > 0)
         {
             foreach (ServiceItemRss rssItemData in itemRss)
             {
                 string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + rssItemData.ImagePath;
                 if (rssItemData.ImagePath != "")
                 {
                     //Resize Image Dynamically
                     InterceptImageController.ImageBuilder(rssItemData.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                 }
                 rssXml.WriteStartElement("item");
                 rssXml.WriteElementString("title", rssItemData.ServiceName);
                 rssXml.WriteElementString("link",
                                           "http://" + pageUrl + "/service/" + rssItemData.ServiceName +
                                           SageFrameSettingKeys.PageExtension);
                 rssXml.WriteStartElement("description");
                 var description = "";
                 if (rssItemData.ImagePath == "")
                 {
                     imagePath = noImageUrl;
                 }
                 description = "<div><a href=http://" + pageUrl + "/service/" + rssItemData.ServiceName +
                               SageFrameSettingKeys.PageExtension + "><img src=http://" + pageUrl + "/" +
                               imagePath.Replace("uploads", "uploads/Small") + " alt=" + rssItemData.ServiceName + " /> </a></div>";
                 description += "</br>" + HttpUtility.HtmlDecode(rssItemData.ShortDescription);
                 rssXml.WriteCData(description);
                 rssXml.WriteEndElement();
                 rssXml.WriteElementString("pubDate", rssItemData.AddedOn);
                 rssXml.WriteEndElement();
             }
         }
         else
         {
             rssXml.WriteStartElement("item");
             rssXml.WriteElementString("title", "");
             rssXml.WriteElementString("link", "");
             rssXml.WriteStartElement("description");
             var description = "";
             description = "<div><h2><span>This store has no items listed yet!</span></h2></div>";
             rssXml.WriteCData(description);
             rssXml.WriteEndElement();
             rssXml.WriteEndElement();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 19
0
    public void BindMyWishList()
    {
        string         flagShowAll   = "0";
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        string modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(modulePath);
        string               pageExtension = SageFrameSettingKeys.PageExtension;
        WishItemController   ctrl          = new WishItemController();
        List <WishItemsInfo> lstWishItem   = ctrl.GetRecentWishItemList(aspxCommonObj, flagShowAll,
                                                                        NoOfRecentAddedWishItems);
        StringBuilder recentWishList = new StringBuilder();

        recentWishList.Append("<div class=\"cssClassCommonSideBoxTable wishItem\">");
        if (lstWishItem != null && lstWishItem.Count > 0)
        {
            recentWishList.Append("<table class=\"cssClassMyWishItemTable\" id=\"tblWishItem\" width=\"100%\">");
            string myWishListLink = "";
            if (userFriendlyURL)
            {
                myWishListLink = WishListURL + pageExtension;
            }
            else
            {
                myWishListLink = WishListURL;
            }
            recentWishList.Append("<tbody>");
            for (int i = 0; i < lstWishItem.Count; i++)
            {
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + lstWishItem[i].ImagePath;
                if (string.IsNullOrEmpty(lstWishItem[i].ImagePath))
                {
                    imagePath = NoImageWishItemPath;
                }
                else
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(lstWishItem[i].ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                }
                if (lstWishItem[i].AlternateText == "")
                {
                    lstWishItem[i].AlternateText = lstWishItem[i].ItemName;
                }
                var href = "";
                if (lstWishItem[i].CostVariantValueIDs == "")
                {
                    href = aspxRedirectPath + "item/" + lstWishItem[i].SKU + pageExtension;
                }
                else
                {
                    href = aspxRedirectPath + "item/" + lstWishItem[i].SKU + pageExtension + "?varId=" +
                           lstWishItem[i].CostVariantValueIDs;
                }
                StringBuilder dataContent = new StringBuilder();
                dataContent.Append("data-class=\"addtoCart\" data-type=\"button\" data-addtocart=\"");
                dataContent.Append("addtocart");
                dataContent.Append(lstWishItem[i].ItemID);
                dataContent.Append("\" data-title=\"");
                dataContent.Append(lstWishItem[i].ItemName);
                dataContent.Append("\" data-onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                dataContent.Append(lstWishItem[i].ItemID);
                dataContent.Append(",");
                dataContent.Append(lstWishItem[i].Price);
                dataContent.Append(",'");
                dataContent.Append(lstWishItem[i].SKU);
                dataContent.Append("',");
                dataContent.Append(1);
                dataContent.Append(",'");
                dataContent.Append(lstWishItem[i].IsCostVariantItem);
                dataContent.Append("',this);\"");
                if (i % 2 == 0)
                {
                    recentWishList.Append("<tr class=\"sfEven\" id=\"trWishItem_" + lstWishItem[i].ItemID +
                                          "\"><td class=\"cssClassWishItemDetails\">");
                    if (ShowWishedItemImage.ToLower() == "true")
                    {
                        recentWishList.Append("<a href =\"" + href + "\">");
                        recentWishList.Append("<div class=\"cssClassImage\"><img src=\"" + aspxRootPath +
                                              imagePath.Replace("uploads", "uploads/Small") + "\" alt=\"" +
                                              lstWishItem[i].AlternateText + "\"  title=\"" +
                                              lstWishItem[i].AlternateText +
                                              "\"/></div></a>");
                    }
                    if (lstWishItem[i].ItemCostVariantValue != "")
                    {
                        recentWishList.Append("<a href=\"" + href + "\">" + lstWishItem[i].ItemName + "(" +
                                              lstWishItem[i].ItemCostVariantValue + ")" + "</a>");
                        recentWishList.Append("</br><span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                              decimal.Parse(lstWishItem[i].Price).ToString("N2") + "</span></td>");
                        recentWishList.Append("<td class=\"cssClassDelete\">");
                        recentWishList.Append(
                            "<img onclick=\"wishItemsFront.DeleteWishListItem(" + lstWishItem[i].WishItemID + ")\" src=\"" +
                            aspxTemplateFolderPath + "/images/admin/btndelete.png\"/>");
                        recentWishList.Append("</td></tr>");
                    }
                    else
                    {
                        recentWishList.Append("<a href=\"" + href + "\">" + lstWishItem[i].ItemName + "</a>");
                        recentWishList.Append("</br><span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                              decimal.Parse(lstWishItem[i].Price).ToString("N2") + "</span></td>");
                        recentWishList.Append("<td class=\"cssClassDelete\">");
                        recentWishList.Append(
                            "<img onclick=\"wishItemsFront.DeleteWishListItem(" + lstWishItem[i].WishItemID + ")\" src=\"" +
                            aspxTemplateFolderPath + "/images/admin/btndelete.png\"/>");
                        recentWishList.Append("</td></tr>");
                    }
                }
                else
                {
                    recentWishList.Append("<tr class=\"sfOdd\" id=\"trWishItem_" + lstWishItem[i].ItemID +
                                          "\"><td class=\"cssClassWishItemDetails\">");
                    if (ShowWishedItemImage.ToLower() == "true")
                    {
                        recentWishList.Append("<a href =\"" + href + "\">");
                        recentWishList.Append("<div class=\"cssClassImage\"><img src=\"" + aspxRootPath +
                                              imagePath.Replace("uploads", "uploads/Small") + "\" alt=\"" +
                                              lstWishItem[i].AlternateText + "\"  title=\"" +
                                              lstWishItem[i].AlternateText + "\"/></div></a>");
                    }
                    if (lstWishItem[i].ItemCostVariantValue != "")
                    {
                        recentWishList.Append("<a href=\"" + href + "\">" + lstWishItem[i].ItemName + "(" +
                                              lstWishItem[i].ItemCostVariantValue + ")" + "</a>");
                        recentWishList.Append("</br><span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                              decimal.Parse(lstWishItem[i].Price).ToString("N2") + "</span></td>");
                        recentWishList.Append("<td class=\"cssClassDelete\">");
                        recentWishList.Append(
                            "<img onclick=\"wishItemsFront.DeleteWishListItem(" + lstWishItem[i].WishItemID + ")\" src=\"" +
                            aspxTemplateFolderPath + "/images/admin/btndelete.png\"/>");
                        recentWishList.Append("</td></tr>");
                    }
                    else
                    {
                        recentWishList.Append("<a href=\"" + href + "\">" + lstWishItem[i].ItemName + "</a>");
                        recentWishList.Append("</br><span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                              decimal.Parse(lstWishItem[i].Price).ToString("N2") + "</span></td>");
                        recentWishList.Append("<td class=\"cssClassDelete\">");
                        recentWishList.Append(
                            "<img onclick=\"wishItemsFront.DeleteWishListItem(" + lstWishItem[i].WishItemID + ")\" src=\"" +
                            aspxTemplateFolderPath + "/images/admin/btndelete.png\"/>");
                        recentWishList.Append("</td></tr>");
                    }
                }
            }
            recentWishList.Append("</tbody>");
            recentWishList.Append("</table>");
            recentWishList.Append("<div class=\"cssClassWishLink\">");
            recentWishList.Append("<a href=\"" + aspxRedirectPath + myWishListLink + "\" id=\"lnkGoToWishlist\">");
            recentWishList.Append("<span class=\"gowishlist\">" + getLocale("Go to Wishlist") + "</span></a>");
            recentWishList.Append("</div></div>");
        }
        else
        {
            recentWishList.Append("<tbody>");
            recentWishList.Append("<tr><td><span class=\"cssClassNotFound\">" + getLocale("Your Wishlist is empty!") +
                                  "</span></td></tr>");
            recentWishList.Append("</tbody>");
            recentWishList.Append("</table></div>");
        }

        ltrWishItem.Text = recentWishList.ToString();
    }
Esempio n. 20
0
    private void BindGiftGallery(List <GiftCardInfo> lstItemGallery)
    {
        string             aspxRootPath          = ResolveUrl("~/");
        StoreSettingConfig ssc                   = new StoreSettingConfig();
        string             NoImagePath           = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName);
        StringBuilder      galleryContainer      = new StringBuilder();
        StringBuilder      galleryThumbContainer = new StringBuilder();

        galleryThumbContainer.Append("<div class='multizoom1 thumbs jcarousel-skin'><ul>");
        galleryContainer.Append("<div class='targetarea'>");
        if (lstItemGallery != null && lstItemGallery.Count > 0)
        {
            foreach (GiftCardInfo item in lstItemGallery)
            {
                string imagePath = item.GraphicImage;
                if (item.GraphicImage == "")
                {
                    imagePath = NoImagePath;
                }
                else
                {  //Resize Image Dynamically
                    InterceptImageController objImage = new InterceptImageController();
                    objImage.MultipleImageResizer(item.GraphicImage, (ImageType.Medium + ";" + ImageType.Large + ";" + ImageType.Small), ImageCategoryType.Item.ToString(), aspxCommonObj);
                }
                if (lstItemGallery.IndexOf(item) == 0)
                {
                    referImagePath = imagePath;
                    galleryContainer.Append("<img  id='multizoom1' title=\"");
                    galleryContainer.Append(item.GraphicName);
                    galleryContainer.Append("\" src=\"");
                    galleryContainer.Append(aspxRootPath);
                    galleryContainer.Append(imagePath);
                    galleryContainer.Append("\" >");
                    galleryThumbContainer.Append("<li><a class='selected'  href=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" data-id=\"");
                    galleryThumbContainer.Append(item.GiftCardGraphicId);
                    galleryThumbContainer.Append("\" data-large=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" ><img title=\"");
                    galleryThumbContainer.Append(item.GraphicName);
                    galleryThumbContainer.Append("\" src=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" ></a></li>");
                }
                else
                {
                    galleryThumbContainer.Append("<li><a  href=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" data-id=\"");
                    galleryThumbContainer.Append(item.GiftCardGraphicId);
                    galleryThumbContainer.Append("\" data-large=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" ><img title=\"");
                    galleryThumbContainer.Append(item.GraphicName);
                    galleryThumbContainer.Append("\" src=\"");
                    galleryThumbContainer.Append(aspxRootPath);
                    galleryThumbContainer.Append(imagePath);
                    galleryThumbContainer.Append("\" ></a></li>");
                }
            }
        }
        galleryContainer.Append("</ul></div>");
        galleryThumbContainer.Append("</div>");
        ltrItemGallery.Text = galleryContainer.ToString();
        ltrItemThumb.Text   = galleryThumbContainer.ToString();
    }
Esempio n. 21
0
    private void BindGallery(List <ItemsInfoSettings> lstItemGallery)
    {
        string             aspxRootPath          = ResolveUrl("~/");
        StoreSettingConfig ssc                   = new StoreSettingConfig();
        string             NoImagePath           = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName);
        StringBuilder      galleryContainer      = new StringBuilder();
        StringBuilder      galleryThumbContainer = new StringBuilder();

        galleryThumbContainer.Append("<div class='multizoom1 thumbs jcarousel-skin'><ul>");
        galleryContainer.Append("<div class='targetarea'>");
        if (lstItemGallery != null && lstItemGallery.Count > 0)
        {
            foreach (ItemsInfoSettings item in lstItemGallery)
            {
                string imagePath    = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                string altImagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.AlternateText;
                if (item.ImagePath == "")
                {
                    imagePath = NoImagePath;
                }
                else
                {   //Resize Image Dynamically
                    InterceptImageController objImage = new InterceptImageController();
                    objImage.MultipleImageResizer(item.ImagePath, (ImageType.Medium + ";" + ImageType.Large + ";" + ImageType.Small), ImageCategoryType.Item.ToString(), aspxCommonObj);
                }
                if (lstItemGallery.IndexOf(item) == 0)
                {
                    referImagePath = imagePath;
                    galleryContainer.Append("<img  id='multizoom1' title=\"");
                    galleryContainer.Append(item.AlternateText);
                    galleryContainer.Append("\" src=\"");
                    galleryContainer.Append(aspxRootPath);
                    galleryContainer.Append(imagePath.Replace("uploads", "uploads/Large"));
                    galleryContainer.Append("\" >");
                }
                galleryThumbContainer.Append("<li><a  href=\"");
                galleryThumbContainer.Append(aspxRootPath);
                galleryThumbContainer.Append(imagePath.Replace("uploads", "uploads/Large"));
                galleryThumbContainer.Append("\" data-large=\"");
                galleryThumbContainer.Append(aspxRootPath);
                galleryThumbContainer.Append(imagePath);
                galleryThumbContainer.Append("\" ><img title=\"");
                galleryThumbContainer.Append(item.AlternateText);
                galleryThumbContainer.Append("\" src=\"");
                galleryThumbContainer.Append(aspxRootPath);
                galleryThumbContainer.Append(imagePath.Replace("uploads", "uploads/Small"));
                galleryThumbContainer.Append("\" ></a></li>");
            }
        }
        else
        {
            galleryContainer.Append("<img  id='multizoom1' src=\"");
            galleryContainer.Append(aspxRootPath);
            galleryContainer.Append(NoImagePath.Replace("uploads", "uploads/Large"));
            galleryContainer.Append("\">");
            galleryThumbContainer.Append("<li><a  href=\"");
            galleryThumbContainer.Append(aspxRootPath);
            galleryThumbContainer.Append(NoImagePath.Replace("uploads", "uploads/Large"));
            galleryThumbContainer.Append("\" data-large=\"");
            galleryThumbContainer.Append(aspxRootPath);
            galleryThumbContainer.Append(NoImagePath);
            galleryThumbContainer.Append("\" ><img ");
            galleryThumbContainer.Append(" src=\"");
            galleryThumbContainer.Append(aspxRootPath);
            galleryThumbContainer.Append(NoImagePath.Replace("uploads", "uploads/Small"));
            galleryThumbContainer.Append("\"></a></li>");
        }
        galleryContainer.Append("</ul></div>");
        galleryThumbContainer.Append("</div>");
        ltrItemGallery.Text = galleryContainer.ToString();
        ltrItemThumb.Text   = galleryThumbContainer.ToString();
    }
Esempio n. 22
0
    public void GetSpecialItems()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        string modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(modulePath);
        string pageExtension                    = SageFrameSettingKeys.PageExtension;
        int    rowTotal                         = 0;
        SpecialItemsController  sic             = new SpecialItemsController();
        List <SpecialItemsInfo> lstSpecialItems = sic.GetSpecialItems(aspxCommonObj, NoOfSpecialItems);

        rowTotal = lstSpecialItems.Count;
        if (rowTotal > NoOfSpecialItems)
        {
            lstSpecialItems.RemoveAt(lstSpecialItems.Count - 1);
        }
        StringBuilder specialContent = new StringBuilder();

        if (lstSpecialItems != null && lstSpecialItems.Count > 0)
        {
            specialContent.Append("<div class=\"cssClassSpecialBoxInfo\" id=\"divSpItem\">");
            foreach (SpecialItemsInfo item in lstSpecialItems)
            {
                string imagePath    = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                string altImagePath = "";// "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.AlternateImagePath;
                if (item.ImagePath == "")
                {
                    imagePath = DefaultImagePath;
                }
                else
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(item.ImagePath, ImageType.Medium, ImageCategoryType.Item, aspxCommonObj);
                }
                if (item.AlternateText == "")
                {
                    item.AlternateText = item.Name;
                }
                if (item.ImagePath == "")
                {
                    altImagePath = imagePath;
                }
                string itemPrice      = Math.Round(double.Parse((item.Price).ToString()), 2).ToString("N2");
                string itemPriceValue = Math.Round(double.Parse((item.Price).ToString()), 2).ToString();
                string itemPriceRate  = Math.Round(double.Parse((item.Price).ToString()), 2).ToString("N2");

                if ((lstSpecialItems.IndexOf(item) + 1) % NoOfItemInRow == 0)
                {
                    specialContent.Append("<div class=\"cssClassProductsBox cssClassNoMargin\">");
                }
                else
                {
                    specialContent.Append("<div class=\"cssClassProductsBox\">");
                }
                var hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(item.SKU) + pageExtension;
                specialContent.Append("<div id=\"productImageWrapID_");
                specialContent.Append(item.ItemID);
                specialContent.Append("\" class=\"cssClassProductsBoxInfo\" costvariantItem=");
                specialContent.Append(item.CostVariants);
                specialContent.Append("  itemid=\"");
                specialContent.Append(item.ItemID);
                specialContent.Append("\">");
                specialContent.Append("<h3>");
                specialContent.Append(item.SKU);
                specialContent.Append("</h3><div class=\"divQuickLookonHover\"><div class=\"divitemImage cssClassProductPicture\"><a href=\"");
                specialContent.Append(hrefItem);
                specialContent.Append("\" ><img id=\"img_");
                specialContent.Append(item.ItemID);
                specialContent.Append("\"  alt=\"");
                specialContent.Append(item.AlternateText);
                specialContent.Append("\"  title=\"");
                specialContent.Append(item.AlternateText);
                specialContent.Append("\"");
                specialContent.Append("src=\"");
                specialContent.Append(aspxRootPath);
                specialContent.Append(imagePath.Replace("uploads", "uploads/Medium"));
                specialContent.Append("\" orignalPath=\"");
                specialContent.Append(imagePath.Replace("uploads", "uploads/Medium"));
                specialContent.Append("\" altImagePath=\"");
                specialContent.Append(altImagePath.Replace("uploads", "uploads/Medium"));
                specialContent.Append("\"/></a></div>");
                specialContent.Append("<div class='cssLatestItemInfo clearfix'>");
                specialContent.Append("<h2><a href=\"");
                specialContent.Append(hrefItem);
                specialContent.Append("\" title=\"" + item.Name + "\">");

                string name = string.Empty;
                if (item.Name.Length > 50)
                {
                    name = item.Name.Substring(0, 50);
                    int index = 0;
                    index = name.LastIndexOf(' ');
                    name  = name.Substring(0, index);
                    name  = name + "...";
                }
                else
                {
                    name = item.Name;
                }
                specialContent.Append(name);
                specialContent.Append("</a></h2>");
                StringBuilder dataContent = new StringBuilder();
                dataContent.Append("data-class=\"addtoCart\" data-ItemTypeID=\"" + item.ItemTypeID + "\" data-type=\"button\" data-ItemID=\"" + item.ItemID + "\" data-addtocart=\"");
                dataContent.Append("addtocart");
                dataContent.Append(item.ItemID);
                dataContent.Append("\" data-title=\"");
                dataContent.Append(name);
                dataContent.Append("\" data-onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                dataContent.Append(item.ItemID);
                dataContent.Append(",");
                dataContent.Append(itemPriceValue);
                dataContent.Append(",'");
                dataContent.Append(item.SKU);
                dataContent.Append("',");
                dataContent.Append(1);
                dataContent.Append(",'");
                dataContent.Append(item.CostVariants);
                dataContent.Append("',this);\"");
                if (item.HidePrice != true)
                {
                    if (item.ListPrice != null)
                    {//Added for group type products
                        if (item.ItemTypeID == 5)
                        {
                            specialContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                            specialContent.Append("<p class=\"cssClassProductRealPrice \">");
                            specialContent.Append(getLocale("Starting At"));
                            specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                            specialContent.Append(itemPriceRate);
                            specialContent.Append("</span></p></div></div>");
                        }
                        else
                        {
                            string strAmount = Math.Round((double)(item.ListPrice), 2).ToString("N2");
                            specialContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                            specialContent.Append("<p class=\"cssClassProductOffPrice\">");
                            specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                            specialContent.Append(strAmount);
                            specialContent.Append("</span></p><p class=\"cssClassProductRealPrice \">");
                            specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                            specialContent.Append(itemPriceRate);
                            specialContent.Append("</span></p></div></div>");
                        }
                    }
                    else
                    {
                        if (item.ItemTypeID == 5)
                        {
                            specialContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                            specialContent.Append("<p class=\"cssClassProductRealPrice \" >");
                            specialContent.Append(getLocale("Starting At"));
                            specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                            specialContent.Append(itemPriceRate);
                            specialContent.Append("</span></p></div></div>");
                        }
                        else
                        {
                            specialContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                            specialContent.Append("<p class=\"cssClassProductRealPrice \" >");
                            specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                            specialContent.Append(itemPriceRate);
                            specialContent.Append("</span></p></div></div>");
                        }
                    }
                }
                else
                {
                    specialContent.Append("<div class=\"cssClassProductPriceBox\"></div>");
                }

                specialContent.Append("<div class=\"cssClassProductDetail\"><p><a href=\"");
                specialContent.Append(aspxRedirectPath);
                specialContent.Append("item/");
                specialContent.Append(item.SKU);
                specialContent.Append(pageExtension);
                specialContent.Append("\">");
                specialContent.Append(getLocale("Details"));
                specialContent.Append("</a></p></div>");

                specialContent.Append("<div class=\"sfQuickLook\" style=\"display:none\">");
                specialContent.Append("<img itemId=\"");
                specialContent.Append(item.ItemID);
                specialContent.Append("\" sku=\"");
                specialContent.Append(item.SKU);
                specialContent.Append("\" src=\"");
                specialContent.Append(aspxTemplateFolderPath);
                specialContent.Append("/images/QV_Button.png\" alt=\"\" rel=\"popuprel\" />");
                specialContent.Append("</div>");
                if (item.AttributeValues != null)
                {
                    if (item.AttributeValues != "")
                    {
                        specialContent.Append("<div class=\"cssGridDyanamicAttr\">");
                        string[] attributeValues = item.AttributeValues.Split(',');
                        foreach (string element in attributeValues)
                        {
                            string[] attributes     = element.Split('#');
                            string   attributeName  = attributes[0];
                            string   attributeValue = attributes[1];
                            int      inputType      = Int32.Parse(attributes[2]);
                            string   validationType = attributes[3];
                            specialContent.Append("<div class=\"cssDynamicAttributes\">");
                            specialContent.Append("<div class=\"cssDynamicAttributes\">");
                            specialContent.Append("<span>");
                            specialContent.Append(attributeName);
                            specialContent.Append("</span> :");
                            if (inputType == 7)
                            {
                                specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                            }
                            else
                            {
                                specialContent.Append("<span>");
                            }
                            specialContent.Append(attributeValue);
                            specialContent.Append("</span></div>");
                        }
                        specialContent.Append("</div>");
                    }
                }
                string itemSKU  = item.SKU;
                string itemName = item.Name;

                specialContent.Append("<div class=\"cssClassTMar20\">");
                if (AllowAddToCart.ToLower() == "true")
                {
                    if (AllowOutStockPurchase.ToLower() == "false")
                    {
                        if (item.IsOutOfStock == true)
                        {
                            specialContent.Append("<div class=\"cssClassAddtoCard\"><div " + dataContent + " class=\"sfButtonwrapper cssClassOutOfStock\">");
                            specialContent.Append("<button type=\"button\"><span>");
                            specialContent.Append(getLocale("Out Of Stock"));
                            specialContent.Append("</span></button></div></div>");
                        }
                        else
                        {
                            specialContent.Append("<div class=\"cssClassAddtoCard\"><div " + dataContent + " class=\"sfButtonwrapper\">");
                            specialContent.Append("<label class='i-cart cssClassCartLabel cssClassGreenBtn'><button type=\"button\" class=\"addtoCart\"");
                            specialContent.Append("data-addtocart=\"");
                            specialContent.Append("addtocart");
                            specialContent.Append(item.ItemID);
                            specialContent.Append("\" title=\"");
                            specialContent.Append(itemName);
                            specialContent.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            specialContent.Append(item.ItemID);
                            specialContent.Append(",");
                            specialContent.Append(itemPriceValue);
                            specialContent.Append(",'");
                            specialContent.Append(itemSKU);
                            specialContent.Append("',");
                            specialContent.Append(1);
                            specialContent.Append(",'");
                            specialContent.Append(item.CostVariants);
                            specialContent.Append("',this);\">");
                            specialContent.Append(getLocale("Cart +"));
                            specialContent.Append("</button></label></div></div>");
                        }
                    }
                    else
                    {
                        specialContent.Append("<div class=\"cssClassAddtoCard\"><div " + dataContent + " class=\"sfButtonwrapper\">");
                        specialContent.Append("<label class='i-cart cssClassCartLabel cssClassGreenBtn'><button type=\"button\" class=\"addtoCart\"");
                        specialContent.Append("data-addtocart=\"");
                        specialContent.Append("addtocart");
                        specialContent.Append(item.ItemID);
                        specialContent.Append("\" title=\"");
                        specialContent.Append(itemName);
                        specialContent.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                        specialContent.Append(item.ItemID);
                        specialContent.Append(",");
                        specialContent.Append(itemPriceValue);
                        specialContent.Append(",'");
                        specialContent.Append(itemSKU);
                        specialContent.Append("',");
                        specialContent.Append(1);
                        specialContent.Append(",'");
                        specialContent.Append(item.CostVariants);
                        specialContent.Append("',this);\">");
                        specialContent.Append(getLocale("Cart +"));
                        specialContent.Append("</button></label></div></div>");
                    }
                }
                specialContent.Append("<div class=\"cssClassWishListButton\">");
                specialContent.Append("<input type=\"hidden\" name='itemwish' value=");
                specialContent.Append(item.ItemID);
                specialContent.Append(",'");
                specialContent.Append(item.SKU);
                specialContent.Append("',this  />");
                specialContent.Append("</div>");
                specialContent.Append("</div></div>");
                specialContent.Append("</div></div>");
                specialContent.Append("</div>");
            }

            specialContent.Append("</div>");
            if (rowTotal > NoOfItemInRow)
            {
                string strHtml = "<a href=\"" + aspxRedirectPath + SpecialDetailPage + pageExtension + "?id=special\">" + getLocale("View More") + "</a>";
                divViewMoreSpecial.InnerHtml = strHtml;
            }
            ltrSpecialItems.Text = specialContent.ToString();
        }
        else
        {
            StringBuilder noSpl = new StringBuilder();
            noSpl.Append("<span class=\"cssClassNotFound\">");
            noSpl.Append(getLocale("No special item found in this store!"));
            noSpl.Append("</span>");
            divSpclBox.InnerHtml = noSpl.ToString();
            divSpclBox.Attributes.Add("class", "");
        }
    }
    private void GetCategoryMenuList(AspxCommonInfo aspxCommonObj)
    {
        categoryImagePath = "Modules/AspxCommerce/AspxCategoryManagement/uploads/";
        string scriptAdd  = string.Empty;
        string modulePath = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        MegaCategoryController      objCat     = new MegaCategoryController();
        List <MegaCategoryViewInfo> megaCatIfo = objCat.GetCategoryMenuList(aspxCommonObj);

        if (megaCatIfo != null && megaCatIfo.Count > 0)
        {
            int           categoryID   = 0;
            StringBuilder catListmaker = new StringBuilder();
            if (modeOfView == "vertical")
            {
                catListmaker.Append(
                    "<div id=\"divCatHeader\" class=\"divHeaderTitle\"><h2 class=\"cssClassLeftHeader\"><span>");
                catListmaker.Append(getLocale("Categories"));
                catListmaker.Append("</span>");

                catListmaker.Append(
                    "<a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>");
                catListmaker.Append("<ul class='mega-menuV' id='divMegaMenu'>");
            }
            else if (modeOfView == "horizontal")
            {
                catListmaker.Append("<ul class='mega-menuH' id='mega-menuH'>");
            }
            else
            {
                catListmaker.Append("<div id=\"divCatHeader\" style='display:none'><span>");
                catListmaker.Append(getLocale("Categories"));
                catListmaker.Append("</span></div>");
                catListmaker.Append("<ul class='mega-menuV cssMegaCategoryLi' id='divMegaMenu'>");
                catListmaker.Append("<div class=\"cssCollapable\"><h2><span>");
                catListmaker.Append(getLocale("All Categories"));
                catListmaker.Append("</span><a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>");
            }

            foreach (MegaCategoryViewInfo eachCat in megaCatIfo)
            {
                categoryID = eachCat.CategoryID;
                if (eachCat.CategoryLevel == 0)
                {
                    catListmaker.Append("<li><a href=\"");
                    catListmaker.Append(aspxRedirectPath);
                    catListmaker.Append("category/");
                    string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue);
                    catListmaker.Append(strRet);
                    catListmaker.Append(SageFrameSettingKeys.PageExtension);
                    catListmaker.Append("\">");
                    catListmaker.Append(eachCat.AttributeValue);
                    catListmaker.Append("</a>");
                    if (eachCat.ChildCount > 0)
                    {
                        catListmaker.Append("<ul>");
                        catListmaker.Append(BindChildCategory(megaCatIfo, categoryID, aspxCommonObj));
                        if (showCatImage == true)
                        {
                            if (eachCat.CategoryImagePath != null && eachCat.CategoryImagePath != "")
                            {
                                //Resize Image Dynamically
                                InterceptImageController.ImageBuilder(eachCat.CategoryImagePath, ImageType.Medium, ImageCategoryType.Category, aspxCommonObj);
                                string imagePath = aspxRedirectPath + categoryImagePath + eachCat.CategoryImagePath;
                                catListmaker.Append("<div class=\"classCatImage\"><img src=\"");
                                catListmaker.Append(imagePath.Replace("uploads", "uploads/Medium"));
                                catListmaker.Append("\" alt=\"");
                                catListmaker.Append(eachCat.AttributeValue);
                                catListmaker.Append("\" title=\"");
                                catListmaker.Append(eachCat.AttributeValue);
                                catListmaker.Append("\" /></div>");
                            }
                        }
                        catListmaker.Append("</ul>");
                    }
                    catListmaker.Append("</li>");
                }
            }
            catListmaker.Append("</ul>");
            catListmaker.Append("<div id=\"sf-Responsive-Cat\" style=\"display:none;\">");
            catListmaker.Append("<div id=\"sf-CatMenu\">");
            catListmaker.Append(getLocale("Categories"));
            catListmaker.Append("</div>");
            catListmaker.Append("<ul class=\"sf-CatContainer\" style=\"display:none;\">");
            foreach (MegaCategoryViewInfo eachCat in megaCatIfo)
            {
                categoryID = eachCat.CategoryID;
                if (eachCat.CategoryLevel == 0)
                {
                    if (eachCat.ChildCount > 0)
                    {
                        catListmaker.Append("<li class=\"parent\">");
                    }
                    else
                    {
                        catListmaker.Append("<li>");
                    }
                    catListmaker.Append("<a href=\"");
                    catListmaker.Append(aspxRedirectPath);
                    catListmaker.Append("category/");
                    string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue);
                    catListmaker.Append(strRet);
                    catListmaker.Append(SageFrameSettingKeys.PageExtension);
                    catListmaker.Append("\">");
                    catListmaker.Append(eachCat.AttributeValue);
                    catListmaker.Append("</a>");
                    if (eachCat.ChildCount > 0)
                    {
                        catListmaker.Append("<ul style=\"display:none;\">");
                        catListmaker.Append(BindResChildCategory(megaCatIfo, categoryID, aspxCommonObj));
                        catListmaker.Append("</ul style=\"display:none;\">");
                    }
                    catListmaker.Append("</li>");
                }
            }
            catListmaker.Append("</ul></div>");
            divMegaCategory.InnerHtml = catListmaker.ToString();
        }
        else
        {
            string strText = string.Empty;
            if (modeOfView == "collapseable")
            {
                strText = "<div class=\"cssCollapable\"><h2><span>" + getLocale("All Categories") + "</span><a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>";
            }
            strText += ("<span id=\"spanCatNotFound\" class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + "</span>");//Need to add Local Text
            divMegaCategory.InnerHtml = strText;
        }
    }
Esempio n. 24
0
    private void BindCompareItems()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        aspxCommonObj.SessionCode = SessionCode;
        string aspxRootPath = ResolveUrl("~/");
        string modulePath   = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        StringBuilder           compareItemContains = new StringBuilder();
        CompareItemController   controller          = new CompareItemController();
        List <ItemsCompareInfo> compareItemInfo     =
            controller.GetItemCompareList(aspxCommonObj);

        if (compareItemInfo != null && compareItemInfo.Count > 0)
        {
            string costVariantIds = string.Empty;
            foreach (ItemsCompareInfo item in compareItemInfo)
            {
                if (compareItemInfo.IndexOf(item) < MaxCompareItemCount)
                {
                    string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                    if (item.ImagePath == "")
                    {
                        imagePath = DefaultImagePath;
                    }
                    else
                    {
                        //Resize Image Dynamically
                        InterceptImageController.ImageBuilder(item.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                    }

                    compareItemContains.Append("<div class=\"productBox compareProduct\" id=\"compareProductBox-");
                    compareItemContains.Append(item.CompareItemID);
                    compareItemContains.Append("\" data=");
                    compareItemContains.Append(item.ItemID);
                    compareItemContains.Append(" costVariant=");
                    compareItemContains.Append(item.CostVariantValueID);
                    compareItemContains.Append(">");
                    compareItemContains.Append("<div id=\"compareCompareClose-");
                    compareItemContains.Append(item.ItemID);
                    compareItemContains.Append("\" onclick=\"ItemsCompareAPI.RemoveFromAddToCompareBox(" + item.ItemID +
                                               ',' + item.CompareItemID +
                                               ");\" class=\"compareProductClose\"><i class='i-close'>cancel</i></div>");
                    compareItemContains.Append("<div class=\"productImage\"><img src=");
                    compareItemContains.Append(aspxRootPath + imagePath.Replace("uploads", "uploads/Small"));
                    compareItemContains.Append("></div>");
                    compareItemContains.Append("<div class=\"productName\">");
                    compareItemContains.Append(item.ItemName);
                    if (item.ItemCostVariantValue != "")
                    {
                        compareItemContains.Append("<br/>");
                        compareItemContains.Append(item.ItemCostVariantValue);
                    }
                    compareItemContains.Append("</div></div>");
                    costVariantIds += item.CostVariantValueID + "#";
                    compareLen++;
                }
            }
        }
        if ((MaxCompareItemCount - compareItemInfo.Count) > 0)
        {
            for (int i = 0; i < (MaxCompareItemCount - compareItemInfo.Count); i++)
            {
                compareItemContains.Append("<div class=\"empty productBox\"></div>");
            }
        }
        string errorText = "<div id=\"compareErrorText\">" + getLocale("Sorry, You can not add more than") + "&nbsp;" +
                           MaxCompareItemCount + "&nbsp;" + getLocale("items") + ".</div>";

        ltrCompareItem.Text = compareItemContains.ToString();
        ltrError.Text       = errorText;
    }
Esempio n. 25
0
    private void BindBrandRss(List <BrandRssInfo> brandRssContent, AspxCommonInfo aspxCommonObj)
    {
        string x         = HttpContext.Current.Request.ApplicationPath;
        string authority = HttpContext.Current.Request.Url.Authority;
        string pageUrl   = authority + x;
        string pageURL   = Request.Url.AbsoluteUri;

        string[] path     = pageURL.Split('?');
        string   pagepath = path[0];

        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.ContentType = "text/xml";
        XmlTextWriter rssXml = new XmlTextWriter(HttpContext.Current.Response.OutputStream, Encoding.UTF8);

        rssXml.WriteStartDocument();
        rssXml.WriteStartElement("rss");
        rssXml.WriteAttributeString("version", "2.0");
        rssXml.WriteStartElement("channel");
        rssXml.WriteElementString("link", pagepath);
        switch (rssOption)
        {
        case "brands":
            rssXml.WriteElementString("title", getLocale("AspxCommerce Popular Brands"));
            break;

        case "fbrands":
            rssXml.WriteElementString("title", getLocale("AspxCommerce Featured Brands"));
            break;

        case "abrands":
            rssXml.WriteElementString("title", getLocale("AspxCommerce All Brands"));
            break;

        default:
            break;
        }
        if (brandRssContent.Count > 0)
        {
            foreach (BrandRssInfo rssFeedBrand in brandRssContent)
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", rssFeedBrand.BrandName);
                rssXml.WriteElementString("link",
                                          "http://" + pageUrl + "/brand/" + AspxUtility.fixedEncodeURIComponent(rssFeedBrand.BrandName) + SageFrameSettingKeys.PageExtension);
                rssXml.WriteStartElement("description");
                string description = "";
                description += "<div>";
                string [] brandURL   = rssFeedBrand.BrandImageUrl.Split('/');
                string    brandImage = brandURL[brandURL.Length - 1];
                if (brandImage != "")
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(brandImage, ImageType.Small, ImageCategoryType.Brand, aspxCommonObj);
                }
                description += "<div><a href=http://" + pageUrl + "/brand/" + rssFeedBrand.BrandName + SageFrameSettingKeys.PageExtension + ">";
                description += "<img src=http://" + pageUrl + "/" + rssFeedBrand.BrandImageUrl.Replace("uploads", "uploads/Small") + "  />";
                description += "</a></div>";
                description += "<p>" + HttpUtility.HtmlDecode(rssFeedBrand.BrandDescription) + "</p>";

                description += "</div>";
                rssXml.WriteCData(description);
                rssXml.WriteEndElement();
                rssXml.WriteElementString("pubDate", rssFeedBrand.AddedOn);
                rssXml.WriteEndElement();
            }
        }
        else
        {
            rssXml.WriteStartElement("item");
            rssXml.WriteElementString("title", "");
            rssXml.WriteElementString("link", "");
            rssXml.WriteStartElement("description");
            var description = "";
            description = "<div><h2><span>" + getLocale("This store has no items listed yet!") + "</span></h2></div>";
            rssXml.WriteCData(description);
            rssXml.WriteEndElement();
            rssXml.WriteEndElement();
        }
        rssXml.WriteEndElement();
        rssXml.WriteEndElement();
        rssXml.WriteEndDocument();
        rssXml.Flush();
        rssXml.Close();
        HttpContext.Current.Response.End();
    }
Esempio n. 26
0
    public void BindWishListItem()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        string modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(modulePath);
        string pageExtension = SageFrameSettingKeys.PageExtension;

        var count = 10;
        var isAll = "1";
        int limit = 5;        int offset = 1;
        int sortBy = 1;        WishItemController controller = new WishItemController();
        List <WishItemsInfo> lstWishList = controller.GetWishItemList(offset, limit, aspxCommonObj, isAll, count, sortBy);
        StringBuilder        wishListStringBld = new StringBuilder();

        if (lstWishList != null && lstWishList.Count > 0)
        {
            SortByList();
            wishListStringBld.Append("<thead>");
            wishListStringBld.Append("<tr class=\"cssClassCommonCenterBoxTableHeading\">");
            wishListStringBld.Append(
                "<th class=\"cssClassWishItemChkbox\"> <input type=\"checkbox\" id=\"chkHeading\"/></th>");
            if (ShowImageInWishlist)
            {
                wishListStringBld.Append(
                    "<th class=\"cssClassWishItemImg\"> <label class=\"sfLocale\">Image</label></th>");
            }
            wishListStringBld.Append(
                "<th class=\"cssClassWishItemDetails\"><label id=\"lblItem\" class=\"sfLocale\">Item Details and Comment</label></th>");
            wishListStringBld.Append(
                "<th class=\"row-variants\"><label id=\"lblVariant\" class=\"sfLocale\">Variants</label></th>");
            if (AllowAddToCart.ToLower() == "true")
            {
                wishListStringBld.Append(
                    "<th class=\"cssClassAddToCart\"><span id=\"lblAddToCart\" class=\"sfLocale\">Add To Cart</span></th>");
            }
            wishListStringBld.Append("<th class=\"cssClassDelete\"></th>");
            wishListStringBld.Append("</tr></thead>");
            wishListStringBld.Append("<tbody>");
            ArrayLength = lstWishList.Count;
            foreach (var response in lstWishList)
            {
                RowTotal = response.RowTotal;
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + response.ImagePath;
                if (response.ImagePath == "")
                {
                    imagePath = NoImageWishList;
                }
                else if (response.AlternateText == "")
                {
                    response.AlternateText = response.ItemName;
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(response.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                }
                else
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(response.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                }
                JavaScriptSerializer ser = new JavaScriptSerializer();
                string WishDate = (Convert.ToDateTime(response.WishDate)).ToShortDateString();
                var    itemSKU = ser.Serialize(response.SKU);                var cosVaraint = ser.Serialize(response.CostVariantValueIDs);
                var    href = "";
                var    cartUrl = "";
                if (response.CostVariantValueIDs == "")
                {
                    cartUrl = "#";
                    href    = aspxRedirectPath + "item/" + response.SKU + pageExtension;
                }
                else
                {
                    cartUrl = aspxRedirectPath + "item/" + response.SKU + pageExtension + "?varId=" +
                              response.CostVariantValueIDs + "";
                    href = aspxRedirectPath + "item/" + response.SKU + pageExtension + "?varId=" +
                           response.CostVariantValueIDs + "";
                }
                StringBuilder dataContent = new StringBuilder();
                dataContent.Append("data-class=\"addtoCart\" data-type=\"button\" data-addtocart=\"");
                dataContent.Append("addtocart");
                dataContent.Append(response.ItemID);
                dataContent.Append("\" data-title=\"");
                dataContent.Append(response.ItemName);
                dataContent.Append("\" data-onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                dataContent.Append(response.ItemID);
                dataContent.Append(",");
                dataContent.Append(response.Price);
                dataContent.Append(",'");
                dataContent.Append(response.SKU);
                dataContent.Append("',");
                dataContent.Append(1);
                dataContent.Append(",'");
                dataContent.Append(response.IsCostVariantItem);
                dataContent.Append("',this);\"");
                if (lstWishList.IndexOf(response) % 2 == 0)
                {
                    wishListStringBld.Append("<tr class=\"sfEven\" id=\"tr_" + response.ItemID + "\">");
                    wishListStringBld.Append("<td class=\"cssClassWishItemChkbox\">");
                    wishListStringBld.Append("<input type=\"checkbox\" id=\"" + response.WishItemID +
                                             "\" class=\"cssClassWishItem\"/></td>");
                    if (ShowImageInWishlist)
                    {
                        wishListStringBld.Append("<td class=\"cssClassWishItemImg\">");
                        wishListStringBld.Append("<div class=\"cssClassImage\">");
                        wishListStringBld.Append("<img src=\"" + aspxRootPath +
                                                 imagePath.Replace("uploads", "uploads/Small") +
                                                 "\" alt=\"" + response.AlternateText + "\" title=\"" +
                                                 response.AlternateText + "\"/>");
                        wishListStringBld.Append("</div></td>");
                    }
                    wishListStringBld.Append("<td class=\"cssClassWishItemDetails\">");

                    wishListStringBld.Append("<a href=\"" + href + "\">" + response.ItemName + "</a>");
                    wishListStringBld.Append("<div class=\"cssClassWishDate\"><i class='i-calender'></i>" + WishDate + "</div>");
                    wishListStringBld.Append("<div class=\"cssClassWishComment\">");
                    wishListStringBld.Append("<textarea maxlength=\"600\" onkeyup=\"" +
                                             "WishItem.ismaxlength(this)" + "\" id=\"comment_" +
                                             response.WishItemID + "\" class=\"comment\">" + response.Comment +
                                             "</textarea></div></td>");
                    wishListStringBld.Append(
                        "<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=" + cosVaraint + "/>");
                    wishListStringBld.Append("<span>" + response.ItemCostVariantValue + "</span></td>");
                    if (AllowAddToCart.ToLower() == "true")
                    {
                        if (AllowOutStockPurchase.ToLower() == "false")
                        {
                            if (response.IsOutOfStock != null && (bool)response.IsOutOfStock)
                            {
                                wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                                if (response.ItemTypeID == 5)
                                {
                                    wishListStringBld.Append("<p class=\"cssClassGroupPriceWrapper\">" + getLocale("Starting At "));
                                    wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                             decimal.Parse(response.Price).ToString("N2") + "</span></p>");
                                }
                                else
                                {
                                    wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                             decimal.Parse(response.Price).ToString("N2") + "</span>");
                                }
                                wishListStringBld.Append("<div data-ItemTypeID=\"" + response.ItemTypeID + "\" data-ItemID=\"" + response.ItemID + "\"" + dataContent + " class=\"sfButtonwrapper cssClassOutOfStock\">");
                                wishListStringBld.Append("<span class=\"cssClassOutStock\">" + getLocale("Out Of Stock") +
                                                         "</span></div></td>");
                            }
                            else
                            {
                                wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                                if (response.ItemTypeID == 5)
                                {
                                    wishListStringBld.Append("<p class=\"cssClassGroupPriceWrapper\">" + getLocale("Starting At "));
                                    wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                             decimal.Parse(response.Price).ToString("N2") + "</span></p>");
                                }
                                else
                                {
                                    wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                             decimal.Parse(response.Price).ToString("N2") + "</span>");
                                }

                                wishListStringBld.Append("<div data-ItemTypeID=\"" + response.ItemTypeID + "\"data-ItemID=\"" + response.ItemID + "\"" + dataContent + " class=\"sfButtonwrapper\">");
                                wishListStringBld.Append("<label class=\"i-cart cssClassCartLabel cssClassGreenBtn\"><button type=\"button\" class=\"addtoCart\"");
                                wishListStringBld.Append("addtocart=\"");
                                wishListStringBld.Append("addtocart");
                                wishListStringBld.Append(response.ItemID);
                                wishListStringBld.Append("\" title=\"");
                                wishListStringBld.Append(response.ItemName);

                                wishListStringBld.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                                wishListStringBld.Append(response.ItemID + ",");
                                wishListStringBld.Append(response.Price + ",");
                                wishListStringBld.Append("'" + response.SKU + "'" + "," + 1);
                                wishListStringBld.Append(",'");
                                wishListStringBld.Append(response.IsCostVariantItem);
                                wishListStringBld.Append("',this);\"><span>");
                                wishListStringBld.Append(getLocale("Cart +"));
                                wishListStringBld.Append("</span></button></label></div></td>");
                            }
                        }
                        else
                        {
                            wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                            if (response.ItemTypeID == 5)
                            {
                                wishListStringBld.Append("<p class=\"cssClassGroupPriceWrapper\">" + getLocale("Starting At "));
                                wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                         decimal.Parse(response.Price).ToString("N2") + "</span></p>");
                            }
                            else
                            {
                                wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                         decimal.Parse(response.Price).ToString("N2") + "</span>");
                            }
                            wishListStringBld.Append("<div data-ItemTypeID=\"" + response.ItemTypeID + "\" data-ItemID=\"" + response.ItemID + "\"" + dataContent + " class=\"sfButtonwrapper\">");
                            wishListStringBld.Append("<label class=\"i-cart cssClassCartLabel cssClassGreenBtn\"><button type=\"button\" class=\"addtoCart\"");
                            wishListStringBld.Append("addtocart=\"");
                            wishListStringBld.Append("addtocart");
                            wishListStringBld.Append(response.ItemID);
                            wishListStringBld.Append("\" title=\"");
                            wishListStringBld.Append(response.ItemName);

                            wishListStringBld.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            wishListStringBld.Append(response.ItemID + ",");
                            wishListStringBld.Append(response.Price + ",");
                            wishListStringBld.Append("'" + response.SKU + "'" + "," + 1);
                            wishListStringBld.Append(",'");
                            wishListStringBld.Append(response.IsCostVariantItem);
                            wishListStringBld.Append("',this);\"><span>");
                            wishListStringBld.Append(getLocale("Cart +"));
                            wishListStringBld.Append("</span></button></label></div></td>");
                        }
                    }
                    wishListStringBld.Append("<td class=\"cssClassDelete\">");
                    wishListStringBld.Append("<a onclick=\"WishItem.Delete(" + response.WishItemID +
                                             ")\"><i class='i-delete'></i></a>");
                    wishListStringBld.Append("</td></tr>");
                }

                else
                {
                    wishListStringBld.Append("<tr class=\"sfOdd\" id=\"tr_" + response.ItemID + "\">");
                    wishListStringBld.Append("<td class=\"cssClassWishItemChkbox\">");
                    wishListStringBld.Append("<input type=\"checkbox\" id=\"" + response.WishItemID +
                                             "\" class=\"cssClassWishItem\"/></td>");
                    if (ShowImageInWishlist)
                    {
                        wishListStringBld.Append("<td class=\"cssClassWishItemImg\">");
                        wishListStringBld.Append("<div class=\"cssClassImage\">");
                        wishListStringBld.Append("<img src=\"" + aspxRootPath +
                                                 imagePath.Replace("uploads", "uploads/Small") +
                                                 "\" alt=\"" + response.AlternateText + "\" title=\"" +
                                                 response.AlternateText + "\"/>");
                        wishListStringBld.Append("</div></td>");
                    }
                    wishListStringBld.Append("<td class=\"cssClassWishItemDetails\">");
                    wishListStringBld.Append("<a href=\"" + href + "\">" + response.ItemName + "</a>");
                    wishListStringBld.Append("<div class=\"cssClassWishDate\"><i class='i-calender'></i>" + WishDate + "</div>");
                    wishListStringBld.Append("<div class=\"cssClassWishComment\">");
                    wishListStringBld.Append("<textarea maxlength=\"600\" onkeyup=\"" +
                                             "WishItem.ismaxlength(this)" + "\" id=\"comment_" +
                                             response.WishItemID + "\" class=\"comment\">" + response.Comment +
                                             "</textarea></div></td>");
                    wishListStringBld.Append(
                        "<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=" + cosVaraint + "/>");
                    wishListStringBld.Append("<span>" + response.ItemCostVariantValue + "</span></td>");
                    if (AllowAddToCart.ToLower() == "true")
                    {
                        if (AllowOutStockPurchase.ToLower() == "false")
                        {
                            if (response.IsOutOfStock != null && (bool)response.IsOutOfStock)
                            {
                                wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                                if (response.ItemTypeID == 5)
                                {
                                    wishListStringBld.Append("<p class=\"cssClassGroupPriceWrapper\">" + getLocale("Starting At "));
                                    wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                             decimal.Parse(response.Price).ToString("N2") + "</span></p>");
                                }
                                else
                                {
                                    wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                             decimal.Parse(response.Price).ToString("N2") + "</span>");
                                }
                                wishListStringBld.Append("<div data-ItemTypeID=\"" + response.ItemTypeID + "\" data-ItemID=\"" + response.ItemID + "\"" + dataContent + " class=\"sfButtonwrapper cssClassOutOfStock\">");
                                wishListStringBld.Append("<span class=\"cssClassOutStock\">" + getLocale("Out Of Stock") +
                                                         "</span></div></td>");
                            }
                            else
                            {
                                wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                                if (response.ItemTypeID == 5)
                                {
                                    wishListStringBld.Append("<p class=\"cssClassGroupPriceWrapper\">" + getLocale("Starting At "));
                                    wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                             decimal.Parse(response.Price).ToString("N2") + "</span></p>");
                                }
                                else
                                {
                                    wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                             decimal.Parse(response.Price).ToString("N2") + "</span>");
                                }
                                wishListStringBld.Append("<div data-ItemTypeID=\"" + response.ItemTypeID + "\" data-ItemID=\"" + response.ItemID + "\"" + dataContent + " class=\"sfButtonwrapper\">");
                                wishListStringBld.Append("<label class=\"i-cart cssClassCartLabel cssClassGreenBtn\"><button type=\"button\" class=\"addtoCart\"");
                                wishListStringBld.Append("addtocart=\"");
                                wishListStringBld.Append("addtocart");
                                wishListStringBld.Append(response.ItemID);
                                wishListStringBld.Append("\" title=\"");
                                wishListStringBld.Append(response.ItemName);

                                wishListStringBld.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                                wishListStringBld.Append(response.ItemID + ",");
                                wishListStringBld.Append(response.Price + ",");
                                wishListStringBld.Append("'" + response.SKU + "'" + "," + 1);
                                wishListStringBld.Append(",'");
                                wishListStringBld.Append(response.IsCostVariantItem);
                                wishListStringBld.Append("',this);\"><span>");
                                wishListStringBld.Append(getLocale("Cart +"));
                                wishListStringBld.Append("</span></button></label></div></td>");
                            }
                        }
                        else
                        {
                            wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                            if (response.ItemTypeID == 5)
                            {
                                wishListStringBld.Append("<p class=\"cssClassGroupPriceWrapper\">" + getLocale("Starting At "));
                                wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                         decimal.Parse(response.Price).ToString("N2") + "</span></p>");
                            }
                            else
                            {
                                wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                         decimal.Parse(response.Price).ToString("N2") + "</span>");
                            }
                            wishListStringBld.Append("<div data-ItemTypeID=\"" + response.ItemTypeID + "\" data-ItemID=\"" + response.ItemID + "\"" + dataContent + " class=\"sfButtonwrapper\">");
                            wishListStringBld.Append("<label class=\"i-cart cssClassCartLabel cssClassGreenBtn\"><button type=\"button\" class=\"addtoCart\"");
                            wishListStringBld.Append("addtocart=\"");
                            wishListStringBld.Append("addtocart");
                            wishListStringBld.Append(response.ItemID);
                            wishListStringBld.Append("\" title=\"");
                            wishListStringBld.Append(response.ItemName);

                            wishListStringBld.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            wishListStringBld.Append(response.ItemID + ",");
                            wishListStringBld.Append(response.Price + ",");
                            wishListStringBld.Append("'" + response.SKU + "'" + "," + 1);
                            wishListStringBld.Append(",'");
                            wishListStringBld.Append(response.IsCostVariantItem);
                            wishListStringBld.Append("',this);\"><span>");
                            wishListStringBld.Append(getLocale("Cart +"));
                            wishListStringBld.Append("</span></button></label></div></td>");
                        }
                    }
                    wishListStringBld.Append("<td class=\"cssClassDelete\">");
                    wishListStringBld.Append("<a onclick=\"WishItem.Delete(" + response.WishItemID +
                                             ")\"><i class='i-delete'></i></a>");
                    wishListStringBld.Append("</td></tr>");
                }
            }

            wishListStringBld.Append("</tbody>");
            wishListStringBld.Append(GetStringScript("$('.cssClassImage img[title]').tipsy({ gravity: 'n' });"));
            StringBuilder wishLstButtonBdl = new StringBuilder();
            wishLstButtonBdl.Append("<label class='i-wishlist cssClassGreenBtn'><button type=\"button\" id=\"shareWishList\">");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Share Wishlist</span></button></label>");
            wishLstButtonBdl.Append(
                "<label class='i-update cssClassDarkBtn'><button type=\"button\" id=\"updateWishList\" onclick=\"WishItem.Update();\">");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Update Selected</span></button></label>");
            wishLstButtonBdl.Append(
                "<label class='i-clear cssClassGreyBtn'><button type=\"button\" id=\"clearWishList\" onclick=\"WishItem.Clear();\">");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Clear WishList</span></button></label>");
            wishLstButtonBdl.Append("<label class='i-delete cssClassGreenBtn'><button type=\"button\" id=\"btnDeletedMultiple\">");
            wishLstButtonBdl.Append("");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Delete Selected</span></button></label>");
            wishLstButtonBdl.Append("<label class='i-arrow-right cssClassDarkBtn'><button type=\"button\" id=\"continueInStore\">");
            wishLstButtonBdl.Append("<span class=\"sfLocale\">Continue Shopping</span></button ></label>");

            StringBuilder wishListPaginationBdl = new StringBuilder();
            wishListPaginationBdl.Append("<span class=\"sfLocale\">View Per Page: </span><select id=\"ddlWishListPageSize\" class=\"sfListmenu\"><option value=\"\"></option></select>");

            ltrWishListButon.Text      = wishLstButtonBdl.ToString();
            ltrWishListPagination.Text = wishListPaginationBdl.ToString();
        }
        else
        {
            wishListStringBld.Append("<tr><td class=\"cssClassNotFound\">" + getLocale("Your wishlist is empty!") + "</td></tr>");
        }
        ltrWishList.Text = wishListStringBld.ToString();
    }
Esempio n. 27
0
    private void BindSpecialItems(AspxCommonInfo aspxCommonObj)
    {
        string modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxRootPath           = ResolveUrl("~/");
        string aspxTemplateFolderPath = aspxRootPath + "Templates/" + TemplateName;

        hst = AppLocalized.getLocale(modulePath);
        string pageExtension = SageFrameSettingKeys.PageExtension;
        int    NoOfItemInRow = 2;

        DataSet dsSpecialItems = SpecialItemsController.GetSpecialItemsandSettingDataSet(aspxCommonObj);

        if (dsSpecialItems != null && dsSpecialItems.Tables.Count == 2)
        {
            #region Special Items Setting
            DataTable dtSpecialItemsSetting = dsSpecialItems.Tables[0];
            if (dtSpecialItemsSetting != null & dtSpecialItemsSetting.Rows.Count > 0)
            {
                NoOfItemInRow     = Convert.ToInt32(dtSpecialItemsSetting.Rows[0]["NoOfItemInRow"].ToString());
                SpecialItemRss    = dtSpecialItemsSetting.Rows[0]["IsEnableSpecialItemsRss"].ToString();
                SpecialDetailPage = dtSpecialItemsSetting.Rows[0]["SpecialItemsDetailPageName"].ToString();
                RssFeedUrl        = dtSpecialItemsSetting.Rows[0]["SpecialItemsRssPageName"].ToString();
            }
            #endregion

            #region Special Items Html Helper
            DataTable     dtSpecialItems    = dsSpecialItems.Tables[1];
            int           nosOfSpecialItems = dtSpecialItems.Rows.Count;
            StringBuilder specialContent    = new StringBuilder();

            if (dtSpecialItems != null && nosOfSpecialItems > 0)
            {
                specialContent.Append("<div class=\"cssClassSpecialBoxInfo\" id=\"divSpItem\">");
                int i = 0;
                foreach (DataRow drSpecialItem in dtSpecialItems.Rows)
                {
                    i++;
                    string imagePath    = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + drSpecialItem["ImagePath"];
                    string altImagePath = "";
                    if (string.IsNullOrEmpty(drSpecialItem["ImagePath"].ToString()))
                    {
                        imagePath = DefaultImagePath;
                    }
                    else
                    {
                        //Resize Image Dynamically
                        InterceptImageController.ImageBuilder(drSpecialItem["ImagePath"].ToString(), ImageType.Medium, ImageCategoryType.Item, aspxCommonObj);
                    }
                    if (string.IsNullOrEmpty(drSpecialItem["ImagePath"].ToString()))
                    {
                        altImagePath = imagePath;
                    }
                    string itemPrice      = Convert.ToDecimal(drSpecialItem["Price"].ToString()).ToString("N2");
                    string itemPriceValue = drSpecialItem["Price"].ToString();
                    string itemPriceRate  = Convert.ToDecimal(drSpecialItem["Price"].ToString()).ToString("N2");

                    if (i % NoOfItemInRow == 0)
                    {
                        specialContent.Append("<div class=\"cssClassProductsBox cssClassNoMargin\">");
                    }
                    else
                    {
                        specialContent.Append("<div class=\"cssClassProductsBox\">");
                    }
                    var hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(drSpecialItem["SKU"].ToString()) + pageExtension;
                    specialContent.Append("<div id=\"productImageWrapID_");
                    specialContent.Append(drSpecialItem["ItemID"]);
                    specialContent.Append("\" class=\"cssClassProductsBoxInfo\" costvariantItem=");
                    specialContent.Append(drSpecialItem["CostVariants"]);
                    specialContent.Append("  itemid=\"");
                    specialContent.Append(drSpecialItem["ItemID"]);
                    specialContent.Append("\">");
                    specialContent.Append("<h3>");
                    specialContent.Append(drSpecialItem["SKU"]);
                    specialContent.Append("</h3><div class=\"divQuickLookonHover\"><div class=\"divitemImage cssClassProductPicture\"><a href=\"");
                    specialContent.Append(hrefItem);
                    specialContent.Append("\" ><img id=\"img_");
                    specialContent.Append(drSpecialItem["ItemID"]);
                    specialContent.Append("\"  alt=\"");
                    specialContent.Append(drSpecialItem["Name"]);
                    specialContent.Append("\"  title=\"");
                    specialContent.Append(drSpecialItem["Name"]);
                    specialContent.Append("\"");
                    specialContent.Append("src=\"");
                    specialContent.Append(aspxRootPath);
                    specialContent.Append(imagePath.Replace("uploads", "uploads/Medium"));
                    specialContent.Append("\" orignalPath=\"");
                    specialContent.Append(imagePath.Replace("uploads", "uploads/Medium"));
                    specialContent.Append("\" altImagePath=\"");
                    specialContent.Append(altImagePath.Replace("uploads", "uploads/Medium"));
                    specialContent.Append("\"/></a></div>");
                    specialContent.Append("<div class='cssLatestItemInfo clearfix'>");
                    specialContent.Append("<h2><a href=\"");
                    specialContent.Append(hrefItem);
                    specialContent.Append("\" title=\"");
                    specialContent.Append(drSpecialItem["Name"]);
                    specialContent.Append("\">");

                    string name = string.Empty;
                    if (drSpecialItem["Name"].ToString().Length > 50)
                    {
                        name = drSpecialItem["Name"].ToString().Substring(0, 50);
                        int index = 0;
                        index = name.LastIndexOf(' ');
                        name  = name.Substring(0, index);
                        name  = name + "...";
                    }
                    else
                    {
                        name = drSpecialItem["Name"].ToString();
                    }
                    specialContent.Append(name);
                    specialContent.Append("</a></h2>");
                    StringBuilder dataContent = new StringBuilder();
                    dataContent.Append("data-class=\"addtoCart\" data-ItemTypeID=\"");
                    dataContent.Append(drSpecialItem["ItemTypeID"]);
                    dataContent.Append("\" data-type=\"button\" data-ItemID=\"");
                    dataContent.Append(drSpecialItem["ItemID"]);
                    dataContent.Append("\" data-addtocart=\"");
                    dataContent.Append("addtocart");
                    dataContent.Append(drSpecialItem["ItemID"]);
                    dataContent.Append("\" data-title=\"");
                    dataContent.Append(name);
                    dataContent.Append("\" data-onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                    dataContent.Append(drSpecialItem["ItemID"]);
                    dataContent.Append(",");
                    dataContent.Append(itemPriceValue);
                    dataContent.Append(",'");
                    dataContent.Append(drSpecialItem["SKU"]);
                    dataContent.Append("',");
                    dataContent.Append(1);
                    dataContent.Append(",'");
                    dataContent.Append(drSpecialItem["CostVariants"]);
                    dataContent.Append("',this);\"");

                    specialContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");

                    if (!string.IsNullOrEmpty(drSpecialItem["ListPrice"].ToString()))
                    {//Added for group type products
                        if ((int)drSpecialItem["ItemTypeID"] == 5)
                        {
                            specialContent.Append("<p class=\"cssClassProductRealPrice \">");
                            specialContent.Append(getLocale("Starting At"));
                        }
                        else
                        {
                            string strAmount = Math.Round((decimal)(drSpecialItem["ListPrice"]), 2).ToString("N2");
                            specialContent.Append("<p class=\"cssClassProductOffPrice\">");
                            specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                            specialContent.Append(strAmount);
                            specialContent.Append("</span></p><p class=\"cssClassProductRealPrice \">");
                        }
                    }
                    else
                    {
                        if ((int)drSpecialItem["ItemTypeID"] == 5)
                        {
                            specialContent.Append("<p class=\"cssClassProductRealPrice \" >");
                            specialContent.Append(getLocale("Starting At"));
                        }
                        else
                        {
                            specialContent.Append("<p class=\"cssClassProductRealPrice \" >");
                        }
                    }

                    specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                    specialContent.Append(itemPriceRate);
                    specialContent.Append("</span></p></div></div>");

                    specialContent.Append("<div class=\"cssClassProductDetail\"><p><a href=\"");
                    specialContent.Append(aspxRedirectPath);
                    specialContent.Append("item/");
                    specialContent.Append(drSpecialItem["SKU"]);
                    specialContent.Append(pageExtension);
                    specialContent.Append("\">");
                    specialContent.Append(getLocale("Details"));
                    specialContent.Append("</a></p></div>");

                    specialContent.Append("<div class=\"sfQuickLook\" style=\"display:none\">");
                    specialContent.Append("<img itemId=\"");
                    specialContent.Append(drSpecialItem["ItemID"]);
                    specialContent.Append("\" sku=\"");
                    specialContent.Append(drSpecialItem["SKU"]);
                    specialContent.Append("\" src=\"");
                    specialContent.Append(aspxTemplateFolderPath);
                    specialContent.Append("/images/QV_Button.png\" alt=\"\" rel=\"popuprel\" />");
                    specialContent.Append("</div>");
                    if (!string.IsNullOrEmpty(drSpecialItem["AttributeValues"].ToString()))
                    {
                        specialContent.Append("<div class=\"cssGridDyanamicAttr\">");
                        if (!string.IsNullOrEmpty(drSpecialItem["AttributeValues"].ToString()))
                        {
                            string[] attributeValues = drSpecialItem["AttributeValues"].ToString().Split(',');
                            foreach (string element in attributeValues)
                            {
                                string[] attributes     = element.Split('#');
                                string   attributeName  = attributes[0];
                                string   attributeValue = attributes[1];
                                int      inputType      = Int32.Parse(attributes[2]);
                                string   validationType = attributes[3];
                                specialContent.Append("<div class=\"cssDynamicAttributes\">");
                                specialContent.Append("<div class=\"cssDynamicAttributes\">");
                                specialContent.Append("<span>");
                                specialContent.Append(attributeName);
                                specialContent.Append("</span> :");
                                if (inputType == 7)
                                {
                                    specialContent.Append("<span class=\"cssClassFormatCurrency\">");
                                }
                                else
                                {
                                    specialContent.Append("<span>");
                                }
                                specialContent.Append(attributeValue);
                                specialContent.Append("</span></div>");
                            }
                        }
                        specialContent.Append("</div>");
                    }
                    string itemSKU  = drSpecialItem["SKU"].ToString();
                    string itemName = drSpecialItem["Name"].ToString();

                    specialContent.Append("<div class=\"cssClassTMar20\">");
                    if (AllowAddToCart.ToLower() == "true")
                    {
                        if (AllowOutStockPurchase.ToLower() == "false")
                        {
                            if ((bool)drSpecialItem["IsOutOfStock"])
                            {
                                specialContent.Append("<div class=\"cssClassAddtoCard\"><div ");
                                specialContent.Append(dataContent);
                                specialContent.Append(" class=\"sfButtonwrapper cssClassOutOfStock\">");
                                specialContent.Append("<button type=\"button\"><span>");
                                specialContent.Append(getLocale("Out Of Stock"));
                                specialContent.Append("</span></button></div></div>");
                            }
                            else
                            {
                                specialContent.Append("<div class=\"cssClassAddtoCard\"><div ");
                                specialContent.Append(dataContent);
                                specialContent.Append(" class=\"sfButtonwrapper\">");
                                specialContent.Append("<label class='i-cart cssClassCartLabel cssClassGreenBtn'><button type=\"button\" class=\"addtoCart\"");
                                specialContent.Append("data-addtocart=\"");
                                specialContent.Append("addtocart");
                                specialContent.Append(drSpecialItem["ItemID"]);
                                specialContent.Append("\" title=\"");
                                specialContent.Append(itemName);
                                specialContent.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                                specialContent.Append(drSpecialItem["ItemID"]);
                                specialContent.Append(",");
                                specialContent.Append(itemPriceValue);
                                specialContent.Append(",'");
                                specialContent.Append(itemSKU);
                                specialContent.Append("',");
                                specialContent.Append(1);
                                specialContent.Append(",'");
                                specialContent.Append(drSpecialItem["CostVariants"]);
                                specialContent.Append("',this);\">");
                                specialContent.Append(getLocale("Cart +"));
                                specialContent.Append("</button></label></div></div>");
                            }
                        }
                        else
                        {
                            specialContent.Append("<div class=\"cssClassAddtoCard\"><div ");
                            specialContent.Append(dataContent);
                            specialContent.Append(" class=\"sfButtonwrapper\">");
                            specialContent.Append("<label class='i-cart cssClassCartLabel cssClassGreenBtn'><button type=\"button\" class=\"addtoCart\"");
                            specialContent.Append("data-addtocart=\"");
                            specialContent.Append("addtocart");
                            specialContent.Append(drSpecialItem["ItemID"]);
                            specialContent.Append("\" title=\"");
                            specialContent.Append(itemName);
                            specialContent.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            specialContent.Append(drSpecialItem["ItemID"]);
                            specialContent.Append(",");
                            specialContent.Append(itemPriceValue);
                            specialContent.Append(",'");
                            specialContent.Append(itemSKU);
                            specialContent.Append("',");
                            specialContent.Append(1);
                            specialContent.Append(",'");
                            specialContent.Append(drSpecialItem["CostVariants"]);
                            specialContent.Append("',this);\">");
                            specialContent.Append(getLocale("Cart +"));
                            specialContent.Append("</button></label></div></div>");
                        }
                    }
                    if (GetCustomerID > 0 && GetUsername.ToLower() != "anonymoususer")
                    {
                        specialContent.Append("<div class=\"cssClassWishListButton\">");
                        specialContent.Append("<label class='i-wishlist cssWishListLabel cssClassDarkBtn'><button type=\"button\" id=\"addWishList\" onclick=AspxCommerce.RootFunction.CheckWishListUniqueness(");
                        specialContent.Append(drSpecialItem["ItemID"]);
                        specialContent.Append(",'");
                        specialContent.Append(drSpecialItem["SKU"]);
                        specialContent.Append("',this);><span>");
                        specialContent.Append(getLocale("Wishlist+"));
                        specialContent.Append("</span></button></label></div>");
                    }
                    else
                    {
                        specialContent.Append("<div class=\"cssClassWishListButton\">");
                        specialContent.Append("<label class='i-wishlist cssWishListLabel cssClassDarkBtn'><button type=\"button\" id=\"addWishList\" onclick=\"AspxCommerce.RootFunction.Login();\">");
                        specialContent.Append("<span>");
                        specialContent.Append(getLocale("Wishlist+"));
                        specialContent.Append("</span></button></label></div>");
                    }
                    specialContent.Append("<div class=\"cssClassWishListButton\">");
                    specialContent.Append("<input type=\"hidden\" name='itemwish' value=");
                    specialContent.Append(drSpecialItem["ItemID"]);
                    specialContent.Append(",'");
                    specialContent.Append(drSpecialItem["SKU"]);
                    specialContent.Append("',this  />");
                    specialContent.Append("</div>");
                    specialContent.Append("</div></div>");
                    specialContent.Append("</div></div>");
                    specialContent.Append("</div>");
                }

                specialContent.Append("</div>");
                if (nosOfSpecialItems > NoOfItemInRow)
                {
                    string strHtml = "<a href=\"" + aspxRedirectPath + SpecialDetailPage + pageExtension + "?id=special\">" + getLocale("View More") + "</a>";
                    divViewMoreSpecial.InnerHtml = strHtml;
                }
                ltrSpecialItems.Text = specialContent.ToString();
            }
            else
            {
                StringBuilder noSpl = new StringBuilder();
                noSpl.Append("<span class=\"cssClassNotFound\">");
                noSpl.Append(getLocale("No special item found in this store!"));
                noSpl.Append("</span>");
                divSpclBox.InnerHtml = noSpl.ToString();
                divSpclBox.Attributes.Add("class", "");
            }
            #endregion
        }
    }
Esempio n. 28
0
    private void SaveBannerContent(int BannerId, int ImageId)
    {
        try
        {
            string fName = fuFileUpload.FileName;
            if (SageFrame.Web.PictureManager.ValidImageExtension(fName))
            {
                //bool isEdit = false;
                SageBannerInfo obj = new SageBannerInfo();
                if (Session["EditImageID"] != null && Session["EditImageID"].ToString() != string.Empty)
                {
                    obj.ImageID = Int32.Parse(Session["EditImageID"].ToString());
                    if (fuFileUpload.HasFile)
                    {
                        obj.ImagePath       = fuFileUpload.PostedFile.FileName.Replace(" ", "_");
                        obj.NavigationImage = fuFileUpload.PostedFile.FileName.Replace(" ", "_");
                    }
                    else
                    {
                        // isEdit = true;
                        obj.ImagePath       = Convert.ToString(Session["ImageName"]);
                        obj.NavigationImage = Convert.ToString(Session["ImageName"]);
                    }
                }
                else
                {
                    obj.ImageID         = 0;
                    obj.ImagePath       = fuFileUpload.FileName.Replace(" ", "_");
                    obj.NavigationImage = fuFileUpload.FileName.Replace(" ", "_");
                }
                obj.Caption = string.Empty;
                if (rdbReadMorePageType.SelectedItem.Text == "Page")
                {
                    obj.ReadMorePage = ddlPagesLoad.SelectedValue.ToString();
                    obj.LinkToImage  = string.Empty;
                }
                if (rdbReadMorePageType.SelectedItem.Text == "Web Url")
                {
                    obj.LinkToImage  = txtWebUrl.Text;
                    obj.ReadMorePage = string.Empty;
                }
                obj.UserModuleID   = Int32.Parse(SageUserModuleID);
                obj.BannerID       = BannerId;
                obj.ImageID        = ImageId;
                obj.ReadButtonText = txtReadButtonText.Text;
                obj.Description    = txtBannerDescriptionToBeShown.Text.Trim();
                obj.PortalID       = GetPortalID;
                obj.CultureCode    = GetCurrentCulture();
                string swfExt = System.IO.Path.GetExtension(fuFileUpload.PostedFile.FileName);
                if (swfExt == ".swf")
                {
                    if (fuFileUpload.FileContent.Length > 0)
                    {
                        string        Path           = GetUplaodImagePhysicalPath();
                        string        fileName       = fuFileUpload.PostedFile.FileName.Replace(" ", "_");
                        DirectoryInfo dirUploadImage = new DirectoryInfo(Path);
                        if (dirUploadImage.Exists == false)
                        {
                            dirUploadImage.Create();
                        }
                        string fileUrl = Path + fileName;
                        int    i       = 1;
                        while (File.Exists(fileUrl))
                        {
                            fileName = i + fileName;
                            fileUrl  = Path + i + fileName;
                            i++;
                        }
                        fuFileUpload.PostedFile.SaveAs(fileUrl);
                        swfFileName         = "Modules/Sage_Banner/images/" + fileName;
                        obj.ImagePath       = fileName;
                        obj.NavigationImage = fileName;
                    }
                }
                else
                {
                    string target       = Server.MapPath("~/Modules/Sage_Banner/images/OriginalImage/");
                    string thumbLarge   = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Large/");
                    string thumbMedium  = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Medium/");
                    string thumbSmall   = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Small/");
                    string defaultImage = Server.MapPath("~/Modules/Sage_Banner/images/ThumbNail/Default/");
                    //System.Drawing.Image.GetThumbnailImageAbort thumbnailImageAbortDelegate = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
                    if (fuFileUpload.HasFile)
                    {
                        string fileName = fuFileUpload.PostedFile.FileName.Replace(" ", "_");
                        int    i        = 1;
                        while (File.Exists(target + "/" + fileName))
                        {
                            fileName = i + fileName;
                            i++;
                        }
                        fuFileUpload.SaveAs(Path.Combine(target, fileName));
                        fuFileUpload.SaveAs(Path.Combine(defaultImage, fileName));
                        string SourcePath = target + fileName;
                        //Resize Banner Images using Image Resizer
                        InterceptImageController.ResizeBannerImage(SourcePath, 320, thumbSmall, fileName);
                        InterceptImageController.ResizeBannerImage(SourcePath, 768, thumbMedium, fileName);
                        InterceptImageController.ResizeBannerImage(SourcePath, 965, thumbLarge, fileName);
                        obj.ImagePath       = fileName;
                        obj.NavigationImage = fileName;
                    }
                }
                SageBannerController objcont = new SageBannerController();
                objcont.SaveBannerContent(obj);
                int userModuleID = Int32.Parse(SageUserModuleID);
                BannerCacheClear();
                ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/Sage_Banner/ModuleLocalText", "BannerSavedsuccesfully"), "", SageMessageType.Success);
            }
            else
            {
                ShowMessage("Invalid File Extension", "Invalid File Extension", "The File you want to upload is invalid", SageMessageType.Error);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }

        Session["ImageName"]   = null;
        Session["EditImageID"] = null;
    }
Esempio n. 29
0
    public void GetItemRelatedUpSellAndCrossSellList(string itemsku)
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        aspxCommonObj.CustomerID  = CustomerID;
        aspxCommonObj.SessionCode = SessionCode;
        string modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(modulePath);
        string pageExtension = SageFrameSettingKeys.PageExtension;
        AspxYouMayAlsoLikeController objYouMayLike  = new AspxYouMayAlsoLikeController();
        List <YouMayAlsoLikeInfo>    lstRelatedItem = objYouMayLike.GetYouMayAlsoLikeItems(itemsku, aspxCommonObj, NoOfYouMayAlsoLikeItems);
        StringBuilder realatedItemCartContent       = new StringBuilder();

        if (lstRelatedItem != null && lstRelatedItem.Count > 0)
        {
            realatedItemCartContent.Append("<h2 class=\"sfLocale\">You May Also Like</h2>");
            foreach (YouMayAlsoLikeInfo item in lstRelatedItem)
            {
                string imagePath    = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.BaseImage;
                string altImagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.Name;
                if (item.BaseImage == "")
                {
                    imagePath = NoImageYouMayAlsoLikePath;
                }
                else
                {
                    //Resize Image Dynamically
                    InterceptImageController.ImageBuilder(item.BaseImage, ImageType.Medium, ImageCategoryType.Item, aspxCommonObj);
                }
                if (item.AlternateText == "")
                {
                    item.AlternateText = item.Name;
                }
                string        itemPrice      = Math.Round(double.Parse((item.Price).ToString()), 2).ToString();
                string        itemPriceValue = Math.Round(double.Parse((item.Price).ToString()), 2).ToString();
                string        itemPriceRate  = Math.Round(double.Parse((item.Price).ToString()), 2).ToString("N2");
                StringBuilder dataContent    = new StringBuilder();
                dataContent.Append("data-class=\"addtoCart\" data-ItemTypeID=\"" + item.ItemTypeID + "\" data-ItemID=\"" + item.ItemID + "\"data-type=\"button\" data-addtocart=\"");
                dataContent.Append("addtocart");
                dataContent.Append(item.ItemID);
                dataContent.Append("\" data-title=\"");
                dataContent.Append(item.Name);
                dataContent.Append("\" data-onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                dataContent.Append(item.ItemID);
                dataContent.Append(",");
                dataContent.Append(itemPriceValue);
                dataContent.Append(",'");
                dataContent.Append(item.SKU);
                dataContent.Append("',");
                dataContent.Append(1);
                dataContent.Append(",'");
                dataContent.Append(item.IsCostVariantItem);
                dataContent.Append("',this);\"");
                if ((lstRelatedItem.IndexOf(item) + 1) % NoOfYouMayAlsoLikeInARow == 0)
                {
                    realatedItemCartContent.Append("<div class=\"cssClassProductsBox cssClassNoMargin\">");
                }
                else
                {
                    realatedItemCartContent.Append("<div class=\"cssClassProductsBox\">");
                }
                var hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(item.SKU) + pageExtension;
                realatedItemCartContent.Append("<div id=\"productImageWrapID_");
                realatedItemCartContent.Append(item.ItemID);
                realatedItemCartContent.Append("\" class=\"cssClassProductsBoxInfo\" costvariantItem=");
                realatedItemCartContent.Append(item.IsCostVariantItem);
                realatedItemCartContent.Append("  itemid=\"");
                realatedItemCartContent.Append(item.ItemID);
                realatedItemCartContent.Append("\">");
                realatedItemCartContent.Append("<h3>");
                realatedItemCartContent.Append(item.SKU);
                realatedItemCartContent.Append("</h3><div class=\"divQuickLookonHover\"><div class=\"divitemImage cssClassProductPicture\"><a href=\"");
                realatedItemCartContent.Append(hrefItem);
                realatedItemCartContent.Append("\" ><img id=\"img_");
                realatedItemCartContent.Append(item.ItemID);
                realatedItemCartContent.Append("\"  alt=\"");
                realatedItemCartContent.Append(item.AlternateText);
                realatedItemCartContent.Append("\"  title=\"");
                realatedItemCartContent.Append(item.AlternateText);
                realatedItemCartContent.Append("\"");
                realatedItemCartContent.Append("src=\"");
                realatedItemCartContent.Append(aspxRootPath);
                realatedItemCartContent.Append(imagePath.Replace("uploads", "uploads/Medium"));
                realatedItemCartContent.Append("\" orignalPath=\"");
                realatedItemCartContent.Append(imagePath.Replace("uploads", "uploads/Medium"));
                realatedItemCartContent.Append("\" altImagePath=\"");
                realatedItemCartContent.Append(altImagePath.Replace("uploads", "uploads/Medium"));
                realatedItemCartContent.Append("\"/></a></div>");
                realatedItemCartContent.Append("<div class='cssLatestItemInfo'>");
                realatedItemCartContent.Append("<h2><a href=\"");
                realatedItemCartContent.Append(hrefItem);
                realatedItemCartContent.Append("\" title=\"" + item.Name + "\">");
                string name = string.Empty;
                if (item.Name.Length > 50)
                {
                    name = item.Name.Substring(0, 50);
                    int index = 0;
                    index = name.LastIndexOf(' ');
                    name  = name.Substring(0, index);
                    name  = name + "...";
                }
                else
                {
                    name = item.Name;
                }
                realatedItemCartContent.Append(name);
                realatedItemCartContent.Append("</a></h2>");
                if (item.HidePrice != true)
                {
                    if (item.ListPrice != null && item.ListPrice != "")
                    {
                        if (item.ItemTypeID == 5)
                        {
                            realatedItemCartContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                            realatedItemCartContent.Append("<p class=\"cssClassProductRealPrice \">");
                            realatedItemCartContent.Append(getLocale("Starting At "));
                            realatedItemCartContent.Append("<span class=\"cssClassFormatCurrency\">");
                            realatedItemCartContent.Append(itemPriceRate);
                            realatedItemCartContent.Append("</span></p></div></div>");
                        }
                        else
                        {
                            string strAmount = Math.Round(Convert.ToDecimal(item.ListPrice), 2).ToString("N2");
                            realatedItemCartContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                            realatedItemCartContent.Append("<p class=\"cssClassProductOffPrice\">");
                            realatedItemCartContent.Append("<span class=\"cssClassFormatCurrency\">");
                            realatedItemCartContent.Append(strAmount);
                            realatedItemCartContent.Append("</span></p><p class=\"cssClassProductRealPrice \">");
                            realatedItemCartContent.Append("<span class=\"cssClassFormatCurrency\">");
                            realatedItemCartContent.Append(itemPriceRate);
                            realatedItemCartContent.Append("</span></p></div></div>");
                        }
                    }
                    else
                    {//Added for group type products
                        if (item.ItemTypeID == 5)
                        {
                            realatedItemCartContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                            realatedItemCartContent.Append("<p class=\"cssClassProductRealPrice \">");
                            realatedItemCartContent.Append(getLocale("Starting At "));
                            realatedItemCartContent.Append("<span class=\"cssClassFormatCurrency\">");
                            realatedItemCartContent.Append(itemPriceRate);
                            realatedItemCartContent.Append("</span></p></div></div>");
                        }
                        else
                        {
                            realatedItemCartContent.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                            realatedItemCartContent.Append("<p class=\"cssClassProductRealPrice \">");
                            realatedItemCartContent.Append("<span class=\"cssClassFormatCurrency\">");
                            realatedItemCartContent.Append(itemPriceRate);
                            realatedItemCartContent.Append("</span></p></div></div>");
                        }
                    }
                }
                else
                {
                    realatedItemCartContent.Append("<div class=\"cssClassProductPriceBox\"></div>");
                }
                realatedItemCartContent.Append("<div class=\"cssClassProductDetail\"><p><a href=\"");
                realatedItemCartContent.Append(aspxRedirectPath);
                realatedItemCartContent.Append("item/");
                realatedItemCartContent.Append(item.SKU);
                realatedItemCartContent.Append(pageExtension);
                realatedItemCartContent.Append("\">");
                realatedItemCartContent.Append(getLocale("Details"));
                realatedItemCartContent.Append("</a></p></div>");

                realatedItemCartContent.Append("<div class=\"sfQuickLook\" style=\"display:none\">");
                realatedItemCartContent.Append("<img itemId=\"");
                realatedItemCartContent.Append(item.ItemID);
                realatedItemCartContent.Append("\" sku=\"");
                realatedItemCartContent.Append(item.SKU);
                realatedItemCartContent.Append("\" src=\"");
                realatedItemCartContent.Append(aspxTemplateFolderPath);
                realatedItemCartContent.Append("/images/QV_Button.png\" alt=\"\" rel=\"popuprel\" />");
                realatedItemCartContent.Append("</div>");
                string itemSKU  = item.SKU;
                string itemName = item.Name;
                if (AllowAddToCart.ToLower() == "true")
                {
                    if (AllowOutStockPurchase.ToLower() == "false")
                    {
                        if (item.IsOutOfStock == true)
                        {
                            realatedItemCartContent.Append("<div class=\"cssClassAddtoCard\"><div " + dataContent + " class=\"sfButtonwrapper cssClassOutOfStock\">");
                            realatedItemCartContent.Append("<button type=\"button\"><span>");
                            realatedItemCartContent.Append(getLocale("Out Of Stock"));
                            realatedItemCartContent.Append("</span></button></div></div>");
                        }
                        else
                        {
                            realatedItemCartContent.Append("<div class=\"cssClassAddtoCard\"><div " + dataContent + "class=\"sfButtonwrapper\">");
                            realatedItemCartContent.Append("<label class='i-cart cssClassCartLabel cssClassGreenBtn'><button type=\"button\" class=\"addtoCart\"");
                            realatedItemCartContent.Append("data-addtocart=\"");
                            realatedItemCartContent.Append("addtocart");
                            realatedItemCartContent.Append(item.ItemID);
                            realatedItemCartContent.Append("\" title=\"");
                            realatedItemCartContent.Append(itemName);
                            realatedItemCartContent.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            realatedItemCartContent.Append(item.ItemID);
                            realatedItemCartContent.Append(",");
                            realatedItemCartContent.Append(itemPriceValue);
                            realatedItemCartContent.Append(",'");
                            realatedItemCartContent.Append(itemSKU);
                            realatedItemCartContent.Append("',");
                            realatedItemCartContent.Append(1);
                            realatedItemCartContent.Append(",'");
                            realatedItemCartContent.Append(item.IsCostVariantItem);
                            realatedItemCartContent.Append("',this);\">");
                            realatedItemCartContent.Append(getLocale("Cart +"));
                            realatedItemCartContent.Append("</button></label></div></div>");
                        }
                    }
                    else
                    {
                        realatedItemCartContent.Append("<div class=\"cssClassAddtoCard\"><div " + dataContent + " class=\"sfButtonwrapper\">");
                        realatedItemCartContent.Append("<label class='i-cart cssClassCartLabel cssClassGreenBtn'><button type=\"button\" class=\"addtoCart\"");
                        realatedItemCartContent.Append("data-addtocart=\"");
                        realatedItemCartContent.Append("addtocart");
                        realatedItemCartContent.Append(item.ItemID);
                        realatedItemCartContent.Append("\" title=\"");
                        realatedItemCartContent.Append(itemName);
                        realatedItemCartContent.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                        realatedItemCartContent.Append(item.ItemID);
                        realatedItemCartContent.Append(",");
                        realatedItemCartContent.Append(itemPriceValue);
                        realatedItemCartContent.Append(",'");
                        realatedItemCartContent.Append(itemSKU);
                        realatedItemCartContent.Append("',");
                        realatedItemCartContent.Append(1);
                        realatedItemCartContent.Append(",'");
                        realatedItemCartContent.Append(item.IsCostVariantItem);
                        realatedItemCartContent.Append("',this);\">");
                        realatedItemCartContent.Append(getLocale("Cart +"));
                        realatedItemCartContent.Append("</button></label></div></div>");
                    }
                    realatedItemCartContent.Append("</div></div>");
                }
                realatedItemCartContent.Append("</div>");
                realatedItemCartContent.Append("</div>");
            }
        }
        ltrRelatedItemInCart.Text = realatedItemCartContent.ToString();
    }
Esempio n. 30
0
    private void GetNewOrderRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
    {
        try
        {
            string             noImageUrl = string.Empty;
            StoreSettingConfig ssc        = new StoreSettingConfig();
            noImageUrl = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, aspxCommonObj.StoreID,
                                                   aspxCommonObj.PortalID, aspxCommonObj.CultureName);
            string[] path      = pageURL.Split('?');
            string   pagepath  = path[0];
            string   x         = HttpContext.Current.Request.ApplicationPath;
            string   authority = HttpContext.Current.Request.Url.Authority;
            string   pageUrl   = authority + x;
            List <RssFeedNewOrders> popularTagRss = AspxRssFeedProvider.GetNewOrdersRssContent(aspxCommonObj,
                                                                                               rssOption, count);
            foreach (RssFeedNewOrders rssItemData in popularTagRss)
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", "");
                rssXml.WriteElementString("link", " ");
                rssXml.WriteStartElement("description");

                var description = "";

                description += "<div><table width=\"100%\"><tr><td colspan=\"2\">OrderID:" + rssItemData.OrderID + "</td></tr>";
                description += "<tr><td>Order Date: " + rssItemData.AddedOn + "</td><td>Order Status: " + rssItemData.OrderStatus + "</td></tr>";
                description += "<tr><td>Store Name: " + rssItemData.StoreName + "</td><td>Customer Name: " + rssItemData.CustomerName + "</td></tr>";
                description += "<tr><td>Grand Total: " + rssItemData.GrandTotal + "</td><td>Payment Method Name: " + rssItemData.PaymentMethodName + "</td></tr>";
                description += "</table></div>";
                description += "<div><ul style=list-style-type: none><h2> Ordered Items:</h2>";
                foreach (var orderItemInfo in rssItemData.OrderItemInfo)
                {
                    if (orderItemInfo.ImagePath == "")
                    {
                        orderItemInfo.ImagePath = noImageUrl;
                    }
                    else
                    {   //Resize Image Dynamically
                        InterceptImageController.ImageBuilder(orderItemInfo.ImagePath, ImageType.Small, ImageCategoryType.Item, aspxCommonObj);
                    }
                    description += "<li style=\"float: left;display: inline;padding-right: 50px\"><h2>" +
                                   orderItemInfo.ItemName + "</h2><a href=http://" + pageUrl + "/item/" +
                                   orderItemInfo.SKU + SageFrameSettingKeys.PageExtension + "><img alt=" +
                                   orderItemInfo.ItemName + " src=http://" + pageUrl + "/" +
                                   orderItemInfo.ImagePath.Replace("uploads", "uploads/Small") + " /></a></li>";
                }
                description += "</ul></div>";

                rssXml.WriteCData(description);
                rssXml.WriteEndElement();

                // rssXml.WriteElementString("pubDate", rssItemData.AddedOn);
                rssXml.WriteElementString("pubDate", "");
                rssXml.WriteEndElement();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }