Пример #1
0
    protected void page_init(object sender, EventArgs e)
    {
        aspxfilePath = ResolveUrl("~") + "Modules/AspxCommerce/AspxItemsManagement/";

        try
        {
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            SageFrameRoute parentPage = (SageFrameRoute)this.Page;

            itemSKU = parentPage.Key;
            userIP  = HttpContext.Current.Request.UserHostAddress;
            if (!IsPostBack)
            {
                storeID      = GetStoreID;
                portalID     = GetPortalID;
                customerID   = GetCustomerID;
                userName     = GetUsername;
                cultureName  = GetCurrentCultureName;
                variantQuery = Request.QueryString["varId"];
                if (HttpContext.Current.Session.SessionID != null)
                {
                    sessionCode = HttpContext.Current.Session.SessionID.ToString();
                }
                OverRideSEOInfo(itemSKU, storeID, portalID, userName, cultureName);
                IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();

                ipToCountry.GetCountry(userIP, out countryName);
                if (countryName == null)
                {
                    countryName = "";
                }
                SecurityPolicy            objSecurity = new SecurityPolicy();
                FormsAuthenticationTicket ticket      = objSecurity.GetUserTicket(GetPortalID);
                if (ticket != null && ticket.Name != ApplicationKeys.anonymousUser)
                {
                    MembershipController member     = new MembershipController();
                    UserInfo             userDetail = member.GetUserDetails(GetPortalID, GetUsername);
                    userEmail = userDetail.Email;
                }

                StoreSettingConfig ssc = new StoreSettingConfig();
                AllowRealTimeNotifications = ssc.GetStoreSettingsByKey(StoreSetting.AllowRealTimeNotifications, storeID, portalID, cultureName);
                noItemDetailImagePath      = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, storeID, portalID,
                                                                       cultureName);
                enableEmailFriend = ssc.GetStoreSettingsByKey(StoreSetting.EnableEmailAFriend, storeID, portalID,
                                                              cultureName);
                allowAnonymousReviewRate =
                    ssc.GetStoreSettingsByKey(StoreSetting.AllowAnonymousUserToWriteItemRatingAndReviews, storeID,
                                              portalID, cultureName);
                allowOutStockPurchase = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, storeID, portalID,
                                                                  cultureName);
                AllowAddToCart = ssc.GetStoreSettingsByKey(StoreSetting.ShowAddToCartButton, storeID, portalID,
                                                           cultureName);
                allowMultipleReviewPerUser =
                    bool.Parse(ssc.GetStoreSettingsByKey(StoreSetting.AllowMultipleReviewsPerUser, storeID, portalID,
                                                         cultureName));
                allowMultipleReviewPerIP =
                    bool.Parse(ssc.GetStoreSettingsByKey(StoreSetting.AllowMultipleReviewsPerIP, storeID, portalID,
                                                         cultureName));
                ItemPagePath = ResolveUrl("~/Item/");
            }

            if (SageUserModuleID != "")
            {
                UserModuleID = int.Parse(SageUserModuleID);
            }
            else
            {
                UserModuleID = 0;
            }
            IncludeJs("itemdetails", "/js/encoder.js", "/js/StarRating/jquery.rating.pack.js", "/js/StarRating/jquery.MetaData.js", "/js/Paging/jquery.pagination.js");
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            FormsAuthenticationTicket ticket = SecurityPolicy.GetUserTicket(GetPortalID);
            if (ticket != null && ticket.Name != ApplicationKeys.anonymousUser)
            {
                IncludeCss("WishItemList", "/Templates/" + TemplateName + "/css/MessageBox/style.css", "/Templates/" + TemplateName + "/css/PopUp/style.css", "/Templates/" + TemplateName + "/css/ToolTip/tooltip.css");
                IncludeJs("WishItemList", "/js/DateTime/date.js", "/js/MessageBox/jquery.easing.1.3.js",
                          "/js/MessageBox/alertbox.js", "/js/PopUp/custom.js", "/js/jquery.tipsy.js");

                //SageFrameConfig pagebase = new SageFrameConfig();
                //IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
                StoreID     = GetStoreID;
                PortalID    = GetPortalID;
                UserName    = GetUsername;
                CustomerID  = GetCustomerID;
                CultureName = GetCurrentCultureName;
                if (!IsPostBack)
                {
                    MembershipController member     = new MembershipController();
                    UserInfo             userDetail = member.GetUserDetails(GetPortalID, GetUsername);
                    UserEmailWishList = userDetail.Email;
                }
                if (HttpContext.Current.Session.SessionID != null)
                {
                    SessionCode = HttpContext.Current.Session.SessionID.ToString();
                }

                UserIp = HttpContext.Current.Request.UserHostAddress;
                IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();
                ipToCountry.GetCountry(UserIp, out CountryName);

                StoreSettingConfig ssc = new StoreSettingConfig();
                NoImageWishList       = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName);
                EnableWishList        = ssc.GetStoreSettingsByKey(StoreSetting.EnableWishList, StoreID, PortalID, CultureName);
                ShowImageInWishlist   = ssc.GetStoreSettingsByKey(StoreSetting.ShowItemImagesInWishList, StoreID, PortalID, CultureName);
                AllowOutStockPurchase = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, StoreID, PortalID, CultureName);
                string sortByOptions = ssc.GetStoreSettingsByKey(StoreSetting.SortByOptions, StoreID, PortalID, CultureName);
            }
            else
            {
                if (IsUseFriendlyUrls)
                {
                    if (GetPortalID > 1)
                    {
                        Response.Redirect(ResolveUrl("~/portal/" + GetPortalSEOName + "/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + ".aspx?ReturnUrl=" + Request.Url.ToString(), false);
                    }
                    else
                    {
                        Response.Redirect(ResolveUrl("~/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + ".aspx?ReturnUrl=" + Request.Url.ToString(), false);
                    }
                }

                else
                {
                    Response.Redirect(ResolveUrl("~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + "?ReturnUrl=" + Request.Url.ToString(), false);
                }
            }
            if (EnableWishList.ToLower() == "true")
            {
                BindWishListItem();
            }
            //IncludeLanguageJS();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
        public void SendMailNotificatiion(int storeId, int portalId, string cultureName, BookAnAppointmentInfo objInfo)
        {
            DateTime           now;
            StoreSettingConfig ssc     = new StoreSettingConfig();
            string             logosrc = ssc.GetStoreSettingsByKey(StoreSetting.StoreLogoURL, storeId, portalId, cultureName);
            string             name    = "Appointment Approval - Email";
            List <KeyValuePair <string, object> > parameter = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("PortalID", (object)portalId),
                new KeyValuePair <string, object>("CultureName", cultureName),
                new KeyValuePair <string, object>("MessageTemplateTypeName", name)
            };
            int messageTemplateTypeId      = (new OracleHandler()).ExecuteNonQuery("usp_Aspx_GetMessageTemplateTypeID", parameter, "MessageTemplateID");
            MessageManagementInfo template = (new MessageManagementController()).GetMessageTemplate(messageTemplateTypeId, portalId);
            string messageTemplate         = template.Body;
            string src             = string.Concat(HttpContext.Current.Request.ServerVariables["SERVER_NAME"], "/");
            string receiverEmailID = objInfo.Email;
            string subject         = template.Subject;
            string senderEmail     = template.MailFrom;
            string headerMsg       = string.Empty;
            string customMessage   = "";

            if (objInfo.AppointmentID > 0)
            {
                headerMsg = "status has been modified as follow.";
            }
            else if (objInfo.AppointmentID == 0)
            {
                headerMsg = "has been scheduled as following date and time.";
            }
            if (template != null)
            {
                string[] allToken = this.GetAllToken(messageTemplate);
                for (int i = 0; i < (int)allToken.Length; i++)
                {
                    string token = allToken[i];
                    string str   = token;
                    if (str != null)
                    {
                        switch (str)
                        {
                        case "%LogoSource%":
                        {
                            string imgSrc = string.Concat(src, logosrc);
                            messageTemplate = messageTemplate.Replace(token, imgSrc);
                            break;
                        }

                        case "%DateTime%":
                        {
                            now             = DateTime.Now;
                            messageTemplate = messageTemplate.Replace(token, now.ToString("MM/dd/yyyy"));
                            break;
                        }

                        case "%PreferredDate%":
                        {
                            now             = objInfo.PreferredDate;
                            messageTemplate = messageTemplate.Replace(token, now.ToString("MM/dd/yyyy"));
                            break;
                        }

                        case "%PreferredTime%":
                        {
                            messageTemplate = messageTemplate.Replace(token, objInfo.PreferredTime);
                            break;
                        }

                        case "%PreferredTimeInterval%":
                        {
                            messageTemplate = messageTemplate.Replace(token, objInfo.PreferredTimeInterval);
                            break;
                        }

                        case "%AppointmentStatus%":
                        {
                            messageTemplate = messageTemplate.Replace(token, objInfo.AppointmentStatusName);
                            break;
                        }

                        case "%ServerPath%":
                        {
                            messageTemplate = messageTemplate.Replace(token, src);
                            break;
                        }

                        case "%DateYear%":
                        {
                            int year = DateTime.Now.Year;
                            messageTemplate = messageTemplate.Replace(token, year.ToString());
                            break;
                        }

                        case "%AppointmentHeadingMessage%":
                        {
                            messageTemplate = messageTemplate.Replace(token, headerMsg);
                            break;
                        }

                        case "%AppointmentCustomMessage%":
                        {
                            messageTemplate = messageTemplate.Replace(token, customMessage);
                            break;
                        }

                        case "%ServiceProductName%":
                        {
                            messageTemplate = messageTemplate.Replace(token, objInfo.ServiceProductName);
                            break;
                        }
                        }
                    }
                }
            }
            SageFrameConfig pagebase        = new SageFrameConfig();
            string          emailSuperAdmin = pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserEmail);
            string          emailSiteAdmin  = pagebase.GetSettingsByKey(SageFrameSettingKeys.SiteAdminEmailAddress);

            MailHelper.SendMailNoAttachment(senderEmail, receiverEmailID, subject, messageTemplate, emailSiteAdmin, emailSuperAdmin);
        }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (CheckOutSessions.Get("MoneybookersData", "") != "")
            {
                string[] data = CheckOutSessions.Get("MoneybookersData", "").Split('#');
                storeID     = int.Parse(data[0].ToString());
                portalID    = int.Parse(data[1].ToString());
                userName    = data[2];
                customerID  = int.Parse(data[3].ToString());
                sessionCode = data[4].ToString();
                cultureName = data[5];
                itemIds     = data[6];
                couponCode  = data[7];
                Spath       = ResolveUrl("~/Modules/AspxCommerce/AspxCommerceServices/");
                StoreSettingConfig ssc = new StoreSettingConfig();
                MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, storeID, portalID, cultureName);
                AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
                aspxCommonObj.StoreID  = storeID;
                aspxCommonObj.PortalID = portalID;
                if (MoneybookersSupportedCurrency.moneybookersSupportedCurrency.Split(',').Where(s => string.Compare(MainCurrency, s, true) == 0).Count() > 0)
                {
                    rate             = 1;
                    SelectedCurrency = MainCurrency;
                }
                else
                {
                    AspxCoreController acc = new AspxCoreController();
                    rate             = acc.GetCurrencyRateOnChange(aspxCommonObj, MainCurrency, "USD", "en-US");
                    MainCurrency     = "USD";
                    SelectedCurrency = MainCurrency;

                    /* Some time if selected currency does not exist in currency table then it returns 1,
                     *    if we take 1 as rate then it will convert same as previous amount
                     *     So avoid Transaction by making it 0 */

                    if (rate == 1)
                    {
                        rate = 0;
                    }
                }
                if (rate != 0)
                {
                    Session["SelectedCurrency"] = SelectedCurrency;
                    LoadSetting();
                }
                else
                {
                    lblnotity.Text    = "Something goes wrong, hit refresh or go back to checkout";
                    clickhere.Visible = false;
                }
            }
            else
            {
                lblnotity.Text    = "Something goes wrong, hit refresh or go back to checkout";
                clickhere.Visible = false;
            }
        }
        catch (Exception ex)
        {
            lblnotity.Text    = "Something goes wrong, hit refresh or go back to checkout";
            clickhere.Visible = false;
            ProcessException(ex);
        }
    }
    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 modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(modulePath);
        string pageExtension = SageFrameSettingKeys.PageExtension;
        List <ServiceItemDetailsInfo> lstSIDetail = AspxServiceController.GetServiceItemDetails(itemID, aspxCommonObj);
        StringBuilder serviceIDetailBdl           = new StringBuilder();

        serviceIDetailBdl.Append("<div id=\"divServiceItemDetails\" class=\"cssServiceItemDetails\">");
        if (lstSIDetail != null && lstSIDetail.Count > 0)
        {
            foreach (ServiceItemDetailsInfo item in lstSIDetail)
            {
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                if (item.ImagePath == "")
                {
                    imagePath = NoImageServiceItemPath;
                }
                serviceIDetailBdl.Append("<div class=\"cssItemName\"><h2><span>" + item.ItemName + "</span></h2></div>");
                serviceIDetailBdl.Append("<div class=\"cssItemImage\">");
                serviceIDetailBdl.Append("<img alt=\"" + item.ItemName + "\" src=" + aspxRootPath + imagePath.Replace("uploads", "uploads/Small") + "></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) + ">" + Math.Round(item.Price * rate, 2) + "</span>");
                serviceIDetailBdl.Append("<div class=\"sfButtonwrapper\">");
                serviceIDetailBdl.Append("<a href=" + aspxRedirectPath + "Book-An-Appointment" + pageExtension + "?cid=" + item.CategoryID + "&pid=" + item.ItemID + ">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();
    }
Пример #6
0
    private void CreateGlobalVariables()
    {
        Page.ClientScript.RegisterClientScriptInclude("AspxCommereCore", ResolveUrl("~/js/SageFrameCorejs/aspxcommercecore.js"));
        Page.ClientScript.RegisterClientScriptInclude("Session", ResolveUrl("~/js/Session.js"));
        IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
        PageExtension     = SageFrameSettingKeys.PageExtension;
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalServicePath", " var aspxservicePath='" + ResolveUrl("~/") + "Modules/AspxCommerce/AspxCommerceServices/" + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRootPath", " var aspxRootPath='" + ResolveUrl("~/") + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalTemplateFolderPath", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "pageExtension", " var pageExtension='" + PageExtension + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "storeID", " var storeID='" + GetStoreID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "portalID", " var portalID='" + GetPortalID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "culturename", " var cultureName='" + GetCurrentCultureName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "templatename", " var templateName='" + TemplateName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "customerid", " var customerID='" + GetCustomerID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "username", " var userName='******';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "templateName", " var templateName='" + TemplateName + "';", true);
        //  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "noimagepath", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
        //  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "defaultlogourl", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "isfriendlyurl", " var IsUseFriendlyUrls='" + IsUseFriendlyUrls + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "sessioncode", " var sessionCode='" + HttpContext.Current.Session.SessionID.ToString() + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientIPAddress", " var clientIPAddress='" + HttpContext.Current.Request.UserHostAddress + "';", true);
        string userIP      = HttpContext.Current.Request.UserHostAddress;
        string countryName = "";
        IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();

        ipToCountry.GetCountry(userIP, out countryName);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientCountry", " var aspxCountryName='" + countryName + "';", true);
        StoreSettingConfig ssc       = new StoreSettingConfig();
        string             myCartURL = ssc.GetStoreSettingsByKey(StoreSetting.ShoppingCartURL, GetStoreID, GetPortalID, GetCurrentCultureName);

        SendEcommerceEmailsFrom = ssc.GetStoreSettingsByKey(StoreSetting.SendEcommerceEmailsFrom, GetStoreID, GetPortalID, GetCurrentCultureName);
        string sortByOptions        = ssc.GetStoreSettingsByKey(StoreSetting.SortByOptions, GetStoreID, GetPortalID, GetCurrentCultureName);
        string sortByOptionsDefault = ssc.GetStoreSettingsByKey(StoreSetting.SortByOptionsDefault, GetStoreID, GetPortalID, GetCurrentCultureName);
        string viewAsOptions        = ssc.GetStoreSettingsByKey(StoreSetting.ViewAsOptions, GetStoreID, GetPortalID, GetCurrentCultureName);
        string viewAsOptionsDefault = ssc.GetStoreSettingsByKey(StoreSetting.ViewAsOptionsDefault, GetStoreID, GetPortalID, GetCurrentCultureName);

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "sortByOptions", " var sortByOptions='" + sortByOptions + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "sortByOptionsDefault", " var sortByOptionsDefault='" + sortByOptionsDefault + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "viewAsOptions", " var viewAsOptions='" + viewAsOptions + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "viewAsOptionsDefault", " var viewAsOptionsDefault='" + viewAsOptionsDefault + "';", true);
        Session["SendEcommerceEmailsFrom"] = SendEcommerceEmailsFrom;
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myCartURL", " var myCartURL='" + myCartURL + "';", true);
        string userFullName = ctl.GetFullName(GetPortalID, GetUsername);

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "userFullName", " var userFullName='" + userFullName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "homeURL", " var homeURL='" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "LoginURL", " var LogInURL='" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage) + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "itemImagePath", " var itemImagePath='Modules/AspxCommerce/AspxItemsManagement/uploads/';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "categoryImagePath", " var categoryImagePath='Modules/AspxCommerce/AspxCategoryManagement/uploads/';", true);

        if (IsUseFriendlyUrls)
        {
            if (GetPortalID > 1)
            {
                sageRedirectPath = ResolveUrl("~/portal/" + GetPortalSEOName + "/");
                sageNavigateUrl  = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
            }
            else
            {
                sageRedirectPath = ResolveUrl("~/");
                sageNavigateUrl  = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
            }
        }
        else
        {
            sageRedirectPath = ResolveUrl("{~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
            sageNavigateUrl  = ResolveUrl("~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
        }
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRedirectPath", " var aspxRedirectPath='" + sageRedirectPath + "';", true);
    }
Пример #7
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();
    }
    private void BindServiceDetails()
    {
        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 modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

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

        List <ServiceDetailsInfo> lstServiceDetail = AspxServiceController.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><span>" + lstServiceDetail[0].CagegoryName + "</span></h2>");
            serviceDetailBld.Append("<div class=\"cssImageWrapper\">");
            serviceDetailBld.Append("<img alt=\"" + lstServiceDetail[0].CagegoryName + "\" title=\"" + lstServiceDetail[0].CagegoryName + "\" 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 = "";
                }
                if ((lstServiceDetail.IndexOf(serviceDetailsInfo) + 1) % NoOfItemInRow == 0)
                {
                    serviceItemBld.Append("<div class=\"cssClassItems cssClassNoMargin\">");
                }
                else
                {
                    serviceItemBld.Append("<div class=\"cssClassItems\">");
                }
                serviceItemBld.Append("<h3>");
                serviceItemBld.Append("<a href=\"" + aspxRootPath + "Service-Item-Details" + pageExtension + "?id=" + serviceDetailsInfo.ItemID + "\"><span>" + serviceDetailsInfo.ItemName + "</span></a></h3>");
                //serviceItemBld.Append("<div class=\"cssImageWrapper\"><img src=" + aspxRootPath + imagePath + "/></div>");
                serviceItemBld.Append("<p>" + HttpUtility.HtmlDecode(serviceDetailsInfo.ShortDescription.Trim()) + "</p>");
                serviceItemBld.Append("<span class=\"cssClassServiceDuration\" value=\"" +
                                      (serviceDetailsInfo.ServiceDuration) + "\">" + '(' +
                                      (serviceDetailsInfo.ServiceDuration) + ' ' + getLocale("minutes") + ')' +
                                      "</span>&nbsp;");
                serviceItemBld.Append("<span class=\"cssClassFormatCurrency\" value=\"" + (serviceDetailsInfo.Price) + "\">" + (serviceDetailsInfo.Price * rate) + "</span><div class=\"cssClassClear\"></div>");
                serviceItemBld.Append("<div class=\"sfButtonwrapper\"><a href=\"" + aspxRedirectPath +
                                      "Book-An-Appointment" + pageExtension + "?cid=" + serviceDetailsInfo.CategoryID +
                                      "&amp;pid=" + serviceDetailsInfo.ItemID + "\">" + getLocale("Book Now") +
                                      "</a></div><div class=\"cssClassClear\"></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();
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);
        HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpContext.Current.Response.Cache.SetNoStore();
        Response.Cache.SetExpires(DateTime.Now);
        Response.Cache.SetValidUntilExpires(true);
        StoreID          = GetStoreID;
        PortalID         = GetPortalID;
        UserName         = GetUsername;
        CustomerID       = GetCustomerID;
        CultureName      = GetCurrentCultureName;
        UserModuleIDCart = int.Parse(SageUserModuleID);
        StoreSettingConfig ssc = new StoreSettingConfig();

        try
        {
            CartModulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);

            if (HttpContext.Current.Session.SessionID != null)
            {
                SessionCode = HttpContext.Current.Session.SessionID.ToString();
            }
            if (!IsPostBack)
            {
                IncludeCss("MyCart", "/Templates/" + TemplateName + "/css/GridView/tablesort.css",
                           "/Templates/" + TemplateName + "/css/MessageBox/style.css",
                           "/Templates/" + TemplateName + "/css/ToolTip/tooltip.css",
                           "/Modules/AspxCommerce/AspxCart/css/module.css");
                IncludeJs("MyCart", "/js/encoder.js", "/js/MessageBox/alertbox.js", "/js/jquery.easing.1.3.js",
                          "/Modules/AspxCommerce/AspxCart/js/MyCart.js", "/js/jquery.tipsy.js");

                aspxCommonObj.StoreID     = StoreID;
                aspxCommonObj.PortalID    = PortalID;
                aspxCommonObj.UserName    = UserName;
                aspxCommonObj.CultureName = CultureName;
                aspxCommonObj.SessionCode = SessionCode;
                aspxCommonObj.CustomerID  = CustomerID;
                NoImageMyCartPath         = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID,
                                                                      CultureName);
                AllowMultipleAddShipping = ssc.GetStoreSettingsByKey(StoreSetting.AllowMultipleShippingAddress, StoreID,
                                                                     PortalID, CultureName);
                ShowItemImagesOnCart = ssc.GetStoreSettingsByKey(StoreSetting.ShowItemImagesInCart, StoreID, PortalID,
                                                                 CultureName);
                MinCartSubTotalAmount = ssc.GetStoreSettingsByKey(StoreSetting.MinimumCartSubTotalAmount, StoreID,
                                                                  PortalID, CultureName);
                AllowOutStockPurchase = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, StoreID, PortalID,
                                                                  CultureName);
                MultipleAddressChkOutURL = ssc.GetStoreSettingsByKey(StoreSetting.MultiCheckOutURL, StoreID, PortalID,
                                                                     CultureName);
                AllowShippingRateEstimate = ssc.GetStoreSettingsByKey(StoreSetting.AllowShippingRateEstimate, StoreID, PortalID,
                                                                      CultureName);
                AllowCouponDiscount = ssc.GetStoreSettingsByKey(StoreSetting.AllowCouponDiscount, StoreID, PortalID,
                                                                CultureName);
                AllowRealTimeNotifications = ssc.GetStoreSettingsByKey(StoreSetting.AllowRealTimeNotifications, StoreID, PortalID, CultureName);
            }
            DisplayCartItems();
            IncludeLanguageJS();
            CouponInfo();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Пример #10
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;
     }
 }
Пример #11
0
    private void LoadSpecialGallery()
    {
        string modulePath = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        string             pageExtension          = SageFrameSettingKeys.PageExtension;
        string             aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string             aspxRootPath           = ResolveUrl("~/");
        decimal            rate           = 1;
        StoreSettingConfig ssc            = new StoreSettingConfig();
        decimal            additionalCCVR = decimal.Parse(ssc.GetStoreSettingsByKey(StoreSetting.AdditionalCVR, StoreID, PortalID, CultureName));
        string             MainCurrency   = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, StoreID, PortalID, 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());
            }
        }

        List <SpecialItemsInfo> lstSpecialItems = AspxSpecialItemController.GetSpecialItems(aspxCommonObj, Count);
        StringBuilder           gallery         = new StringBuilder();
        StringBuilder           caption         = new StringBuilder();

        if (lstSpecialItems.Count > 0)
        {
            gallery.Append("<div id=\"wrapper\">");
            gallery.Append("<div id =\"slider-wrapper\">");
            gallery.Append("<div id=\"sliderfront\" class=\"nivoSlider\">");
            foreach (SpecialItemsInfo item in lstSpecialItems)
            {
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                if (item.ImagePath == "")
                {
                    imagePath = aspxRootPath + NoImageFeaturedItemPath;
                }
                if (item.AlternateText == "")
                {
                    item.AlternateText = item.ItemName;
                }
                string medpath = imagePath;
                medpath = medpath.Replace("uploads", "uploads/Medium");

                gallery.Append("<a href=\"" + aspxRedirectPath + "item/" + item.SKU + pageExtension + "\"><img alt=\"" +
                               item.AlternateText + "\" src=\"" + aspxRootPath + medpath +
                               "\" class=\"cssClassItemImage\" width=\"188\" height=\"87\" title=\"#Caption-" +
                               item.ItemID +
                               "\" /></a>");

                caption.Append("<div id=\"Caption-" + item.ItemID + "\" class=\"nivo-html-caption\"><a href=\"" +
                               aspxRedirectPath + "item/" + item.SKU + pageExtension + "\">" + item.ItemName + "</a><span>" +
                               getLocale("Price:") + "&nbsp;<span class=\"cssClassFormatCurrency\">" + Math.Round(double.Parse((item.Price * rate).ToString()), 2).ToString() +
                               "</span></span></div>");
            }
            gallery.Append("</div></div></div>");
            gallery.Append(caption.ToString());
        }
        else
        {
            gallery.Append("<div class=\"cssClassNotFound\">" +
                           getLocale("This store has no special items found!") + "</div>");
        }
        ltGallery.Text = gallery.ToString();
    }
Пример #12
0
    private void GetBestSellerCasrousel()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        string modulePath = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        int offset = 1;
        List <CategoryDetailsOptionsInfo> bestItemsInfo = AspxBestSellerController.GetBestSellerCarousel(offset,
                                                                                                         CountBestSeller,
                                                                                                         aspxCommonObj, 1);

        RowTotal = bestItemsInfo.Count;
        StringBuilder      bestItemContents = new StringBuilder();
        string             aspxRootPath     = ResolveUrl("~/");
        string             pageExtension    = SageFrameSettingKeys.PageExtension;
        decimal            rate             = 1;
        StoreSettingConfig ssc            = new StoreSettingConfig();
        decimal            additionalCCVR = decimal.Parse(ssc.GetStoreSettingsByKey(StoreSetting.AdditionalCVR, StoreID, PortalID, CultureName));
        string             MainCurrency   = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, StoreID, PortalID, 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());
            }
        }
        bestItemContents.Append("<div id=\"divBestSellerBoxInfo\" class=\"cssClassBestSellerBoxInfoCarousel\">");
        if (bestItemsInfo != null && bestItemsInfo.Count > 0)
        {
            foreach (CategoryDetailsOptionsInfo item in bestItemsInfo)
            {
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                if (item.ImagePath == "")
                {
                    imagePath = DefaultImagePath;
                }
                decimal listPriceValue = 0;
                if (item.ListPrice == "")
                {
                    item.ListPrice = null;
                }
                else
                {
                    listPriceValue = Convert.ToDecimal(item.ListPrice);
                }

                decimal priceValue    = Convert.ToDecimal(item.Price);
                string  itemPrice     = Math.Round(double.Parse((item.Price).ToString()), 2).ToString();
                string  itemPriceRate = Math.Round(double.Parse((priceValue * rate).ToString()), 2).ToString();
                bestItemContents.Append("<div class=\"cssClassProductsBoxWrapper\">");
                bestItemContents.Append("<div class=\"cssClassProductsBox\">");

                string hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(item.SKU) + pageExtension;
                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;
                }
                bestItemContents.Append("<div id=\"productCarasoulImageWrapID_" + item.ItemID +
                                        "\" class=\"cssClassProductsBoxInfo\" costvariantItem=" + item.IsCostVariantItem +
                                        "  itemid=\"" + item.ItemID +
                                        "\"><a href=\"" + hrefItem + "\" title=\"" + item.Name + "\"><h2>" + name + "</h2></a><div  class=\"cssClassProductPicture\"><a href=\"" +
                                        hrefItem + "\"><img alt=\"" + item.Name +
                                        "\"  title=\"" + item.Name + "\" src=\"" + aspxRootPath +
                                        imagePath.Replace("uploads", "uploads/Medium") + "\" ></a></div><h3>" +
                                        item.SKU + "</h3>");


                if (item.ListPrice != null)
                {
                    string listPrice = Math.Round(double.Parse(item.ListPrice.ToString()), 2).ToString();
                    string strAmount = Math.Round((listPriceValue * rate), 2).ToString();
                    bestItemContents.Append(
                        "<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\"><p class=\"cssClassProductOffPrice\"><span class=\"cssClassFormatCurrency\" value=" +
                        listPrice + ">" + strAmount +
                        "</span></p><p class=\"cssClassProductRealPrice \" ><span class=\"cssClassFormatCurrency\" value=" +
                        itemPrice + ">" + itemPriceRate + "</span></p></div></div>");
                }
                else
                {
                    bestItemContents.Append(
                        "<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\"><p class=\"cssClassProductRealPrice \" ><span class=\"cssClassFormatCurrency\" value=" +
                        itemPrice + ">" + itemPriceRate + "</span></p></div></div>");
                }
                bestItemContents.Append("<div class=\"cssClassProductDetail\"><p><a href=\"" + aspxRedirectPath +
                                        "item/" + item.SKU + ".aspx onclick=\"AjaxLoader()\">" +
                                        getLocale("Details") + "</a></p></div></div>");

                //bestItemContents.Append("<div class=\"cssClassButtonWrapper\">");
                //if (AllowWishListLatestItem.ToLower() == "true")
                //{
                //    if (CustomerID > 0 && UserName.ToLower() != "anonymoususer")
                //    {
                //        bestItemContents.Append("<div class=\"cssClassWishListButton\">");
                //        bestItemContents.Append("<button type=\"button\" id=\"addWishList\" onclick=LatestItems.CheckWishListUniqueness(");
                //        bestItemContents.Append(item.ItemID);
                //        bestItemContents.Append(",'");
                //        bestItemContents.Append(item.SKU);
                //        bestItemContents.Append("',this);><span><span><span>+</span>");
                //        bestItemContents.Append(getLocale("Wishlist"));
                //        bestItemContents.Append("</span></span></button></div>");
                //    }
                //    else
                //    {
                //        bestItemContents.Append("<div class=\"cssClassWishListButton\">");
                //        bestItemContents.Append("<button type=\"button\" id=\"addWishList\" onclick=\"AspxCommerce.RootFunction.Login();\">");
                //        bestItemContents.Append("<span><span><span>+</span>");
                //        bestItemContents.Append(getLocale("Wishlist"));
                //        bestItemContents.Append("</span></span></button></div>");
                //    }
                //}
                ////if (AllowAddToCompareLatest.ToLower() == "true")
                ////{
                ////    bestItemContents.Append("<div class=\"cssClassCompareButton\">");
                ////    bestItemContents.Append("<label><input type=\"checkbox\" id=\"compare-");
                ////    bestItemContents.Append(item.ItemID);
                ////    bestItemContents.Append("\" onclick=BestSellersCarousel.AddItemsToCompare(");
                ////    bestItemContents.Append(item.ItemID);
                ////    bestItemContents.Append(",'");
                ////    bestItemContents.Append(item.SKU);
                ////    bestItemContents.Append("',this);><span>");
                ////    bestItemContents.Append(getLocale("Compare"));
                ////    bestItemContents.Append("</span></input></label></div>");
                ////}
                //bestItemContents.Append("</div>");
                //bestItemContents.Append("<div class=\"cssClassclear\"></div>");
                //var itemSKU = item.SKU;
                //var itemName = item.Name;
                //if (AllowOutStockPurchase.ToLower() == "false")
                //{
                //    if (item.IsOutOfStock == true)
                //    {
                //        bestItemContents.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper cssClassOutOfStock\">");
                //        bestItemContents.Append("<button type=\"button\"><span>");
                //        bestItemContents.Append(getLocale("Out Of Stock"));
                //        bestItemContents.Append("</span></button></div></div>");
                //    }
                //    else
                //    {
                //        bestItemContents.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\">");
                //        bestItemContents.Append("<button type=\"button\" id=\"addtoCart\" title=");
                //        bestItemContents.Append(itemName);
                //        bestItemContents.Append(" onclick=LatestItems.AddToCartToJS(");
                //        bestItemContents.Append(item.ItemID);
                //        bestItemContents.Append(",");
                //        bestItemContents.Append(itemPrice);
                //        bestItemContents.Append(",'");
                //        bestItemContents.Append(itemSKU);
                //        bestItemContents.Append("',");
                //        bestItemContents.Append(1);
                //        bestItemContents.Append(",this);><span><span>");
                //        bestItemContents.Append(getLocale("Add to cart"));
                //        bestItemContents.Append("</span></span></button></div></div>");
                //    }
                //}
                //else
                //{
                //    bestItemContents.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\">");
                //    bestItemContents.Append("<button type=\"button\" id=\"addtoCart\" title=");
                //    bestItemContents.Append(itemName);
                //    bestItemContents.Append(" onclick=LatestItems.AddToCartToJS(");
                //    bestItemContents.Append(item.ItemID);
                //    bestItemContents.Append(",");
                //    bestItemContents.Append(itemPrice);
                //    bestItemContents.Append(",'");
                //    bestItemContents.Append(itemSKU);
                //    bestItemContents.Append("',");
                //    bestItemContents.Append(1);
                //    bestItemContents.Append(",this); ><span><span>");
                //    bestItemContents.Append(getLocale("Add to cart"));
                //    bestItemContents.Append("</span></span></button></div></div>");
                //}
                bestItemContents.Append("</div></div>");
            }
            bestItemContents.Append("</div>");
            ltrBestSellerCarasoul.Text = bestItemContents.ToString();
        }
        else
        {
            bestItemContents.Append("<span class=\"cssClassNotFound\">");
            bestItemContents.Append(getLocale("No item is sold in this store Yet!"));
            bestItemContents.Append("</span></div>");
            ltrBestSellerCarasoul.Text = bestItemContents.ToString();
        }
    }
Пример #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         SageFrameConfig pagebase = new SageFrameConfig();
         IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
         StoreID           = GetStoreID;
         PortalID          = GetPortalID;
         CustomerID        = GetCustomerID;
         UserName          = GetUsername;
         CultureName       = GetCurrentCultureName;
         StoreSettingConfig ssc = new StoreSettingConfig();
         MyAccountURL           = ssc.GetStoreSettingsByKey(StoreSetting.MyAccountURL, StoreID, PortalID, CultureName);
         CategoryMgntPageURL    = ssc.GetStoreSettingsByKey(StoreSetting.CategoryMgntPageURL, StoreID, PortalID, CultureName);
         ItemMgntPageURL        = ssc.GetStoreSettingsByKey(StoreSetting.ItemMgntPageURL, StoreID, PortalID, CultureName);
         ShoppingCartURL        = ssc.GetStoreSettingsByKey(StoreSetting.ShoppingCartURL, StoreID, PortalID, CultureName);
         AllowAddToCart         = ssc.GetStoreSettingsByKey(StoreSetting.ShowAddToCartButton, StoreID, PortalID, CultureName);
         AllowAnonymousCheckOut = ssc.GetStoreSettingsByKey(StoreSetting.AllowAnonymousCheckOut, StoreID, PortalID, CultureName);
         AllowMultipleShipping  = ssc.GetStoreSettingsByKey(StoreSetting.AllowMultipleShippingAddress, StoreID, PortalID, CultureName);
         MinCartSubTotalAmount  = ssc.GetStoreSettingsByKey(StoreSetting.MinimumCartSubTotalAmount, StoreID, PortalID, CultureName);
         SingleAddressChkOutURL = ssc.GetStoreSettingsByKey(StoreSetting.SingleCheckOutURL, StoreID, PortalID, CultureName);
         if (HttpContext.Current.Session.SessionID != null)
         {
             SessionCode = HttpContext.Current.Session.SessionID.ToString();
         }
         if (!IsPostBack)
         {
             IncludeCss("AspxHeaderControl", "/Templates/" + TemplateName + "/css/MessageBox/style.css", "/Templates/" + TemplateName + "/css/PopUp/style.css",
                        "/Modules/AspxCommerce/AspxHeaderControl/css/module.css");
             IncludeJs("AspxHeaderControl", "/js/PopUp/custom.js", "/js/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js", "/Modules/AspxCommerce/AspxHeaderControl/js/HeaderControl.js");
             if (HttpContext.Current.Request.UrlReferrer != null)
             {
                 string urlContent = HttpContext.Current.Request.UrlReferrer.AbsolutePath;
                 if (urlContent.Contains(pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) && UserName.ToLower() != "anonymoususer")
                 {
                     FrmLogin = true;
                     if (HttpContext.Current.Session["LoginMessageInfo"] == null)
                     {
                         HttpContext.Current.Session["LoginMessageInfo"] = true;
                     }
                     int x = Convert.ToInt32(HttpContext.Current.Session["LoginMessageInfoCount"]);
                     HttpContext.Current.Session["LoginMessageInfoCount"] = x + 1;
                 }
                 else if (HttpContext.Current.Session["LoginMessageInfo"] != null)
                 {
                     HttpContext.Current.Session.Remove("LoginMessageInfo");
                     HttpContext.Current.Session.Remove("LoginMessageInfoCount");
                 }
             }
             AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
             aspxCommonObj.StoreID     = StoreID;
             aspxCommonObj.PortalID    = PortalID;
             aspxCommonObj.CultureName = CultureName;
             HeaderType = AspxHeaderController.GetHeaderSetting(aspxCommonObj);
             RolesManagementController  objController = new RolesManagementController();
             List <RolesManagementInfo> objRoles      = objController.GetPortalRoleSelectedList(GetPortalID, GetUsername);
             foreach (RolesManagementInfo role in objRoles)
             {
                 if (role.RoleName == "Publisher")
                 {
                     userRoleBit = 1;
                 }
             }
         }
         IncludeLanguageJS();
         CountWishItems();
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
    private void GetPopularTagRssFeedContent(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;
            PopularTagsController         ptc           = new PopularTagsController();
            List <PopularTagsRssFeedInfo> popularTagRss = ptc.GetRssFeedContens(aspxCommonObj, pageURL, rssOption, PopularTagRssCount);

            if (popularTagRss.Count > 0)
            {
                foreach (PopularTagsRssFeedInfo 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><ul style=list-style-type: none><h2> Taged Items:</h2>";
                    foreach (var tagItemInfo in rssItemData.TagItemInfo)
                    {
                        string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + tagItemInfo.ImagePath;
                        if (tagItemInfo.ImagePath == "")
                        {
                            imagePath = noImageUrl;
                        }
                        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.WriteEndElement();
                }
            }
            else
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", "");
                rssXml.WriteElementString("link", "");
                rssXml.WriteStartElement("description");
                var description = "";
                description = "<div><h2><span>Not any items have been tagged yet!</span></h2></div>";
                rssXml.WriteCData(description);
                rssXml.WriteEndElement();
                rssXml.WriteEndElement();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
            aspxCommonObj.StoreID     = GetStoreID;
            aspxCommonObj.PortalID    = GetPortalID;
            aspxCommonObj.UserName    = GetUsername;
            aspxCommonObj.CultureName = GetCurrentCultureName;
            if (!IsPostBack)
            {
                if (Session["OrderID"] != null)
                {
                    orderID = int.Parse(Session["OrderID"].ToString());
                }

                StoreSettingConfig ssc = new StoreSettingConfig();
                AspxCoreController acc = new AspxCoreController();
                MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetPortalID, GetPortalID, GetCurrentCultureName);

                if (Session["CurrencyCode"] != null && Session["CurrencyCode"] != "")
                {
                    SelectedCurrency = Session["CurrencyCode"].ToString();
                }
                else
                {
                    SelectedCurrency = MainCurrency;
                }
                if (Session["Region"] != null && Session["Region"] != "")
                {
                    Region = Session["Region"].ToString();
                }
                else
                {
                    Region = StoreSetting.GetRegionFromCurrencyCode(SelectedCurrency, GetStoreID, GetPortalID);
                }

                currencyRate = Convert.ToDecimal(acc.GetCurrencyRateOnChange(aspxCommonObj, MainCurrency, SelectedCurrency, Region));



                var sfConfig = new SageFrameConfig();
                _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
                PageExtension      = SageFrameSettingKeys.PageExtension;
                if (_isUseFriendlyUrls)
                {
                    if (!IsParent)
                    {
                        _sageRedirectPath = ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
                        _addressPath      = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/portal/" + GetPortalSEOName + "/";
                    }
                    else
                    {
                        _sageRedirectPath = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
                        _addressPath      = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";
                    }
                }
                else
                {
                    _sageRedirectPath = ResolveUrl("{~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
                }

                var imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress");
                if (imgProgress != null)
                {
                    imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true);
                }
                hlnkHomePage.NavigateUrl = _sageRedirectPath;
                SendEmailFrom            = ssc.GetStoreSettingsByKey(StoreSetting.SendEcommerceEmailsFrom, GetStoreID, GetPortalID, GetCurrentCultureName);
                SendOrderNotice          = ssc.GetStoreSettingsByKey(StoreSetting.SendOrderNotification, GetStoreID, GetPortalID, GetCurrentCultureName);

                SendConfrimMessage();
            }
            IncludeLanguageJS();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Пример #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();
    }
Пример #17
0
    private void BindCategoryItems(CategoryWiseItemInfo item)
    {
        string pageExtension          = SageFrameSettingKeys.PageExtension;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;

        CatWiseItemContains = new StringBuilder();
        string  aspxRootPath = ResolveUrl("~/");
        decimal rate         = 1;

        RowTotal = item.RowTotal;
        StoreSettingConfig ssc            = new StoreSettingConfig();
        decimal            additionalCCVR = decimal.Parse(ssc.GetStoreSettingsByKey(StoreSetting.AdditionalCVR, StoreID, PortalID, CultureName));
        string             MainCurrency   = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, StoreID, PortalID, 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 imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;

        if (item.ImagePath == "")
        {
            imagePath = DefaultImagePath;
        }
        if (item.AlternateText == "")
        {
            item.AlternateText = item.Name;
        }
        string itemPrice     = Math.Round(double.Parse((item.Price).ToString()), 2).ToString();
        string itemPriceRate = Math.Round(double.Parse((item.Price * rate).ToString()), 2).ToString();
        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;
        }
        if (item.ItemRowNum <= noOfItemsInCategory)
        {
            CatWiseItemContains.Append("<div class=\"classItemsList_" + item.CategoryID + "\">");
            CatWiseItemContains.Append("<div class=\"cssClassProductsBox\">");
            var hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(item.SKU) + pageExtension;
            CatWiseItemContains.Append("<div id=\"productImageWrapID_");
            CatWiseItemContains.Append(item.ItemID);
            CatWiseItemContains.Append("\" class=\"cssClassProductsBoxInfo\" costvariantItem=");
            CatWiseItemContains.Append(item.IsCostVariantItem);
            CatWiseItemContains.Append("  itemid=\"");
            CatWiseItemContains.Append(item.ItemID);
            CatWiseItemContains.Append("\"><a href=\"" + hrefItem + "\" title=\"" + item.Name + "\"><h2>");
            CatWiseItemContains.Append(name);
            CatWiseItemContains.Append("</h2><h3>");
            CatWiseItemContains.Append(item.SKU);
            CatWiseItemContains.Append("</h3>");
            CatWiseItemContains.Append("<div id=\"divitemImage\" class=\"cssClassProductPicture\"><a href=\"");
            CatWiseItemContains.Append(hrefItem);
            CatWiseItemContains.Append("\" ><img id=\"");
            CatWiseItemContains.Append(item.ItemID);
            CatWiseItemContains.Append("\"  alt=\"");
            CatWiseItemContains.Append(item.AlternateText);
            CatWiseItemContains.Append("\"  title=\"");
            CatWiseItemContains.Append(item.AlternateText);
            CatWiseItemContains.Append("\" data-original=\"");
            CatWiseItemContains.Append(aspxTemplateFolderPath);
            CatWiseItemContains.Append("/images/loader_100x12.gif\" src=\"");
            CatWiseItemContains.Append(aspxRootPath);
            CatWiseItemContains.Append(imagePath.Replace("uploads", "uploads/Medium"));
            CatWiseItemContains.Append("\"/></a></div>");
            if (item.HidePrice != true)
            {
                if (item.ListPrice != null)
                {
                    string listPrice = Math.Round(double.Parse(item.ListPrice.ToString()), 2).ToString();
                    string strAmount = Math.Round((double)(item.ListPrice * rate), 2).ToString();
                    CatWiseItemContains.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                    CatWiseItemContains.Append("<p class=\"cssClassProductOffPrice\">");
                    //CatWiseItemContains.Append(getLocale("Regular Price :"));
                    CatWiseItemContains.Append("<span class=\"cssClassFormatCurrency\" value=");
                    CatWiseItemContains.Append(listPrice);
                    CatWiseItemContains.Append(">");
                    CatWiseItemContains.Append(strAmount);
                    CatWiseItemContains.Append("</span></p><p class=\"cssClassProductRealPrice \" >");
                    //CatWiseItemContains.Append(getLocale("Our Offer :"));
                    CatWiseItemContains.Append("<span class=\"cssClassFormatCurrency\" value=");
                    CatWiseItemContains.Append(itemPrice);
                    CatWiseItemContains.Append(">");
                    CatWiseItemContains.Append(itemPriceRate);
                    CatWiseItemContains.Append("</span></p></div></div>");
                }
                else
                {
                    CatWiseItemContains.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                    CatWiseItemContains.Append("<p class=\"cssClassProductRealPrice \" >");
                    //CatWiseItemContains.Append(getLocale("Our Offer :"));
                    CatWiseItemContains.Append("<span class=\"cssClassFormatCurrency\" value=");
                    CatWiseItemContains.Append(itemPrice);
                    CatWiseItemContains.Append(">");
                    CatWiseItemContains.Append(itemPriceRate);
                    CatWiseItemContains.Append("</span></p></div></div>");
                }
            }
            CatWiseItemContains.Append("<div class=\"cssClassProductDetail\"><p><a href=\"");
            CatWiseItemContains.Append(aspxRedirectPath);
            CatWiseItemContains.Append("item/");
            CatWiseItemContains.Append(item.SKU);
            CatWiseItemContains.Append(pageExtension);
            CatWiseItemContains.Append("\">");
            CatWiseItemContains.Append(getLocale("Details"));
            CatWiseItemContains.Append("</a></p></div>");
            CatWiseItemContains.Append("</div>");
            CatWiseItemContains.Append("<div class=\"sfButtonwrapper\">");
            if (AllowWishListLatestItem.ToLower() == "true")
            {
                if (GetCustomerID > 0 && GetUsername.ToLower() != "anonymoususer")
                {
                    CatWiseItemContains.Append("<div class=\"cssClassWishListButton\">");
                    CatWiseItemContains.Append("<button type=\"button\" id=\"addWishList\" onclick=categoryWiseItemList.CheckWishListUniqueness(");
                    CatWiseItemContains.Append(item.ItemID);
                    CatWiseItemContains.Append(",'");
                    CatWiseItemContains.Append(item.SKU);
                    CatWiseItemContains.Append("',this);><span><span><span>+</span>");
                    CatWiseItemContains.Append(getLocale("Wishlist"));
                    CatWiseItemContains.Append("</span></span></button></div>");
                }
                else
                {
                    CatWiseItemContains.Append("<div class=\"cssClassWishListButton\">");
                    CatWiseItemContains.Append(
                        "<button type=\"button\" id=\"addWishList\" onclick=\"AspxCommerce.RootFunction.Login();\">");
                    CatWiseItemContains.Append("<span><span><span>+</span>");
                    CatWiseItemContains.Append(getLocale("Wishlist"));
                    CatWiseItemContains.Append("</span></span></button></div>");
                }
            }
            if (AllowAddToCompareLatest.ToLower() == "true")
            {
                CatWiseItemContains.Append("<div class=\"cssClassCompareButton\">");
                CatWiseItemContains.Append("<input type=\"checkbox\" id=\"compare-");
                CatWiseItemContains.Append(item.ItemID);
                CatWiseItemContains.Append("\" onclick=categoryWiseItemList.AddItemsToCompare(");
                CatWiseItemContains.Append(item.ItemID);
                CatWiseItemContains.Append(",'");
                CatWiseItemContains.Append(item.SKU);
                CatWiseItemContains.Append("',this);><span>");
                CatWiseItemContains.Append(getLocale("Compare"));
                CatWiseItemContains.Append("</span></input></div>");
            }
            CatWiseItemContains.Append("</div>");
            CatWiseItemContains.Append("<div class=\"cssClassclear\">");
            string itemSKU  = item.SKU;
            string itemName = item.Name;
            if (AllowOutStockPurchase.ToLower() == "false")
            {
                if (item.IsOutOfStock == true)
                {
                    CatWiseItemContains.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper cssClassOutOfStock\">");
                    CatWiseItemContains.Append("<button type=\"button\"><span>");
                    CatWiseItemContains.Append(getLocale("Out Of Stock"));
                    CatWiseItemContains.Append("</span></button></div></div>");
                }
                else
                {
                    // CatWiseItemContains += "</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\"><a href=\"#\" title=" + itemName + "  onclick='categoryWiseItemList.AddToCartToJS(" + item.ItemID + "," + item.Price.toFixed(2) + "," + itemSKU + "," + 1 + ");'><span>Add to cart</span></a></div></div>";
                    CatWiseItemContains.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\">");
                    CatWiseItemContains.Append("<button type=\"button\" id=\"addtoCart\" title=");
                    CatWiseItemContains.Append(itemName);
                    CatWiseItemContains.Append(" onclick=categoryWiseItemList.AddToCartToJS(");
                    CatWiseItemContains.Append(item.ItemID);
                    CatWiseItemContains.Append(",");
                    CatWiseItemContains.Append(itemPrice);
                    CatWiseItemContains.Append(",'");
                    CatWiseItemContains.Append(itemSKU);
                    CatWiseItemContains.Append("',");
                    CatWiseItemContains.Append(1);
                    CatWiseItemContains.Append(",this);><span><span>");
                    CatWiseItemContains.Append(getLocale("Add to cart"));
                    CatWiseItemContains.Append("</span></span></button></div></div>");
                }
            }
            else
            {
                CatWiseItemContains.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\">");
                CatWiseItemContains.Append("<button type=\"button\" id=\"addtoCart\" title=");
                CatWiseItemContains.Append(itemName);
                CatWiseItemContains.Append(" onclick=categoryWiseItemList.AddToCartToJS(");
                CatWiseItemContains.Append(item.ItemID);
                CatWiseItemContains.Append(",");
                CatWiseItemContains.Append(itemPrice);
                CatWiseItemContains.Append(",'");
                CatWiseItemContains.Append(itemSKU);
                CatWiseItemContains.Append("',");
                CatWiseItemContains.Append(1);
                CatWiseItemContains.Append(",this); ><span><span>");
                CatWiseItemContains.Append(getLocale("Add to cart"));
                CatWiseItemContains.Append("</span></span></button></div></div>");
            }
            CatWiseItemContains.Append("</div></div>");
        }
        else
        {
            string viewMore = "<a href=\"" + aspxRedirectPath + "category/" + fixedEncodeURIComponent(item.CategoryName) +
                              pageExtension + "\">" + getLocale("View More") + "</a>";
            CatWiseItemContains.Append("<div id=\"divViewMore_" + item.CategoryID + "\" class=\"cssViewMore\">");
            CatWiseItemContains.Append(viewMore);
            CatWiseItemContains.Append("</div>");
        }
    }
Пример #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            if (Membership.GetUser() != null)
            {
                IncludeCss("WishItemList", "/Templates/" + TemplateName + "/css/MessageBox/style.css", "/Templates/" + TemplateName + "/css/PopUp/style.css");
                IncludeJs("WishItemList", "/js/DateTime/date.js", "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js", "/js/PopUp/custom.js", "/js/FormValidation/jquery.validate.js");
                //SageFrameConfig pagebase = new SageFrameConfig();
                //IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
                StoreID     = GetStoreID;
                PortalID    = GetPortalID;
                UserName    = GetUsername;
                CustomerID  = GetCustomerID;
                CultureName = GetCurrentCultureName;
                if (!IsPostBack)
                {
                    MembershipUser userDetail = Membership.GetUser(GetUsername);
                    UserEmailWishList = userDetail.Email;
                }
                if (HttpContext.Current.Session.SessionID != null)
                {
                    SessionCode = HttpContext.Current.Session.SessionID.ToString();
                }

                UserIp = HttpContext.Current.Request.UserHostAddress;
                IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();
                ipToCountry.GetCountry(UserIp, out CountryName);

                StoreSettingConfig ssc = new StoreSettingConfig();
                NoImageWishList       = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName);
                EnableWishList        = ssc.GetStoreSettingsByKey(StoreSetting.EnableWishList, StoreID, PortalID, CultureName);
                ShowImageInWishlist   = ssc.GetStoreSettingsByKey(StoreSetting.ShowItemImagesInWishList, StoreID, PortalID, CultureName);
                AllowOutStockPurchase = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, StoreID, PortalID, CultureName);
            }
            else
            {
                if (IsUseFriendlyUrls)
                {
                    if (GetPortalID > 1)
                    {
                        Response.Redirect(ResolveUrl("~/portal/" + GetPortalSEOName + "/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + ".aspx?ReturnUrl=" + Request.Url.ToString(), false);
                    }
                    else
                    {
                        Response.Redirect(ResolveUrl("~/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + ".aspx?ReturnUrl=" + Request.Url.ToString(), false);
                    }
                }

                else
                {
                    Response.Redirect(ResolveUrl("~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)) + "?ReturnUrl=" + Request.Url.ToString(), false);
                }
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Пример #19
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();
    }
Пример #20
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();
    }
Пример #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             IncludeCss("LatestItems", "/Templates/" + TemplateName + "/css/MessageBox/style.css", "/Templates/" + TemplateName + "/css/ImageGallery/styles.css",
                        "/Templates/" + TemplateName + "/css/PopUp/style.css",
                        "/Templates/" + TemplateName + "/css/MessageBox/style.css",
                        "/Templates/" + TemplateName + "/css/FancyDropDown/fancy.css",
                        "/Templates/" + TemplateName + "/css/ToolTip/tooltip.css", "/Templates/" + TemplateName + "/css/PopUp/popbox.css",
                        "/Modules/AspxCommerce/AspxLatestItems/css/module.css");
             IncludeJs("LatestItems", "/js/DateTime/date.js", "/js/jquery.easing.1.3.js", "/Modules/AspxCommerce/AspxLatestItems/js/LatestItems.js"
                       , "/js/jquery.tipsy.js", "/js/ImageGallery/jquery.pikachoose.js", "/js/ImageGallery/jquery.jcarousel.js", "/js/ImageGallery/jquery.mousewheel.js",
                       "/js/jDownload/jquery.jdownload.js", "/js/MessageBox/alertbox.js", "/js/PopUp/custom.js", "/js/PopUp/popbox.js");
             StoreID      = GetStoreID;
             PortalID     = GetPortalID;
             CustomerID   = GetCustomerID;
             UserName     = GetUsername;
             CultureName  = GetCurrentCultureName;
             aspxfilePath = ResolveUrl("~") + "Modules/AspxCommerce/AspxItemsManagement/";
             if (HttpContext.Current.Session.SessionID != null)
             {
                 SessionCode = HttpContext.Current.Session.SessionID.ToString();
             }
             if (HttpContext.Current.Session.SessionID != null)
             {
                 SessionCode = HttpContext.Current.Session.SessionID.ToString();
             }
             if (SageUserModuleID != "")
             {
                 UserModuleID = int.Parse(SageUserModuleID);
             }
             else
             {
                 UserModuleID = 0;
             }
             AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
             aspxCommonObj.StoreID     = StoreID;
             aspxCommonObj.PortalID    = PortalID;
             aspxCommonObj.UserName    = UserName;
             aspxCommonObj.CultureName = CultureName;
             UserIp = HttpContext.Current.Request.UserHostAddress;
             IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();
             ipToCountry.GetCountry(UserIp, out CountryName);
             StoreSettingConfig ssc = new StoreSettingConfig();
             DefaultImagePath      = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName);
             AllowAddToCart        = ssc.GetStoreSettingsByKey(StoreSetting.ShowAddToCartButton, StoreID, PortalID, CultureName);
             AllowOutStockPurchase = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, StoreID, PortalID, CultureName);
             LatestItemModPath     = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
             GetLatestItemSetting();
         }
         IncludeLanguageJS();
         if (EnableLatestItems && NoOfLatestItems > 0)
         {
             GetLatestItemsByCount();
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
Пример #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string selectedCurrency = string.Empty;
        string MainCurrency     = string.Empty;

        try
        {
            StoreSettingConfig ssc = new StoreSettingConfig();
            MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);
            if (Session["SelectedCurrency"] != null && Session["SelectedCurrency"] != "")
            {
                selectedCurrency = Session["SelectedCurrency"].ToString();
            }
            else
            {
                selectedCurrency = MainCurrency;
            }

            string       islive     = Request.Form["custom"];
            string       test       = string.Empty;
            const string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr";
            const string strLive    = "https://www.paypal.com/cgi-bin/webscr";
            test = bool.Parse(islive.Split('#')[6]) ? strSandbox : strLive;

            var req = (HttpWebRequest)WebRequest.Create(test);
            //Set values for the request back
            req.Method      = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            byte[] param      = Request.BinaryRead(HttpContext.Current.Request.ContentLength);
            string strRequest = Encoding.ASCII.GetString(param);
            strRequest       += "&cmd=_notify-validate";
            req.ContentLength = strRequest.Length;
            //for proxy
            //WebProxy proxy = new WebProxy(new Uri("http://url:port#"));
            //req.Proxy = proxy;
            //Send the request to PayPal and get the response
            var streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
            streamOut.Write(strRequest);
            streamOut.Close();
            var    streamIn    = new StreamReader(req.GetResponse().GetResponseStream());
            string strResponse = streamIn.ReadToEnd();
            streamIn.Close();
            //string appPath = Request.PhysicalApplicationPath;
            //string filePath = appPath + "IPN.txt";
            //StreamWriter w;
            //w = File.CreateText(filePath);
            //w.WriteLine("This is a test line.");
            //w.WriteLine(islive.Split('#')[6] + "," + islive.Split('#')[1]);
            //w.Flush();
            //w.Close();
            if (strResponse == "VERIFIED")
            {
                string payerEmail     = Request.Form["payer_email"];
                string paymentStatus  = Request.Form["payment_status"];
                string receiverEmail  = Request.Form["receiver_email"];
                string amount         = Request.Form["mc_gross"];
                string invoice        = Request.Form["invoice"];
                string addressName    = Request.Form["address_name"];
                string addressStreet  = Request.Form["address_street"];
                string addressCity    = Request.Form["address_city"];
                string addressZip     = Request.Form["address_zip"];
                string addressCountry = Request.Form["address_country"];
                string transID        = Request.Form["txn_id"];
                string custom         = Request.Form["custom"];

                string[] ids         = custom.Split('#');
                int      orderID     = int.Parse(ids[0]);
                int      storeID     = int.Parse(ids[1]);
                int      portalID    = int.Parse(ids[2]);
                string   userName    = ids[3];
                int      customerID  = int.Parse(ids[4]);
                string   sessionCode = ids[5];
                string   pgid        = ids[7];

                var tinfo = new TransactionLogInfo();
                var tlog  = new TransactionLog();

                tinfo.TransactionID      = transID;
                tinfo.AuthCode           = "";
                tinfo.TotalAmount        = decimal.Parse(amount);
                tinfo.ResponseCode       = "1";
                tinfo.ResponseReasonText = "";
                tinfo.OrderID            = orderID;
                tinfo.StoreID            = storeID;
                tinfo.PortalID           = portalID;
                tinfo.AddedBy            = userName;
                tinfo.CustomerID         = customerID;
                tinfo.SessionCode        = sessionCode;
                tinfo.PaymentGatewayID   = int.Parse(pgid);
                tinfo.PaymentStatus      = paymentStatus;
                tinfo.PayerEmail         = payerEmail;
                tinfo.CreditCard         = "";
                tinfo.RecieverEmail      = receiverEmail;
                tinfo.CurrencyCode       = selectedCurrency;
                tlog.SaveTransactionLog(tinfo);


                if (paymentStatus.Equals("Completed"))
                {
                    //string appPath = Request.PhysicalApplicationPath;
                    //string filePath = appPath + "IPN.txt";
                    //StreamWriter w;
                    //w = File.CreateText(filePath);
                    //w.WriteLine("This is a test line.");
                    //w.WriteLine(payerEmail + " " + paymentStatus + " " + amount);
                    //w.WriteLine("This 2nd.");
                    //w.Flush();
                    //w.Close();
                    var paypalobj = new PayPalHandler();
                    paypalobj.ParseIPN(orderID, transID, paymentStatus, storeID, portalID, userName, customerID, sessionCode);
                    // PayPalHandler.UpdateItemQuantity(itemReduce, coupon, storeID, portalID, userName);
                }
            }
            else if (strResponse == "INVALID")
            {
                //log for manual investigation
            }
            else
            {
                //log response/ipn data for manual investigation
            }
            // }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
            //  throw new Exception("This Page is not accessible!");
        }
    }
Пример #23
0
        private void SendEmailForSharedWishList(AspxCommonInfo aspxCommonObj, WishItemsEmailInfo wishlistObj)
        {
            string serverHostLoc = "http://" + HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";
            string tdContent     = string.Empty;
            var    dataObj       = JSONHelper.Deserialise <List <WishItemEmailInfo> >(wishlistObj.MessageBody);
            int    length        = dataObj.Count();

            string[] tdContentArray    = new string[length];
            string   shareWishMailHtml = "";

            shareWishMailHtml += "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>";
            shareWishMailHtml += "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>";
            for (int i = 0; i <= length - 1; i++)
            {
                tdContent +=
                    "<td width='33%'><div style='border:1px solid #cfcfcf; background:#f1f1f1; padding:10px; text-align:center;'> <img src='" +
                    serverHostLoc + dataObj[i].src + "' alt='" + dataObj[i].alt + "' width='80' height='50' />";
                tdContent +=
                    "<p style='margin:0; padding:5px 0 0 0; font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:normal; line-height:18px;'>";
                tdContent +=
                    "<span style='font-weight:bold; font-size:12px; font-family:Arial, Helvetica, sans-serif; text-shadow:1px 1px 0 #fff;'>" +
                    dataObj[i].title + "</span><br />"; //item name
                tdContent +=
                    "<span style='font-weight:bold; font-size:12px; font-family:Arial, Helvetica, sans-serif; text-shadow:1px 1px 0 #fff;'> <a href='" +
                    serverHostLoc + dataObj[i].href + "'>" + dataObj[i].hrefHtml + "</a></span><br />"; //item name
                tdContent +=
                    "<span style='font-weight:bold; font-size:11px; font-family:Arial, Helvetica, sans-serif; text-shadow:1px 1px 0 #fff;'>Price:</span>" +
                    dataObj[i].price + "<br />"; //price
                tdContent +=
                    "<span style='font-weight:bold; font-size:12px; font-family:Arial, Helvetica, sans-serif; text-shadow:1px 1px 0 #fff;'>Comments:</span> " +
                    dataObj[i].htmlComment + "</p></div></td>"; //comment
                tdContentArray[i] = tdContent;
                tdContent         = "";
            }
            for (int j = 0; j <= length - 1; j++)
            {
                if (j % 3 == 0)
                {
                    shareWishMailHtml += "</tr><tr>" + tdContentArray[j];
                }
                else
                {
                    shareWishMailHtml += tdContentArray[j];
                }
            }
            shareWishMailHtml += "</tr></table></td></tr></table>";
            StoreSettingConfig ssc     = new StoreSettingConfig();
            string             logosrc = ssc.GetStoreSettingsByKey(StoreSetting.StoreLogoURL, aspxCommonObj.StoreID,
                                                                   aspxCommonObj.PortalID, aspxCommonObj.CultureName);
            List <MessageManagementInfo> template =
                MessageManagementController.GetMessageTemplateByMessageTemplateTypeID(
                    SystemSetting.SHARED_WISHED_LIST, aspxCommonObj.PortalID);

            foreach (MessageManagementInfo messageToken in template)
            {
                string messageTemplate = messageToken.Body.ToString();
                string src             = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";
                if (template != null)
                {
                    string[] tokens = GetAllToken(messageTemplate);
                    foreach (string token in tokens)
                    {
                        switch (token)
                        {
                        case "%DateTime%":
                            messageTemplate = messageTemplate.Replace(token,
                                                                      System.DateTime.Now.ToString("MM/dd/yyyy"));
                            break;

                        case "%Username%":
                            messageTemplate = messageTemplate.Replace(token, wishlistObj.SenderName);
                            break;

                        case "%UserEmail%":
                            messageTemplate = messageTemplate.Replace(token, wishlistObj.SenderEmail);
                            break;

                        case "%MessageDetails%":
                            messageTemplate = messageTemplate.Replace(token, wishlistObj.Message);
                            break;

                        case "%ItemDetailsTable%":
                            messageTemplate = messageTemplate.Replace(token, shareWishMailHtml);
                            break;

                        case "%LogoSource%":
                            string imgSrc = "http://" + src + logosrc;
                            messageTemplate = messageTemplate.Replace(token, imgSrc);
                            break;

                        case "%ServerPath%":
                            messageTemplate = messageTemplate.Replace(token, "http://" + src);
                            break;

                        case "%DateYear%":
                            messageTemplate = messageTemplate.Replace(token, System.DateTime.Now.Year.ToString());
                            break;
                        }
                    }
                }

                char[]   spliter     = { ',' };
                string[] receiverIDs = wishlistObj.ReceiverEmail.Split(spliter);

                for (int i = 0; i < receiverIDs.Length; i++)
                {
                    string          receiverEmailID = receiverIDs[i];
                    string          emailSuperAdmin;
                    string          emailSiteAdmin;
                    SageFrameConfig pagebase = new SageFrameConfig();
                    emailSuperAdmin = pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserEmail);
                    emailSiteAdmin  = pagebase.GetSettingsByKey(SageFrameSettingKeys.SiteAdminEmailAddress);
                    MailHelper.SendMailNoAttachment(wishlistObj.SenderEmail, receiverEmailID, wishlistObj.Subject,
                                                    messageTemplate,
                                                    emailSiteAdmin, emailSuperAdmin);
                }
            }
        }
Пример #24
0
    public void LoadGlobalVariables()
    {
        Page.ClientScript.RegisterClientScriptInclude("AspxCommereCore", ResolveUrl("~/js/SageFrameCorejs/aspxcommercecore.js"));
        Page.ClientScript.RegisterClientScriptInclude("Session", ResolveUrl("~/js/Session.js"));
        IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
        PageExtension     = SageFrameSettingKeys.PageExtension;
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalServicePath", " var aspxservicePath='" + ResolveUrl("~/") + "Modules/AspxCommerce/AspxCommerceServices/" + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRootPath", " var aspxRootPath='" + ResolveUrl("~/") + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalTemplateFolderPath", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "pageExtension", " var pageExtension='" + PageExtension + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "storeID", " var storeID='" + GetStoreID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "portalID", " var portalID='" + GetPortalID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "culturename", " var cultureName='" + GetCurrentCultureName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "templatename", " var templateName='" + TemplateName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "customerid", " var customerID='" + GetCustomerID + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "username", " var userName='******';", true);
        //  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "noimagepath", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
        //  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "defaultlogourl", " var aspxTemplateFolderPath='" + ResolveUrl("~/") + "Templates/" + TemplateName + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "isfriendlyurl", " var IsUseFriendlyUrls='" + IsUseFriendlyUrls + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "sessioncode", " var sessionCode='" + HttpContext.Current.Session.SessionID.ToString() + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientIPAddress", " var clientIPAddress='" + HttpContext.Current.Request.UserHostAddress + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "LoginURL", " var LoginURL='" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage) + "';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "itemImagePath", " var itemImagePath='Modules/AspxCommerce/AspxItemsManagement/uploads/';", true);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "categoryImagePath", " var categoryImagePath='Modules/AspxCommerce/AspxCategoryManagement/uploads/';", true);
        string userIP      = HttpContext.Current.Request.UserHostAddress;
        string countryName = "";
        IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();

        ipToCountry.GetCountry(userIP, out countryName);
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientCountry", " var aspxCountryName='" + countryName + "';", true);
        StoreSettingConfig ssc          = new StoreSettingConfig();
        string             currencyCode = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);

        if (currencyCode != null)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "region",
                                                    " var region='" +
                                                    StoreSetting.GetRegionFromCurrencyCode(currencyCode, GetStoreID,
                                                                                           GetPortalID) + "';", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "curSymbol",
                                                    " var curSymbol='" +
                                                    StoreSetting.GetSymbolFromCurrencyCode(currencyCode, GetStoreID,
                                                                                           GetPortalID) + "';", true);
        }
        if (IsUseFriendlyUrls)
        {
            if (GetPortalID > 1)
            {
                sageRedirectPath = ResolveUrl("~/portal/" + GetPortalSEOName + "/");
                sageNavigateUrl  = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
            }
            else
            {
                sageRedirectPath = ResolveUrl("~/");
                sageNavigateUrl  = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
            }
        }
        else
        {
            sageRedirectPath = ResolveUrl("{~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=");
            sageNavigateUrl  = ResolveUrl("~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
        }
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "globalRedirectPath", " var aspxRedirectPath='" + sageRedirectPath + "';", true);
    }
    public void BindWishListItem()
    {
        decimal        rate          = 1;
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        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 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; //get value from drop down
        int offset = 1;
        int sortBy = 1; // get value from drop down
        List <WishItemsInfo> lstWishList       = AspxWishItemController.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(
                "<td class=\"cssClassWishItemChkbox\"> <input type=\"checkbox\" id=\"chkHeading\"/></td>");
            wishListStringBld.Append(
                "<td class=\"cssClassWishItemDetails\"><label id=\"lblItem\" class=\"sfLocale\">Item</label></td>");
            wishListStringBld.Append(
                "<td class=\"row-variants\"><label id=\"lblVariant\" class=\"sfLocale\">Variants</label></td>");
            wishListStringBld.Append(
                "<td class=\"cssClassWishListComment\"><label id=\"lblComment\" class=\"sfLocale\">Comment</label></td>");
            wishListStringBld.Append(
                "<td class=\"cssClassAddedOn\"><label id=\"lblAddedOn\" class=\"sfLocale\">Added On</label></td>");
            wishListStringBld.Append(
                "<td class=\"cssClassAddToCart\"><label id=\"lblAddToCart\" class=\"sfLocale\">Add To Cart</label></td>");
            wishListStringBld.Append("<td class=\"cssClassDelete\"></td>");
            wishListStringBld.Append("</tr></thead>");
            wishListStringBld.Append("<tbody>");
            ArrayLength = lstWishList.Count;
            foreach (var response in lstWishList)
            {
                // ArrItemListType.Add(response.ItemID);

                RowTotal = response.RowTotal;
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + response.ImagePath;
                if (response.ImagePath == "")
                {
                    imagePath = NoImageWishList;
                }
                else if (response.AlternateText == "")
                {
                    response.AlternateText = response.ItemName;
                }
                JavaScriptSerializer ser = new JavaScriptSerializer();
                string WishDate          = (Convert.ToDateTime(response.WishDate)).ToShortDateString();
                //WishList.DateDeserialize(response.WishDate, "yyyy/M/d");
                var itemSKU    = ser.Serialize(response.SKU); //JSON2.stringify(response.SKU);
                var cosVaraint = ser.Serialize(response.CostVariantValueIDs);
                //JSON2.stringify(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 + "";
                }
                if (lstWishList.IndexOf(response) % 2 == 0)
                {
                    if (AllowOutStockPurchase.ToLower() == "false")
                    {
                        if (response.IsOutOfStock != null && (bool)response.IsOutOfStock)
                        {
                            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>");
                            wishListStringBld.Append("<td class=\"cssClassWishItemDetails\">");
                            wishListStringBld.Append("<div class=\"cssClassImage\">");
                            wishListStringBld.Append("<img src=\"" + aspxRootPath +
                                                     imagePath.Replace("uploads", "uploads/Small") +
                                                     "\" alt=\"" + response.AlternateText + "\" title=\"" +
                                                     response.AlternateText + "\"/>");
                            wishListStringBld.Append("</div>");
                            wishListStringBld.Append("<a href=\"" + href + "\">" + response.ItemName + "</a></br>");
                            wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                     Math.Round(decimal.Parse(response.Price) * rate, 2) + "</span></td>");
                            wishListStringBld.Append(
                                "<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=" + cosVaraint + "/>");
                            wishListStringBld.Append("<span>" + response.ItemCostVariantValue + "</span></td>");
                            wishListStringBld.Append("<td class=\"cssClassWishComment\">");
                            wishListStringBld.Append("<textarea maxlength=\"300\" onkeyup=\"" +
                                                     "WishList.ismaxlength(this)" + "\" id=\"comment_" +
                                                     response.WishItemID + "\" class=\"comment\">" + response.Comment +
                                                     "</textarea></td>");
                            wishListStringBld.Append("<td class=\"cssClassWishDate\">" + WishDate + "</td>");
                            wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                            wishListStringBld.Append("<div class=\"sfButtonwrapper cssClassOutOfStock\">");
                            wishListStringBld.Append("<a href=\"#\"><span>" + getLocale("Out Of Stock") +
                                                     "</span></a></div></td>");
                            wishListStringBld.Append("<td class=\"cssClassDelete\">");
                            wishListStringBld.Append("<img onclick=\"WishList.DeleteWishListItem(" + response.WishItemID +
                                                     ")\" src=\"" + aspxTemplateFolderPath +
                                                     "/images/admin/btndelete.png\"/>");
                            wishListStringBld.Append("</td></tr>");
                        }
                        else
                        {
                            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>");
                            wishListStringBld.Append("<td class=\"cssClassWishItemDetails\">");
                            wishListStringBld.Append("<div class=\"cssClassImage\">");
                            wishListStringBld.Append("<img src=\"" + aspxRootPath +
                                                     imagePath.Replace("uploads", "uploads/Small") +
                                                     "\" alt=\"" + response.AlternateText + "\" title=\"" +
                                                     response.AlternateText + "\"/>");
                            wishListStringBld.Append("</div>");
                            wishListStringBld.Append("<a href=\"" + href + "\">" + response.ItemName + "</a></br>");
                            wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                     Math.Round(decimal.Parse(response.Price) * rate, 2) + "</span></td>");
                            wishListStringBld.Append(
                                "<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=" + cosVaraint + "/>");
                            wishListStringBld.Append("<span>" + response.ItemCostVariantValue + "</span></td>");
                            wishListStringBld.Append("<td class=\"cssClassWishComment\">");
                            wishListStringBld.Append("<textarea maxlength=\"300\" onkeyup=\"" +
                                                     "WishList.ismaxlength(this)" + "\" id=\"comment_" +
                                                     response.WishItemID + "\" class=\"comment\">" + response.Comment +
                                                     "</textarea></td>");
                            wishListStringBld.Append("<td class=\"cssClassWishDate\">" + WishDate + "</td>");
                            wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                            wishListStringBld.Append("<div class=\"sfButtonwrapper\">");
                            wishListStringBld.Append("<a href=\"" + cartUrl + "\" onclick=WishList.AddToCartToJS(" +
                                                     response.ItemID + "," + response.Price + "," + itemSKU + "," + 1 +
                                                     ");><span>" + getLocale("Add To Cart") +
                                                     "</span></a></div></td>");
                            wishListStringBld.Append("<td class=\"cssClassDelete\">");
                            wishListStringBld.Append("<img onclick=\"WishList.DeleteWishListItem(" + response.WishItemID +
                                                     ")\" src=\"" + aspxTemplateFolderPath +
                                                     "/images/admin/btndelete.png\"/>");
                            wishListStringBld.Append("</td></tr>");
                        }
                    }
                    else
                    {
                        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>");
                        wishListStringBld.Append("<td class=\"cssClassWishItemDetails\">");
                        wishListStringBld.Append("<div class=\"cssClassImage\">");
                        wishListStringBld.Append("<img src=\"" + aspxRootPath +
                                                 imagePath.Replace("uploads", "uploads/Small") + "\" alt=\"" +
                                                 response.AlternateText + "\" title=\"" + response.AlternateText +
                                                 "\"/>");
                        wishListStringBld.Append("</div>>");
                        wishListStringBld.Append("<a href=\"" + href + "\">" + response.ItemName + "</a><br>");
                        wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                 Math.Round(decimal.Parse(response.Price) * rate, 2) + "</span></td>");
                        wishListStringBld.Append("<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=" +
                                                 cosVaraint + "/>");
                        wishListStringBld.Append("<span>" + response.ItemCostVariantValue + "</span></td>");
                        wishListStringBld.Append("<td class=\"cssClassWishComment\">");
                        wishListStringBld.Append("<textarea maxlength=\"300\" onkeyup=\"" + "WishList.ismaxlength(this)" +
                                                 "\" id=\"comment_" + response.WishItemID + "\" class=\"comment\">" +
                                                 response.Comment + "</textarea></td>");
                        wishListStringBld.Append("<td class=\"cssClassWishDate\">" + WishDate + "</td>");
                        wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                        wishListStringBld.Append("<div class=\"sfButtonwrapper\">");
                        wishListStringBld.Append("<a href=" + cartUrl + " onclick=WishList.AddToCartToJS(" +
                                                 response.ItemID + "," + response.Price + "," + itemSKU + "," + 1 +
                                                 ");><span>" + getLocale("Add To Cart") + "</span></a></div></td>");
                        wishListStringBld.Append("<td class=\"cssClassDelete\">");
                        wishListStringBld.Append("<img onclick=\"WishList.DeleteWishListItem(" + response.WishItemID +
                                                 ")\" src=\"" + aspxTemplateFolderPath +
                                                 "/images/admin/btndelete.png\"/>");
                        wishListStringBld.Append("</td></tr>");
                    }
                }
                else
                {
                    if (AllowOutStockPurchase.ToLower() == "false")
                    {
                        if (response.IsOutOfStock != null && (bool)response.IsOutOfStock)
                        {
                            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>");
                            wishListStringBld.Append("<td class=\"cssClassWishItemDetails\">");
                            wishListStringBld.Append("<div class=\"cssClassImage\">");
                            wishListStringBld.Append("<img src=\"" + aspxRootPath +
                                                     imagePath.Replace("uploads", "uploads/Small") +
                                                     "\" alt=\"" + response.AlternateText + "\" title=\"" +
                                                     response.AlternateText + "\"/>");
                            wishListStringBld.Append("</div>");
                            wishListStringBld.Append("<a href=\"" + href + "\">" + response.ItemName + "</a></br>");
                            wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                     Math.Round(decimal.Parse(response.Price) * rate, 2) + "</span></td>");
                            wishListStringBld.Append(
                                "<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=" + cosVaraint + "/>");
                            wishListStringBld.Append("<span>" + response.ItemCostVariantValue + "</span></td>");
                            wishListStringBld.Append("<td class=\"cssClassWishComment\">");
                            wishListStringBld.Append("<textarea maxlength=\"300\" onkeyup=\"" +
                                                     "WishList.ismaxlength(this)" + "\" id=\"comment_" +
                                                     response.WishItemID + "\" class=\"comment\">" + response.Comment +
                                                     "</textarea></td>");
                            wishListStringBld.Append("<td class=\"cssClassWishDate\">" + WishDate + "</td>");
                            wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                            wishListStringBld.Append("<div class=\"sfButtonwrapper cssClassOutOfStock\">");
                            wishListStringBld.Append("<a href=\"#\"><span>" + getLocale("Out Of Stock") +
                                                     "</span></a></div></td>");
                            wishListStringBld.Append("<td class=\"cssClassDelete\">");
                            wishListStringBld.Append("<img onclick=\"WishList.DeleteWishListItem(" + response.WishItemID +
                                                     ")\" src=\"" + aspxTemplateFolderPath +
                                                     "/images/admin/btndelete.png\"/>");
                            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>");
                            wishListStringBld.Append("<td class=\"cssClassWishItemDetails\">");
                            wishListStringBld.Append("<div class=\"cssClassImage\">");
                            wishListStringBld.Append("<img src=\"" + aspxRootPath +
                                                     imagePath.Replace("uploads", "uploads/Small") +
                                                     "\" alt=\"" + response.AlternateText + "\" title=\"" +
                                                     response.AlternateText + "\"/>");
                            wishListStringBld.Append("</div>");
                            wishListStringBld.Append("<a href=\"" + href + "\">" + response.ItemName + "</a></br>");
                            wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                     Math.Round(decimal.Parse(response.Price) * rate, 2) + "</span></td>");
                            wishListStringBld.Append(
                                "<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=" + cosVaraint + "/>");
                            wishListStringBld.Append("<span>" + response.ItemCostVariantValue + "</span></td>");
                            wishListStringBld.Append("<td class=\"cssClassWishComment\">");
                            wishListStringBld.Append("<textarea maxlength=\"300\" onkeyup=\"" +
                                                     "WishList.ismaxlength(this)" + "\" id=\"comment_" +
                                                     response.WishItemID + "\" class=\"comment\">" + response.Comment +
                                                     "</textarea></td>");
                            wishListStringBld.Append("<td class=\"cssClassWishDate\">" + WishDate + "</td>");
                            wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                            wishListStringBld.Append("<div class=\"sfButtonwrapper\">");
                            wishListStringBld.Append("<a href=" + cartUrl + " onclick=WishList.AddToCartToJS(" +
                                                     response.ItemID + "," + response.Price + "," + itemSKU + "," + 1 +
                                                     ");><span>" + getLocale("Add To Cart") +
                                                     "</span></a></div></td>");
                            wishListStringBld.Append("<td class=\"cssClassDelete\">");
                            wishListStringBld.Append("<img onclick=\"WishList.DeleteWishListItem(" + response.WishItemID +
                                                     ")\" src=\"" + aspxTemplateFolderPath +
                                                     "/images/admin/btndelete.png\"/>");
                            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>");
                        wishListStringBld.Append("<td class=\"cssClassWishItemDetails\">");
                        wishListStringBld.Append("<div class=\"cssClassImage\">");
                        wishListStringBld.Append("<img src=\"" + aspxRootPath +
                                                 imagePath.Replace("uploads", "uploads/Small") + "\" alt=\"" +
                                                 response.AlternateText + "\" title=\"" + response.AlternateText +
                                                 "\"/>");
                        wishListStringBld.Append("</div>");
                        wishListStringBld.Append("<a href=\"" + href + "\">" + response.ItemName + "</a></br>");
                        wishListStringBld.Append("<span class=\"cssClassPrice cssClassFormatCurrency\">" +
                                                 Math.Round(decimal.Parse(response.Price) * rate, 2) + "</span></td>");
                        wishListStringBld.Append("<td><input type=\"hidden\" name=\"hdnCostVariandValueIDS\" value=" +
                                                 cosVaraint + "/>");
                        wishListStringBld.Append("<span>" + response.ItemCostVariantValue + "</span></td>");
                        wishListStringBld.Append("<td class=\"cssClassWishComment\">");
                        wishListStringBld.Append("<textarea maxlength=\"300\" onkeyup=\"" + "WishList.ismaxlength(this)" +
                                                 "\" id=\"comment_" + response.WishItemID + "\" class=\"comment\">" +
                                                 response.Comment + "</textarea></td>");
                        wishListStringBld.Append("<td class=\"cssClassWishDate\">" + WishDate + "</td>");
                        wishListStringBld.Append("<td class=\"cssClassWishToCart\">");
                        wishListStringBld.Append("<div class=\"sfButtonwrapper\">");
                        wishListStringBld.Append("<a href=" + cartUrl + " onclick=WishList.AddToCartToJS(" +
                                                 response.ItemID + "," + response.Price + "," + itemSKU + "," + 1 +
                                                 ");><span>" + getLocale("Add To Cart") + "</span></a></div></td>");
                        wishListStringBld.Append("<td class=\"cssClassDelete\">");
                        wishListStringBld.Append("<img onclick=\"WishList.DeleteWishListItem(" + response.WishItemID +
                                                 ")\" src=\"" + aspxTemplateFolderPath +
                                                 "/images/admin/btndelete.png\"/>");
                        wishListStringBld.Append("</td></tr>");
                    }
                }
            }
            wishListStringBld.Append("</tbody>");
            wishListStringBld.Append(GetStringScript("$('.cssClassImage img[title]').tipsy({ gravity: 'n' });"));
            StringBuilder wishLstButtonBdl = new StringBuilder();
            wishLstButtonBdl.Append("<button type=\"button\" id=\"shareWishList\">");
            wishLstButtonBdl.Append("<span><span class=\"sfLocale\">Share Wishlist</span></span></button>");
            wishLstButtonBdl.Append(
                "<button type=\"button\" id=\"updateWishList\" onclick=\"WishList.UpdateWishList();\">");
            wishLstButtonBdl.Append("<span><span class=\"sfLocale\">Update Selected</span></span></button>");
            wishLstButtonBdl.Append(
                "<button type=\"button\" id=\"clearWishList\" onclick=\"WishList.ClearWishList();\">");
            wishLstButtonBdl.Append("<span><span class=\"sfLocale\">Clear WishList</span></span></button>");
            wishLstButtonBdl.Append("<button type=\"button\" id=\"btnDeletedMultiple\">");
            wishLstButtonBdl.Append("");
            wishLstButtonBdl.Append("<span><span class=\"sfLocale\">Delete Selected</span></span></button>");
            wishLstButtonBdl.Append("<button type=\"button\" id=\"continueInStore\">");
            wishLstButtonBdl.Append("<span><span class=\"sfLocale\">Continue to Shopping</span></span></button >");

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

            //StringBuilder wishListSortByBdl = new StringBuilder();
            //wishListSortByBdl.Append("<span class=\"sfLocale\">Sort by:</span><select id=\"ddlWishListSortBy\" class=\"sfListmenu\"><option value=\"\"></option></select>");
            //ltrWishListSortBy.Text = wishListSortByBdl.ToString();

            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();
    }
    private void GetLatestItemsByCount()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        List <LatestItemsInfo> latestItemsInfo    = AspxItemMgntController.GetLatestItemsByCount(aspxCommonObj, NoOfLatestItems);
        StringBuilder          RecentItemContents = new StringBuilder();
        string modulePath = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        string             pageExtension          = SageFrameSettingKeys.PageExtension;
        string             aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string             aspxRootPath           = ResolveUrl("~/");
        decimal            rate           = 1;
        StoreSettingConfig ssc            = new StoreSettingConfig();
        decimal            additionalCCVR = decimal.Parse(ssc.GetStoreSettingsByKey(StoreSetting.AdditionalCVR, StoreID, PortalID, CultureName));
        string             MainCurrency   = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, StoreID, PortalID, 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());
            }
        }
        if (latestItemsInfo != null && latestItemsInfo.Count > 0)
        {
            foreach (LatestItemsInfo item in latestItemsInfo)
            {
                string imagePath    = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                string altImagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.AlternateImagePath;
                if (item.ImagePath == "")
                {
                    imagePath = DefaultImagePath;
                }
                if (item.AlternateText == "")
                {
                    item.AlternateText = item.Name;
                }
                if (item.AlternateImagePath == "")
                {
                    altImagePath = imagePath;
                }
                string itemPrice     = Math.Round(double.Parse((item.Price).ToString()), 2).ToString();
                string itemPriceRate = Math.Round(double.Parse((item.Price * rate).ToString()), 2).ToString();

                RecentItemContents.Append("<div class=\"cssClassProductsBox\">");
                var hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(item.SKU) + pageExtension;
                RecentItemContents.Append("<div id=\"productImageWrapID_");
                RecentItemContents.Append(item.ItemID);
                RecentItemContents.Append("\" class=\"cssClassProductsBoxInfo\" costvariantItem=");
                RecentItemContents.Append(item.IsCostVariantItem);
                RecentItemContents.Append("  itemid=\"");
                RecentItemContents.Append(item.ItemID);
                RecentItemContents.Append("\"><a href=\"");
                RecentItemContents.Append(hrefItem);
                RecentItemContents.Append("\" title=\"" + item.Name + "\"><h2>");
                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;
                }
                RecentItemContents.Append(name);
                RecentItemContents.Append("</h2></a><h3>");
                RecentItemContents.Append(item.SKU);
                RecentItemContents.Append("</h3><div class=\"divQuickLookonHover\"><div class=\"divitemImage cssClassProductPicture\"><a href=\"");
                RecentItemContents.Append(hrefItem);
                RecentItemContents.Append("\" ><img id=\"img_");
                RecentItemContents.Append(item.ItemID);
                RecentItemContents.Append("\"  alt=\"");
                RecentItemContents.Append(item.AlternateText);
                RecentItemContents.Append("\"  title=\"");
                RecentItemContents.Append(item.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("\" onmouseover='SwapImageOnMouseOver(this.id,\"");
                //RecentItemContents.Append(aspxRootPath);
                //RecentItemContents.Append(item.AlternateImagePath.Replace("uploads", "uploads/Medium"));
                //RecentItemContents.Append("\")' onmouseout='SwapImageOnMouseOut(this.id,\"");
                //RecentItemContents.Append(aspxRootPath);
                //RecentItemContents.Append(item.ImagePath.Replace("uploads", "uploads/Medium"));
                RecentItemContents.Append("\"/></a></div>");

                if (item.HidePrice != true)
                {
                    if (item.ListPrice != null)
                    {
                        string strAmount = Math.Round((double)(item.ListPrice * rate), 2).ToString();
                        RecentItemContents.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                        RecentItemContents.Append("<p class=\"cssClassProductOffPrice\">");
                        //RecentItemContents.Append(getLocale("Regular Price :"));
                        RecentItemContents.Append("<span class=\"cssClassFormatCurrency\" value=\"");
                        RecentItemContents.Append(Math.Round(double.Parse(item.ListPrice.ToString()), 2).ToString());
                        RecentItemContents.Append("\">");
                        RecentItemContents.Append(strAmount);
                        RecentItemContents.Append("</span></p><p class=\"cssClassProductRealPrice \" >");
                        //RecentItemContents.Append(getLocale("Our Offer :"));
                        RecentItemContents.Append("<span class=\"cssClassFormatCurrency\" value=\"");
                        RecentItemContents.Append(itemPrice);
                        RecentItemContents.Append("\">");
                        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(getLocale("Our Offer :"));
                        RecentItemContents.Append("<span class=\"cssClassFormatCurrency\" value=\"");
                        RecentItemContents.Append(itemPrice);
                        RecentItemContents.Append("\">");
                        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(item.SKU);
                RecentItemContents.Append(pageExtension);
                RecentItemContents.Append("\">");
                RecentItemContents.Append(getLocale("Details"));
                RecentItemContents.Append("</a></p></div>");

                RecentItemContents.Append("<div class=\"sfQuickLook\" style=\"display:none\">");
                RecentItemContents.Append("<img itemId=\"");
                RecentItemContents.Append(item.ItemID);
                RecentItemContents.Append("\" sku=\"");
                RecentItemContents.Append(item.SKU);
                RecentItemContents.Append("\" src=\"");
                RecentItemContents.Append(aspxTemplateFolderPath);
                RecentItemContents.Append("/images/QV_Button.png\" alt=\"\" rel=\"popuprel\" />");
                RecentItemContents.Append("</div>");
                RecentItemContents.Append("</div>");

                RecentItemContents.Append("<div class=\"sfButtonwrapper\">");
                if (AllowWishListLatestItem.ToLower() == "true")
                {
                    if (GetCustomerID > 0 && GetUsername.ToLower() != "anonymoususer")
                    {
                        RecentItemContents.Append("<div class=\"cssClassWishListButton\">");
                        RecentItemContents.Append("<button type=\"button\" class=\"addWishList\" onclick=\"LatestItems.CheckWishListUniqueness(");
                        RecentItemContents.Append(item.ItemID);
                        RecentItemContents.Append(",'");
                        RecentItemContents.Append(item.SKU);
                        RecentItemContents.Append("',this);\"><span><span><span>+</span>");
                        RecentItemContents.Append(getLocale("Wishlist"));
                        RecentItemContents.Append("</span></span></button></div>");
                    }
                    else
                    {
                        RecentItemContents.Append("<div class=\"cssClassWishListButton\">");
                        RecentItemContents.Append("<button type=\"button\" class=\"addWishList\" onclick=\"AspxCommerce.RootFunction.Login();\">");
                        RecentItemContents.Append("<span><span><span>+</span>");
                        RecentItemContents.Append(getLocale("Wishlist"));
                        RecentItemContents.Append("</span></span></button></div>");
                    }
                }
                //RecentItemContents+="<input type=\"button\" id=\"addWishList\" value=\"Add To Wishlist\" onclick='AddToWishList(" + item.ItemID + ");'/>";
                //RecentItemContents += "<div class=\"cssClassWishListDetail\"><p><a href='addtowishlist.aspx?itemId="+ item.ItemID + "'>Add to Wishlist</a></p>";
                if (AllowAddToCompareLatest.ToLower() == "true")
                {
                    RecentItemContents.Append("<div class=\"cssClassCompareButton\">");
                    RecentItemContents.Append("<label><input type=\"checkbox\" id=\"compare-");
                    RecentItemContents.Append(item.ItemID);
                    RecentItemContents.Append("\" onclick=\"LatestItems.AddItemsToCompare(");
                    RecentItemContents.Append(item.ItemID);
                    RecentItemContents.Append(",'");
                    RecentItemContents.Append(item.SKU);
                    RecentItemContents.Append("',this);\"/><span>");
                    RecentItemContents.Append(getLocale("Compare"));
                    RecentItemContents.Append("</span></label></div>");
                }
                RecentItemContents.Append("</div>");
                RecentItemContents.Append("<div class=\"cssClassclear\"></div>");
                string itemSKU  = item.SKU;
                string itemName = item.Name;
                if (AllowOutStockPurchase.ToLower() == "false")
                {
                    if (item.IsOutOfStock == true)
                    {
                        RecentItemContents.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper cssClassOutOfStock\">");
                        RecentItemContents.Append("<button type=\"button\"><span>");
                        RecentItemContents.Append(getLocale("Out Of Stock"));
                        RecentItemContents.Append("</span></button></div></div>");
                    }
                    else
                    {
                        // RecentItemContents += "</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\"><a href=\"#\" title=" + itemName + "  onclick='LatestItems.AddToCartToJS(" + item.ItemID + "," + item.Price.toFixed(2) + "," + itemSKU + "," + 1 + ");'><span>Add to cart</span></a></div></div>";
                        RecentItemContents.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\">");
                        RecentItemContents.Append("<button type=\"button\" class=\"addtoCart\" title=\"");
                        RecentItemContents.Append(itemName);
                        RecentItemContents.Append("\" onclick=\"LatestItems.AddToCartToJS(");
                        RecentItemContents.Append(item.ItemID);
                        RecentItemContents.Append(",");
                        RecentItemContents.Append(itemPrice);
                        RecentItemContents.Append(",'");
                        RecentItemContents.Append(itemSKU);
                        RecentItemContents.Append("',");
                        RecentItemContents.Append(1);
                        RecentItemContents.Append(",this);\"><span><span>");
                        RecentItemContents.Append(getLocale("Add to cart"));
                        RecentItemContents.Append("</span></span></button></div></div>");
                    }
                }
                else
                {
                    RecentItemContents.Append("</div><div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\">");
                    RecentItemContents.Append("<button type=\"button\" class=\"addtoCart\" title=\"");
                    RecentItemContents.Append(itemName);
                    RecentItemContents.Append("\" onclick=\"LatestItems.AddToCartToJS(");
                    RecentItemContents.Append(item.ItemID);
                    RecentItemContents.Append(",");
                    RecentItemContents.Append(itemPrice);
                    RecentItemContents.Append(",'");
                    RecentItemContents.Append(itemSKU);
                    RecentItemContents.Append("',");
                    RecentItemContents.Append(1);
                    RecentItemContents.Append(",this);\"><span><span>");
                    RecentItemContents.Append(getLocale("Add to cart"));
                    RecentItemContents.Append("</span></span></button></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();
    }
Пример #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string selectedCurrency = string.Empty;
        string MainCurrency     = string.Empty;

        try
        {
            StoreSettingConfig ssc = new StoreSettingConfig();
            MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetStoreID, GetPortalID, GetCurrentCultureName);
            if (Session["SelectedCurrency"] != null && Session["SelectedCurrency"] != "")
            {
                selectedCurrency = Session["SelectedCurrency"].ToString();
            }
            else
            {
                selectedCurrency = MainCurrency;
            }

            string       islive     = Request.Form["custom"];
            string       test       = string.Empty;
            const string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr";
            const string strLive    = "https://www.paypal.com/cgi-bin/webscr";
            test = bool.Parse(islive.Split('#')[6]) ? strSandbox : strLive;

            var req = (HttpWebRequest)WebRequest.Create(test);
            req.Method      = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            byte[] param      = Request.BinaryRead(HttpContext.Current.Request.ContentLength);
            string strRequest = Encoding.ASCII.GetString(param);
            strRequest       += "&cmd=_notify-validate";
            req.ContentLength = strRequest.Length;
            var streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
            streamOut.Write(strRequest);
            streamOut.Close();
            var    streamIn    = new StreamReader(req.GetResponse().GetResponseStream());
            string strResponse = streamIn.ReadToEnd();
            streamIn.Close();
            if (strResponse == "VERIFIED")
            {
                string payerEmail     = Request.Form["payer_email"];
                string paymentStatus  = Request.Form["payment_status"];
                string receiverEmail  = Request.Form["receiver_email"];
                string amount         = Request.Form["mc_gross"];
                string invoice        = Request.Form["invoice"];
                string addressName    = Request.Form["address_name"];
                string addressStreet  = Request.Form["address_street"];
                string addressCity    = Request.Form["address_city"];
                string addressZip     = Request.Form["address_zip"];
                string addressCountry = Request.Form["address_country"];
                string transID        = Request.Form["txn_id"];
                string custom         = Request.Form["custom"];

                string[] ids         = custom.Split('#');
                int      orderID     = int.Parse(ids[0]);
                int      storeID     = int.Parse(ids[1]);
                int      portalID    = int.Parse(ids[2]);
                string   userName    = ids[3];
                int      customerID  = int.Parse(ids[4]);
                string   sessionCode = ids[5];
                string   pgid        = ids[7];

                var tinfo = new TransactionLogInfo();
                var tlog  = new TransactionLog();

                tinfo.TransactionID      = transID;
                tinfo.AuthCode           = "";
                tinfo.TotalAmount        = decimal.Parse(amount);
                tinfo.ResponseCode       = "1";
                tinfo.ResponseReasonText = "";
                tinfo.OrderID            = orderID;
                tinfo.StoreID            = storeID;
                tinfo.PortalID           = portalID;
                tinfo.AddedBy            = userName;
                tinfo.CustomerID         = customerID;
                tinfo.SessionCode        = sessionCode;
                tinfo.PaymentGatewayID   = int.Parse(pgid);
                tinfo.PaymentStatus      = paymentStatus;
                tinfo.PayerEmail         = payerEmail;
                tinfo.CreditCard         = "";
                tinfo.RecieverEmail      = receiverEmail;
                tinfo.CurrencyCode       = selectedCurrency;
                tlog.SaveTransactionLog(tinfo);


                if (paymentStatus.Equals("Completed"))
                {
                    var paypalobj = new PayPalHandler();
                    paypalobj.ParseIPN(orderID, transID, paymentStatus, storeID, portalID, userName, customerID, sessionCode);
                }
            }
            else if (strResponse == "INVALID")
            {
            }
            else
            {
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                IncludeCss("LatestItems", "/Templates/" + TemplateName + "/css/MessageBox/style.css", "/Templates/" + TemplateName + "/css/ImageGallery/styles.css",
                           "/Templates/" + TemplateName + "/css/PopUp/style.css",
                           "/Templates/" + TemplateName + "/css/MessageBox/style.css",
                           "/Templates/" + TemplateName + "/css/FancyDropDown/fancy.css",
                           "/Templates/" + TemplateName + "/css/ToolTip/tooltip.css", "/Templates/" + TemplateName + "/css/PopUp/popbox.css");
                IncludeJs("LatestItems", "/js/DateTime/date.js", "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js",
                          "/Modules/AspxCommerce/AspxLatestItems/js/LatestItems.js", "/js/jquery.tipsy.js", "/js/ImageGallery/jquery.pikachoose.js", "/js/ImageGallery/jquery.jcarousel.js", "/js/ImageGallery/jquery.mousewheel.js",
                          "/js/jDownload/jquery.jdownload.js", "/js/MessageBox/alertbox.js", "/js/DateTime/date.js", "/js/PopUp/custom.js", "/js/PopUp/popbox.js",
                          "/js/FancyDropDown/itemFancyDropdown.js",
                          "/js/jquery.masonry.js");
                StoreID      = GetStoreID;
                PortalID     = GetPortalID;
                CustomerID   = GetCustomerID;
                UserName     = GetUsername;
                CultureName  = GetCurrentCultureName;
                aspxfilePath = ResolveUrl("~") + "Modules/AspxCommerce/AspxItemsManagement/";
                if (HttpContext.Current.Session.SessionID != null)
                {
                    SessionCode = HttpContext.Current.Session.SessionID.ToString();
                }
                if (HttpContext.Current.Session.SessionID != null)
                {
                    SessionCode = HttpContext.Current.Session.SessionID.ToString();
                }
                if (SageUserModuleID != "")
                {
                    UserModuleID = int.Parse(SageUserModuleID);
                }
                else
                {
                    UserModuleID = 0;
                }
                //StoreSettingInfo DefaultStoreSettings = (StoreSettingInfo)Session["DefaultStoreSettings"];
                //DefaultStoreSettings.AllowAnonymousCheckOut
                UserIp = HttpContext.Current.Request.UserHostAddress;
                IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();
                ipToCountry.GetCountry(UserIp, out CountryName);

                StoreSettingConfig ssc = new StoreSettingConfig();
                DefaultImagePath        = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName);
                NoOfLatestItems         = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.NoOfLatestItemsDisplay, StoreID, PortalID, CultureName));
                EnableLatestItems       = ssc.GetStoreSettingsByKey(StoreSetting.EnableLatestItems, StoreID, PortalID, CultureName);
                AllowOutStockPurchase   = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, StoreID, PortalID, CultureName);
                MaxCompareItemCount     = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.MaxNoOfItemsToCompare, StoreID, PortalID, CultureName));
                NoOfLatestItemsInARow   = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.NoOfLatestItemsInARow, StoreID, PortalID, CultureName));
                AllowWishListLatestItem = ssc.GetStoreSettingsByKey(StoreSetting.EnableWishList, StoreID, PortalID, CultureName);
                AllowAddToCompareLatest = ssc.GetStoreSettingsByKey(StoreSetting.EnableCompareItems, StoreID, PortalID, CultureName);
                LatestItemRss           = ssc.GetStoreSettingsByKey(StoreSetting.LatestItemRss, StoreID, PortalID, CultureName);
                if (LatestItemRss.ToLower() == "true")
                {
                    RssFeedUrl = ssc.GetStoreSettingsByKey(StoreSetting.RssFeedURL, StoreID, PortalID, CultureName);
                }
            }
            IncludeLanguageJS();
            if (EnableLatestItems.ToLower() == "true" && NoOfLatestItems > 0)
            {
                GetLatestItemsByCount();
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Пример #29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                IncludeJs("CategoryManage", "/js/GridView/jquery.grid.js",
                          "/js/GridView/SagePaging.js",
                          "/js/GridView/jquery.global.js", "/js/GridView/jquery.dateFormat.js",
                          "/js/TreeView/ui.tree.js",
                          "/js/TreeView/jquery.json-2.2.js", "/js/DateTime/date.js",
                          "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js",
                          "/js/AjaxFileUploader/ajaxupload.js", "/js/FormValidation/jquery.ui.datepicker.validation.js",
                          "/js/FormValidation/jquery.validate.js",
                          "/Modules/AspxCommerce/AspxCategoryManagement/js/CategoryManage.js",
                          "/js/CurrencyFormat/jquery.formatCurrency-1.4.0.js",
                          "/js/PopUp/custom.js", "/js/CurrencyFormat/jquery.formatCurrency.all.js",
                          "/js/DateTime/jquery.ptTimeSelect.js", "/js/jCrop/jquery.Jcrop.js");

                StoreID      = GetStoreID;
                PortalID     = GetPortalID;
                UserName     = GetUsername;
                UserModuleID = SageUserModuleID;
                CultureName  = GetCurrentCultureName;
                StoreSettingConfig ssc = new StoreSettingConfig();
                CategoryLargeThumbImageHeight =
                    int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.CategoryLargeThumbnailImageHeight, StoreID, PortalID,
                                                        CultureName));
                CategoryLargeThumbImageWidth =
                    int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.CategoryLargeThumbnailImageWidth, StoreID, PortalID,
                                                        CultureName));
                CategoryMediumThumbImageHeight =
                    int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.CategoryMediumThumbnailImageHeight, StoreID, PortalID,
                                                        CultureName));
                CategoryMediumThumbImageWidth =
                    int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.CategoryMediumThumbnailImageWidth, StoreID, PortalID,
                                                        CultureName));
                CategorySmallThumbImageHeight =
                    int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.CategorySmallThumbnailImageHeight, StoreID, PortalID,
                                                        CultureName));
                CategorySmallThumbImageWidth =
                    int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.CategorySmallThumbnailImageWidth, StoreID, PortalID,
                                                        CultureName));

                BannerWidth  = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.CategoryBannerImageWidth, StoreID, PortalID, CultureName));
                BannerHeight = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.CategoryBannerImageHeight, StoreID, PortalID, CultureName));
                IncludeCss("CategoryManage", "/Templates/" + TemplateName + "/css/GridView/tablesort.css",
                           "/Templates/" + TemplateName + "/css/TreeView/ui.tree.css",
                           "/Templates/" + TemplateName + "/css/MessageBox/style.css",
                           "/Templates/" + TemplateName + "/css/DateTime/jquery.ptTimeSelect.css",
                           "/Templates/" + TemplateName + "/css/jCrop/jCrop.css",
                           "/Modules/AspxCommerce/AspxCategoryManagement/css/module.css");
                IncludeJs("CategoryManageCk", "/Editors/ckeditor/ckeditor.js", "/Editors/ckeditor/adapters/jquery.js");
            }
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ckEditorUserModuleID", " var ckEditorUserModuleID='" + SageUserModuleID + "';", true);

            AddLanguage();
            IncludeLanguageJS();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Пример #30
0
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        MembershipController member = new MembershipController();
        RoleController       role   = new RoleController();
        UserInfo             user   = member.GetUserDetails(GetPortalID, UserName.Text);

        if (user.UserExists && user.IsApproved)
        {
            if (!(string.IsNullOrEmpty(UserName.Text) && string.IsNullOrEmpty(PasswordAspx.Text)))
            {
                if (PasswordHelper.ValidateUser(user.PasswordFormat, PasswordAspx.Text, user.Password, user.PasswordSalt))
                {
                    string userRoles = role.GetRoleNames(user.UserName, GetPortalID);
                    strRoles += userRoles;
                    if (strRoles.Length > 0)
                    {
                        SetUserRoles(strRoles);
                        //SessionTracker sessionTracker = (SessionTracker)Session[SessionKeys.Tracker];
                        //SessionTracker sessionTracker = (SessionTracker)Session[SessionKeys.Tracker];
                        //sessionTracker.PortalID = GetPortalID.ToString();
                        //sessionTracker.Username = UserName.Text;
                        //Session[SessionKeys.Tracker] = sessionTracker;
                        SageFrame.Web.SessionLog SLog = new SageFrame.Web.SessionLog();
                        SLog.SessionTrackerUpdateUsername(UserName.Text, GetPortalID.ToString());

                        StringBuilder             redirectURL = new StringBuilder();
                        SecurityPolicy            objSecurity = new SecurityPolicy();
                        FormsAuthenticationTicket ticket      = new FormsAuthenticationTicket(1,
                                                                                              user.UserName,
                                                                                              DateTime.Now,
                                                                                              DateTime.Now.AddMinutes(30),
                                                                                              true,
                                                                                              GetPortalID.ToString(),
                                                                                              FormsAuthentication.FormsCookiePath);

                        string encTicket = FormsAuthentication.Encrypt(ticket);

                        string randomCookieValue = GenerateRandomCookieValue();
                        Session[SessionKeys.RandomCookieValue] = randomCookieValue;
                        HttpCookie      cookie    = new HttpCookie(objSecurity.FormsCookieName(GetPortalID), encTicket);
                        SageFrameConfig objConfig = new SageFrameConfig();
                        string          ServerCookieExpiration = objConfig.GetSettingValueByIndividualKey(SageFrameSettingKeys.ServerCookieExpiration);
                        int             expiryTime             = Math.Abs(int.Parse(ServerCookieExpiration));
                        expiryTime     = expiryTime < 5 ? 5 : expiryTime;
                        cookie.Expires = DateTime.Now.AddMinutes(expiryTime);
                        Response.Cookies.Add(cookie);
                        ServiceSecurity.IssueToken(GetPortalID);
                        if (Request.QueryString["ReturnUrl"] != null)
                        {
                            string PageNotFoundPage      = PortalAPI.PageNotFoundURLWithRoot;
                            string UserRegistrationPage  = PortalAPI.RegistrationURLWithRoot;
                            string PasswordRecoveryPage  = PortalAPI.PasswordRecoveryURLWithRoot;
                            string ForgotPasswordPage    = PortalAPI.ForgotPasswordURL;
                            string PageNotAccessiblePage = PortalAPI.PageNotAccessibleURLWithRoot;

                            string ReturnUrlPage = Request.QueryString["ReturnUrl"].Replace("%2f", "-").ToString();

                            if (ReturnUrlPage == PageNotFoundPage || ReturnUrlPage == UserRegistrationPage || ReturnUrlPage == PasswordRecoveryPage || ReturnUrlPage == ForgotPasswordPage || ReturnUrlPage == PageNotAccessiblePage)
                            {
                                redirectURL.Append(GetParentURL);
                                redirectURL.Append(PortalAPI.DefaultPageWithExtension);
                            }
                            else
                            {
                                redirectURL.Append(ResolveUrl(Request.QueryString["ReturnUrl"].ToString()));
                            }
                        }
                        else
                        {
                            if (!IsParent)
                            {
                                redirectURL.Append(GetParentURL);
                                redirectURL.Append("/portal/");
                                redirectURL.Append(GetPortalSEOName);
                                redirectURL.Append("/");
                                redirectURL.Append(ssc.GetStoreSettingsByKey(StoreSetting.SingleCheckOutURL, GetStoreID, GetPortalID, GetCurrentCultureName));
                                redirectURL.Append(SageFrameSettingKeys.PageExtension);
                            }
                            else
                            {
                                redirectURL.Append(GetParentURL);
                                redirectURL.Append("/");
                                redirectURL.Append(ssc.GetStoreSettingsByKey(StoreSetting.SingleCheckOutURL, GetStoreID, GetPortalID, GetCurrentCultureName));
                                redirectURL.Append(SageFrameSettingKeys.PageExtension);
                            }
                        }

                        int customerID = GetCustomerID;
                        if (customerID == 0)
                        {
                            CustomerGeneralInfo sageUserCust = CustomerGeneralInfoController.CustomerIDGetByUsername(user.UserName, storeID, portalID);
                            if (sageUserCust != null)
                            {
                                customerID = sageUserCust.CustomerID;
                            }
                        }
                        AspxCommonController objCommonCont = new AspxCommonController();
                        objCommonCont.UpdateCartAnonymoususertoRegistered(storeID, portalID, customerID, sessionCode);
                        Response.Redirect(redirectURL.ToString(), false);
                    }
                    else
                    {
                        FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("UserLogin", "Youarenotauthenticatedtothisportal"));
                    }
                }
                else
                {
                    FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("UserLogin", "UsernameandPasswordcombinationdoesntmatched"));//"Username and Password combination doesn't matched!";
                }
            }
        }
        else
        {
            FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("UserLogin", "UserDoesnotExist"));
        }
    }