public void GetItemRelatedUpSellAndCrossSellList(string itemsku)
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

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

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

        if (lstRelatedItem != null && lstRelatedItem.Count > 0)
        {
            realatedItemCartContent.Append("<div class=\"cssClassSpecialBoxInfo\" id=\"divSpItem\">");
            realatedItemCartContent.Append("<ul>");
            for (int index = 0; index < lstRelatedItem.Count; index++)
            {
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + lstRelatedItem[index].BaseImage;
                if (lstRelatedItem[index].BaseImage == null || lstRelatedItem[index].BaseImage == "")
                {
                    imagePath = NoImageYouMayAlsoLikePath;
                }

                if (lstRelatedItem[index].AlternateText == "")
                {
                    lstRelatedItem[index].AlternateText = lstRelatedItem[index].Name;
                }

                if ((index + 1) % 4 == 0)
                {
                    realatedItemCartContent.Append("<div class=\"cssClassYouMayAlsoLikeBox cssClassYouMayAlsoLikeBoxFourth\">");
                }
                else
                {
                    realatedItemCartContent.Append("<div class=\"cssClassYouMayAlsoLikeBox\">");
                }
                realatedItemCartContent.Append("<p class=\"cssClassCartPicture\"><a href=\"");
                realatedItemCartContent.Append(aspxRedirectPath);
                realatedItemCartContent.Append("item/");
                realatedItemCartContent.Append(lstRelatedItem[index].SKU + pageExtension);
                realatedItemCartContent.Append("\"><img alt=\"");
                realatedItemCartContent.Append(lstRelatedItem[index].AlternateText);
                realatedItemCartContent.Append("\" title=\"");
                realatedItemCartContent.Append(lstRelatedItem[index].Name);
                realatedItemCartContent.Append("\" src=\"");
                realatedItemCartContent.Append(aspxRootPath + imagePath.Replace("uploads", "uploads/Medium"));
                realatedItemCartContent.Append("\"></a></p>");
                realatedItemCartContent.Append("<p class=\"cssClassProductRealPrice\"><span class=\"cssClassFormatCurrency\">Price : ");
                realatedItemCartContent.Append(Convert.ToDecimal(lstRelatedItem[index].Price) * Rate);
                realatedItemCartContent.Append("</span></p>");

                if (AllowOutStockPurchase.ToLower() == "false")
                {
                    if ((bool)lstRelatedItem[index].IsOutOfStock)
                    {
                        realatedItemCartContent.Append("<div class=\"sfButtonwrapper cssClassOutOfStock\"><a href=\"#\"><span>");
                        realatedItemCartContent.Append(getLocale("Out Of Stock"));
                        realatedItemCartContent.Append("</span></a></div></div>");
                    }
                    else
                    {
                        realatedItemCartContent.Append("<div class=\"sfButtonwrapper\"><a href=\"#\" onclick=\"YouMayAlsoLike.AddToCartToJS(");
                        realatedItemCartContent.Append(lstRelatedItem[index].ItemID + ",");
                        realatedItemCartContent.Append(lstRelatedItem[index].Price + ",");
                        realatedItemCartContent.Append("'" + lstRelatedItem[index].SKU + "'," + 1);
                        realatedItemCartContent.Append(");\"><span>");
                        realatedItemCartContent.Append(getLocale("Add to Cart"));
                        realatedItemCartContent.Append("</span></a></div></div>");
                    }
                }
                else
                {
                    realatedItemCartContent.Append("<div class=\"sfButtonwrapper\"><a href=\"#\" onclick=\"YouMayAlsoLike.AddToCartToJS(");
                    realatedItemCartContent.Append(lstRelatedItem[index].ItemID + ",");
                    realatedItemCartContent.Append(lstRelatedItem[index].Price + ",");
                    realatedItemCartContent.Append("'" + lstRelatedItem[index].SKU + "'," + 1);
                    realatedItemCartContent.Append(");\"><span>");
                    realatedItemCartContent.Append(getLocale("Add to Cart"));
                    realatedItemCartContent.Append("</span></a></div></div>");
                }
            }
            realatedItemCartContent.Append("<div class=\"cssClassClear\"></div>");
        }

        else
        {
            realatedItemCartContent.Append("<span class=\"cssClassNotFound\">");
            realatedItemCartContent.Append(getLocale("No Data found."));
            realatedItemCartContent.Append("</span>");
        }
        ltrRelatedItemInCart.Text = realatedItemCartContent.ToString();
    }
    private void WebSuccess(string sageRedirectPath)
    {
        if (Session["OrderID"] != null)
        {
            int    storeID    = GetStoreID;
            int    portalID   = GetPortalID;
            string userName   = GetUsername;
            int    customerID = GetCustomerID;
            var    orderdata  = new OrderDetailsCollection();
            if (HttpContext.Current.Session["OrderCollection"] != null)
            {
                orderdata = (OrderDetailsCollection)HttpContext.Current.Session["OrderCollection"];
                _invoice  = orderdata.ObjOrderDetails.InvoiceNumber;
                var pw = new PayPalWCFService();
                int i  = orderdata.ObjOrderDetails.PaymentGatewayTypeID;
                List <PayPalSettingInfo> setting = pw.GetAllPayPalSetting(i, storeID, portalID);
                _authToken = setting[0].AuthToken;
                if (orderdata.GiftCardDetail != null && HttpContext.Current.Session["UsedGiftCard"] != null)
                {
                    AspxGiftCardController.UpdateGiftCardUsage(orderdata.GiftCardDetail, orderdata.ObjCommonInfo.StoreID,
                                                               orderdata.ObjCommonInfo.PortalID, orderdata.ObjOrderDetails.OrderID, orderdata.ObjCommonInfo.AddedBy,
                                                               orderdata.ObjCommonInfo.CultureName);
                    HttpContext.Current.Session.Remove("UsedGiftCard");
                }
            }



            _txToken = Request.QueryString.Get("tx");
            _query   = string.Format("cmd=_notify-synch&tx={0}&at={1}", _txToken, _authToken);
            const string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr";
            const string strLive    = "https://www.paypal.com/cgi-bin/webscr";
            string       test       = string.Empty;
            if (Session["IsTestPayPal"] != null)
            {
                test = bool.Parse(Session["IsTestPayPal"].ToString()) ? strSandbox : strLive;
            }
            var req = (HttpWebRequest)WebRequest.Create(test);

            req.Method        = "POST";
            req.ContentType   = "application/x-www-form-urlencoded";
            req.ContentLength = _query.Length;

            var stOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
            stOut.Write(_query);
            stOut.Close();

            var stIn = new StreamReader(req.GetResponse().GetResponseStream());
            _strResponse = stIn.ReadToEnd();
            stIn.Close();

            if (_strResponse.StartsWith("SUCCESS"))
            {
                string sessionCode = HttpContext.Current.Session.SessionID;
                try
                {
                    var paypalHandler = new PayPalHandler();
                    var aspxCommonObj = new AspxCommonInfo();
                    aspxCommonObj.StoreID     = storeID;
                    aspxCommonObj.PortalID    = portalID;
                    aspxCommonObj.UserName    = userName;
                    aspxCommonObj.CustomerID  = customerID;
                    aspxCommonObj.SessionCode = sessionCode;
                    int orderID = orderdata.ObjOrderDetails.OrderID;
                    paypalHandler.ParseAfterIPN(_strResponse, aspxCommonObj, TemplateName, _addressPath);

                    AspxGiftCardController.IssueGiftCard(orderdata.LstOrderItemsInfo, orderID, true, aspxCommonObj);
                    if (orderdata.GiftCardDetail != null && CheckOutSessions.Get <List <GiftCardUsage> >("UsedGiftCard").Count > 0)
                    {
                        AspxGiftCardController.UpdateGiftCardUsage(orderdata.GiftCardDetail, orderdata.ObjCommonInfo.StoreID,
                                                                   orderdata.ObjCommonInfo.PortalID, orderdata.ObjOrderDetails.OrderID, orderdata.ObjCommonInfo.AddedBy,
                                                                   orderdata.ObjCommonInfo.CultureName);
                    }
                }
                catch (Exception)
                {
                    lblerror.Text = GetSageMessage("Payment", "PaymentParsingIPNError");
                }

                String[] stringArray = _strResponse.Split('\n');
                int      i;
                string   status = string.Empty;
                for (i = 1; i < stringArray.Length - 1; i++)
                {
                    String[] stringArray1 = stringArray[i].Split('=');

                    String sKey   = stringArray1[0];
                    String sValue = HttpUtility.UrlDecode(stringArray1[1]);

                    switch (sKey)
                    {
                    case "txn_id":
                        _transID = Convert.ToString(sValue);
                        break;

                    case "payment_status":
                        status = Convert.ToString(sValue);
                        break;
                    }
                }
                lblOrderNo.Text       = "#" + Session["OrderID"].ToString();
                lblTransaction.Text   = _transID;
                lblInvoice.Text       = _invoice;
                lblPaymentMethod.Text = "Paypal";
                lblDateTime.Text      = DateTime.Now.ToString("dddd, dd MMMM yyyy ");
                if (status.ToLower().Trim() == "completed")
                {
                    lblerror.Text = GetSageMessage("Payment", "PaymentProcessed");
                }
                else if (status.ToLower().Trim() == "pending")
                {
                    lblerror.Text = GetSageMessage("Payment", "PaymentPending");
                }

                CheckOutHelper cHelper = new CheckOutHelper();
                cHelper.ClearSessions();
            }
            else
            {
                lblerror.Text = GetSageMessage("Payment", "PaymentError");
            }
        }
        else
        {
            Response.Redirect(sageRedirectPath, false);
        }
    }
Esempio n. 3
0
        public void SaveAndUpdateCompareItemsSetting(AspxCommonInfo aspxCommonObj, CompareItemsSettingKeyPairInfo compareItems)
        {
            CompareItemProvider cip = new CompareItemProvider();

            cip.SaveAndUpdateCompareItemsSetting(aspxCommonObj, compareItems);
        }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["MoneybookersData"] != null)
            {
                string[] data = Session["MoneybookersData"].ToString().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
                {
                    AspxCommerceWebService aws = new AspxCommerceWebService();
                    rate             = aws.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)
                {
                    // Set Transaction Currency code in session to save transactionLog table
                    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);
        }
    }
Esempio n. 5
0
        //------------------get items by dyanamic Advance serach-----------------------

        public List <AdvanceSearchDetailsInfo> GetItemsByDyanamicAdvanceSearch(int offset, int limit, AspxCommonInfo aspxCommonObj, ItemsByDynamicAdvanceSearchInfo searchObj)
        {
            string spName = string.Empty;

            try
            {
                List <KeyValuePair <string, object> > parameter = CommonParmBuilder.GetParamSPUC(aspxCommonObj);
                parameter.Add(new KeyValuePair <string, object>("@offset", offset));
                parameter.Add(new KeyValuePair <string, object>("@limit", limit));
                parameter.Add(new KeyValuePair <string, object>("@CategoryID", searchObj.CategoryID));
                parameter.Add(new KeyValuePair <string, object>("@IsGiftCard", searchObj.IsGiftCard));
                parameter.Add(new KeyValuePair <string, object>("@SearchText", searchObj.SearchText));
                parameter.Add(new KeyValuePair <string, object>("@BrandID", searchObj.BrandID));
                parameter.Add(new KeyValuePair <string, object>("@PriceFrom", searchObj.PriceFrom));
                parameter.Add(new KeyValuePair <string, object>("@PriceTo", searchObj.PriceTo));
                parameter.Add(new KeyValuePair <string, object>("@Attributes", searchObj.AttributeIDs));
                parameter.Add(new KeyValuePair <string, object>("@RowTotal", searchObj.RowTotal));
                SQLHandler sqlH = new SQLHandler();
                if (searchObj.SortBy == 1)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByItemIDDesc]";
                }
                else if (searchObj.SortBy == 2)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByItemID]";
                }
                else if (searchObj.SortBy == 3)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByPriceDesc]";
                }
                else if (searchObj.SortBy == 4)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByPrice]";
                }
                else if (searchObj.SortBy == 5)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByName]";
                }
                else if (searchObj.SortBy == 6)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByViewCount]";
                }
                else if (searchObj.SortBy == 7)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByIsFeatured]";
                }
                else if (searchObj.SortBy == 8)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByIsSpecial]";
                }
                else if (searchObj.SortBy == 9)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortBySoldItem]";
                }
                else if (searchObj.SortBy == 10)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByDiscount]";
                }
                else if (searchObj.SortBy == 11)
                {
                    spName = "[dbo].[usp_Aspx_AdvanceSearchSortByRatedValue]";
                }
                List <AdvanceSearchDetailsInfo> lstAdvanceSearch = sqlH.ExecuteAsList <AdvanceSearchDetailsInfo>(spName, parameter);
                return(lstAdvanceSearch);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 6
0
    private void BindCompareItems()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

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

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

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

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

        ltrCompareItem.Text = compareItemContains.ToString();
        ltrError.Text       = errorText;
    }
Esempio n. 7
0
        public void ParseAfterIPN(string postData, AspxCommonInfo aspxCommonObj, string templateName, string addressPath)
        {
            var    ph          = new PayPalHandler();
            string transId     = string.Empty;
            string orderStatus = string.Empty;

            try
            {
                //split response into string array using whitespace delimeter
                String[] stringArray = postData.Split('\n');

                // NOTE:

                /*
                 * loop is set to start at 1 rather than 0 because first
                 * string in array will be single word SUCCESS or FAIL
                 * Only used to verify post data
                 */
                var ot     = new OrderDetailsCollection();
                var odinfo = new OrderDetailsInfo();
                var cms    = new CartManageSQLProvider();
                var cf     = new CommonInfo {
                    StoreID = aspxCommonObj.StoreID, PortalID = aspxCommonObj.PortalID, AddedBy = aspxCommonObj.UserName
                };
                // UpdateOrderDetails

                var sqlH = new SQLHandler();
                // use split to split array we already have using "=" as delimiter

                int i;
                for (i = 1; i < stringArray.Length - 1; i++)
                {
                    String[] stringArray1 = stringArray[i].Split('=');

                    String sKey   = stringArray1[0];
                    String sValue = HttpUtility.UrlDecode(stringArray1[1]);

                    // set string vars to hold variable names using a switch
                    switch (sKey)
                    {
                    case "payment_status":
                        odinfo.ResponseReasonText = Convert.ToString(sValue);
                        orderStatus = Convert.ToString(sValue);
                        break;

                    case "mc_fee":
                        // ph.PaymentFee = Convert.ToDouble(sValue);
                        break;

                    case "payer_email":
                        // ph.PayerEmail = Convert.ToString(sValue);
                        break;

                    case "Tx Token":
                        // ph.TxToken = Convert.ToString(sValue);
                        break;

                    case "txn_id":
                        odinfo.TransactionID = Convert.ToString(sValue);
                        transId = Convert.ToString(sValue);
                        break;
                    }
                }

                ot.ObjCommonInfo = cf;
                //odinfo.OrderStatusID = 8;
                //objad.UpdateOrderDetails(ot);
                if (odinfo.ResponseReasonText.ToLower().Trim() == "completed")
                {
                    if (HttpContext.Current.Session["OrderCollection"] != null)
                    {
                        var orderdata2 = (OrderDetailsCollection)HttpContext.Current.Session["OrderCollection"];
                        AspxOrderController.UpdateItemQuantity(orderdata2);
                    }
                }
                cms.ClearCartAfterPayment(aspxCommonObj);

                //invoice  transID
                if (HttpContext.Current.Session["OrderCollection"] != null)
                {
                    var orderdata = (OrderDetailsCollection)HttpContext.Current.Session["OrderCollection"];
                    orderdata.ObjOrderDetails.OrderStatus = orderStatus;
                    EmailTemplate.SendEmailForOrder(aspxCommonObj.PortalID, orderdata, addressPath, templateName, transId);
                }
                HttpContext.Current.Session.Remove("OrderCollection");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            IncludeLanguageJS();

            GetPortalCommonInfo(out storeID, out portalID, out customerID, out userName, out cultureName, out sessionCode);
            AspxCommonInfo aspxCommonObj = new AspxCommonInfo(storeID, portalID, userName, cultureName, customerID, sessionCode);

            List <CouponSession> cs = new List <CouponSession>();
            cs     = CheckOutSessions.Get <List <CouponSession> >("CouponSession");
            Coupon = json_serializer.Serialize(cs);

            List <GiftCardUsage> gc = CheckOutSessions.Get <List <GiftCardUsage> >("UsedGiftCard");
            GiftCard = json_serializer.Serialize(gc);

            Discount = CheckOutSessions.Get <Decimal>("DiscountAmount", 0);

            string templateName = TemplateName;
            IncludeCss("CheckOutInformationContent", "/Templates/" + templateName + "/css/MessageBox/style.css", "/Templates/" + templateName + "/css/JQueryUIFront/jquery.ui.all.css",
                       "/Templates/" + templateName + "/css/ToolTip/tooltip.css", "/Modules/AspxCommerce/AspxCheckoutWithSingleAddress/css/module.css");
            IncludeJs("CheckOutInformationContent", "/js/encoder.js", "/js/FormValidation/jquery.validate.js", "/js/jquery.cookie.js", "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js", "/js/jquery.tipsy.js", "/Modules/AspxCommerce/AspxCheckoutWithSingleAddress/js/SingleCheckOut.js");

            ssc.GetStoreSettingParamEleven(StoreSetting.DefaultProductImageURL, StoreSetting.ShoppingCartURL, StoreSetting.MyAccountURL,
                                           StoreSetting.AllowedShippingCountry, StoreSetting.AllowedBillingCountry, StoreSetting.SingleCheckOutURL,
                                           StoreSetting.DimensionUnit, StoreSetting.WeightUnit, StoreSetting.AskCustomerToSubscribe, StoreSetting.ShipDetailPageURL,
                                           StoreSetting.AllowUsersToCreateMultipleAddress, out noImageCheckOutInfoPath, out ShoppingCartURL, out myAccountURL,
                                           out AllowededShippingCountry, out AllowededBillingCountry, out SingleAddressCheckOutURL, out DimentionalUnit,
                                           out WeightUnit, out ShowSubscription, out ShippingDetailPage, out allowMultipleAddress, storeID, portalID, cultureName);

            if (!IsPostBack)
            {
                HideSignUp();
                PasswordAspx.Attributes.Add("onkeypress", "return clickButton(event,'" + LoginButton.ClientID + "')");

                if (!IsParent)
                {
                    hypForgotPassword.NavigateUrl =
                        ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/sf/" +
                                   pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalForgotPassword) + SageFrameSettingKeys.PageExtension);
                }
                else
                {
                    hypForgotPassword.NavigateUrl =
                        ResolveUrl("~/sf/" + pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalForgotPassword) +
                                   SageFrameSettingKeys.PageExtension);
                }
                string registerUrl =
                    ResolveUrl("~/sf/" + pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalUserRegistration) +
                               SageFrameSettingKeys.PageExtension);
                signup.Attributes.Add("href", ResolveUrl("~/sf/sfUser-Registration" + SageFrameSettingKeys.PageExtension));
                signup1.Attributes.Add("href", ResolveUrl("~/sf/sfUser-Registration" + SageFrameSettingKeys.PageExtension));

                if (Boolean.Parse(pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.RememberCheckbox)))
                {
                    RememberMe.Visible = true;
                    lblrmnt.Visible    = true;
                }
                else
                {
                    RememberMe.Visible = false;
                    lblrmnt.Visible    = false;
                }

                object serverVars = new
                {
                    noImageCheckOutInfoPath  = noImageCheckOutInfoPath,
                    ShoppingCartURL          = ShoppingCartURL,
                    myAccountURL             = myAccountURL,
                    singleAddressCheckOutURL = SingleAddressCheckOutURL,
                    CartUrl = ShoppingCartURL,
                    AllowedShippingCountry = AllowededShippingCountry,
                    AllowedBillingCountry  = AllowededBillingCountry,
                    dimentionalUnit        = DimentionalUnit,
                    weightunit             = WeightUnit,
                    showSubscription       = ShowSubscription,
                    allowMultipleAddress   = allowMultipleAddress,
                    shippingDetailPage     = ShippingDetailPage,
                    Discount = Discount
                };

                ServerVars = json_serializer.Serialize(serverVars);
                LoadCartDetails(aspxCommonObj);
                LoadCountry();
                LoadAddress(aspxCommonObj);
                LoadPaymentGateway(aspxCommonObj);
                LoadRewardPoints(aspxCommonObj);
            }


            if (HttpContext.Current.User != null)
            {
                SecurityPolicy            objSecurity = new SecurityPolicy();
                FormsAuthenticationTicket ticket      = objSecurity.GetUserTicket(GetPortalID);
                if (ticket != null && ticket.Name != ApplicationKeys.anonymousUser)
                {
                    int                  LoggedInPortalID = int.Parse(ticket.UserData.ToString());
                    string[]             sysRoles         = SystemSetting.SUPER_ROLE;
                    MembershipController member           = new MembershipController();
                    UserInfo             userDetail       = member.GetUserDetails(GetPortalID, GetUsername);
                    if (GetPortalID == LoggedInPortalID || Roles.IsUserInRole(userDetail.UserName, sysRoles[0]))
                    {
                        RoleController _role       = new RoleController();
                        string         userinroles = _role.GetRoleNames(GetUsername, LoggedInPortalID);
                        if (userinroles != "" || userinroles != null)
                        {
                            MultiView1.ActiveViewIndex = 1;
                        }
                        else
                        {
                            MultiView1.ActiveViewIndex = 0;
                        }
                    }
                    else
                    {
                        MultiView1.ActiveViewIndex = 0;
                    }
                }
                else
                {
                    MultiView1.ActiveViewIndex = 0;
                }
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Esempio n. 9
0
    public void BindMyWishList(AspxCommonInfo aspxCommonObj)
    {
        string flagShowAll = "0";
        string modulePath = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath = ResolveUrl("~/");
        hst = AppLocalized.getLocale(modulePath);
        string pageExtension = SageFrameSettingKeys.PageExtension;
        WishItemController ctrl = new WishItemController();
        List<WishItemsInfo> lstWishItem = ctrl.GetRecentWishItemList(aspxCommonObj, flagShowAll,
                                                                                       NoOfRecentAddedWishItems);
        StringBuilder recentWishList = new StringBuilder();
        recentWishList.Append("<div class=\"cssClassCommonSideBoxTable wishItem\">"); 
        recentWishList.Append("<table class=\"cssClassMyWishItemTable\" id=\"tblWishItem\" width=\"100%\">");
        recentWishList.Append("<tbody>");

        if (lstWishItem != null && lstWishItem.Count > 0)
        {
            string myWishListLink = ""; 
            string cssClass = string.Empty;
            StringBuilder dataContent;
            string imagePath = string.Empty;

            if (userFriendlyURL)
            {
                myWishListLink = WishListURL + pageExtension;
            }
            else
            {
                myWishListLink = WishListURL;
            }

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

        addressBuilder.Append("<div id=\"ddlBilling\" class=\"clearfix\">");
        StringBuilder addressBuilderShip = new StringBuilder();

        addressBuilderShip.Append("<div id=\"ddlShipping\" class=\"clearfix\">");
        StringBuilder      addressScript = new StringBuilder();
        List <AddressInfo> lstAddress    = AspxUserDashController.GetUserAddressDetails(aspxCommonObj);

        addressBuilder.Append("");
        string tempAddress = "";

        tempAddress += "[";
        if (lstAddress.Count > 0)
        {
            foreach (AddressInfo item in lstAddress)
            {
                string add = "{" +
                             string.Format(
                    "Address1:\\'{0}\\',Address2:\\'{1}\\',AddressID:\\'{2}\\',City:\\'{3}\\',Company:\\'{4}\\',Country:\\'{5}\\' ,{6} DefaultBilling:\\'{7}\\',DefaultShipping:\\'{8}\\',Email:\\'{9}\\',Fax:\\'{10}\\',FirstName:\\'{11}\\',LastName:\\'{12}\\',Mobile:\\'{13}\\',Phone:\\'{14}\\',State:\\'{15}\\',Website:\\'{16}\\',Zip:\\'{17}\\'",
                    item.Address1, item.Address2,
                    item.AddressID, item.City, item.Company, item.Country, "",
                    item.DefaultBilling.ToString().ToLower(),
                    item.DefaultShipping.ToString().ToLower(), item.Email, item.Fax, item.FirstName,
                    item.LastName,
                    item.Mobile, item.Phone, item.State, item.Website, item.Zip)
                             + "},";
                tempAddress += add;
                if (item.DefaultBilling != null && bool.Parse(item.DefaultBilling.ToString()))
                {
                    addressBuilder.Append("<div><label><input type=\"radio\" name=\"billing\" value=\"");
                    addressBuilder.Append(item.AddressID);
                    addressBuilder.Append("\" checked=\"checked\" class=\"cssBillingShipping\" />");
                }
                else
                {
                    addressBuilder.Append("<div><label><input type=\"radio\" name=\"billing\" value=\"");
                    addressBuilder.Append(item.AddressID);
                    addressBuilder.Append("\" class=\"cssBillingShipping\" />");
                }
                addressBuilder.Append(item.FirstName.Replace(",", "-"));
                addressBuilder.Append(" ");
                addressBuilder.Append(item.LastName.Replace(",", "-"));

                if (item.Address1 != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Address1.Replace(",", "-"));
                }

                if (item.City != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.City.Replace(",", "-"));
                }

                if (item.State != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.State.Replace(",", "-"));
                }

                if (item.Country != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Country.Replace(",", "-"));
                }

                if (item.Zip != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Zip.Replace(",", "-"));
                }

                if (item.Email != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Email.Replace(",", "-"));
                }

                if (item.Phone != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Phone.Replace(",", "-"));
                }

                if (item.Mobile != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Mobile.Replace(",", "-"));
                }

                if (item.Fax != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Fax.Replace(",", "-"));
                }

                if (item.Website != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Website.Replace(",", "-"));
                }

                if (item.Address2 != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Address2.Replace(",", "-"));
                }

                if (item.Company != string.Empty)
                {
                    addressBuilder.Append(", ");
                    addressBuilder.Append(item.Company.Replace(",", "-"));
                }
                addressBuilder.Append("</label></div>");

                if (item.DefaultShipping != null && bool.Parse(item.DefaultShipping.ToString()))
                {
                    addressBuilderShip.Append("<div><label><input type=\"radio\" name=\"shipping\" value=\"");
                    addressBuilderShip.Append(item.AddressID);
                    addressBuilderShip.Append("\" checked=\"checked\" class=\"cssBillingShipping\" />");
                }
                else
                {
                    addressBuilderShip.Append("<div><label><input type=\"radio\" name=\"shipping\" value=\"");
                    addressBuilderShip.Append(item.AddressID);
                    addressBuilderShip.Append("\" class=\"cssBillingShipping\" />");
                }
                addressBuilderShip.Append(item.FirstName.Replace(",", "-"));
                addressBuilderShip.Append(" ");
                addressBuilderShip.Append(item.LastName.Replace(",", "-"));

                if (item.Address1 != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Address1.Replace(",", "-"));
                }

                if (item.City != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.City.Replace(",", "-"));
                }

                if (item.State != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.State.Replace(",", "-"));
                }

                if (item.Country != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Country.Replace(",", "-"));
                }

                if (item.Zip != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Zip.Replace(",", "-"));
                }

                if (item.Email != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Email.Replace(",", "-"));
                }

                if (item.Phone != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Phone.Replace(",", "-"));
                }

                if (item.Mobile != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Mobile.Replace(",", "-"));
                }

                if (item.Fax != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Fax.Replace(",", "-"));
                }

                if (item.Website != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Website.Replace(",", "-"));
                }

                if (item.Address2 != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Address2.Replace(",", "-"));
                }

                if (item.Company != string.Empty)
                {
                    addressBuilderShip.Append(", ");
                    addressBuilderShip.Append(item.Company.Replace(",", "-"));
                }
                addressBuilderShip.Append("</label></div>");
            }
            addressBuilderShip.Append("</div>");
            addressBuilder.Append("</div>");
            tempAddress  = tempAddress.Substring(0, tempAddress.Length - 1);
            tempAddress += "]";
            string script = string.Empty;
            if (CountDownloadableItem == CountAllItem)
            {
                ScriptsToRun += addressScript.Append("CheckOut.SetTempAddr(eval(\"" + tempAddress +
                                                     "\"));$(\"#dvBilling .cssClassCheckBox\").hide();$(\"#dvCPShipping\").parent(\"div\").hide();$(\"#dvCPShippingMethod\").parent(\"div\").hide();$(\"#addBillingAddress\").show(); $(\"#addShippingAddress\").show();")
                                .ToString();
            }
            else
            {
                ScriptsToRun += addressScript.Append("CheckOut.SetTempAddr(eval(\"" + tempAddress +
                                                     "\"));$(\"#dvBilling .cssClassCheckBox\").show(); $(\"#dvCPShipping\").parent(\"div\").show();$(\"#dvCPShippingMethod\").parent(\"div\").show(); $(\"#addShippingAddress\").show();")
                                .ToString();
            }

            ltddlBilling.Text  = addressBuilder.ToString();
            ltddlShipping.Text = addressBuilderShip.ToString();
        }
        else
        {
            addressBuilderShip.Append("</div>");
            addressBuilder.Append("</div>");
            ltddlBilling.Text  = addressBuilder.ToString();
            ltddlShipping.Text = addressBuilderShip.ToString();
        }
    }
Esempio n. 11
0
    private void LoadCartDetails(AspxCommonInfo aspxCommonObj)
    {
        string resolvedUrl = ResolveUrl("~/");
        string modulePath  = this.AppRelativeTemplateSourceDirectory;

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


        StringBuilder cartDetails   = new StringBuilder();
        StringBuilder scriptBuilder = new StringBuilder();

        List <CartInfo> lstCart = AspxCartController.GetCartCheckOutDetails(aspxCommonObj);

        cartCount = lstCart.Count;
        lstCart   = lstCart.Select(e => { e.KitData = Regex.Replace(e.KitData, "[\"\"]+", "'"); return(e); }).ToList();
        Items     = json_serializer.Serialize(lstCart);
        cartDetails.Append("<table class=\"sfGridTableWrapper\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\"tblCartList\">");
        cartDetails.Append("<thead><tr class=\"cssClassHeadeTitle\">");
        cartDetails.Append("<th class=\"cssClassSN\"> Sn.");
        cartDetails.Append(" </th><th class=\"cssClassProductImageWidth\">");
        cartDetails.Append(getLocale("Item Image"));
        cartDetails.Append("</th>");
        cartDetails.Append("<th>");
        cartDetails.Append(getLocale("Variants"));
        cartDetails.Append("</th>");
        cartDetails.Append("<th class=\"cssClassQTY\">");
        cartDetails.Append(getLocale("Qty"));
        cartDetails.Append("</th>");
        cartDetails.Append("<th class=\"cssClassProductPrice\">");
        cartDetails.Append(getLocale("Unit Price"));
        cartDetails.Append("</th>");
        cartDetails.Append("<th class=\"cssClassSubTotal\">");
        cartDetails.Append(getLocale("Line Total"));
        cartDetails.Append("</th>");
        cartDetails.Append("<th class=\"cssClassTaxRate\">");
        cartDetails.Append(getLocale("Unit Tax"));
        cartDetails.Append("</th>");
        cartDetails.Append("</tr>");
        cartDetails.Append("</thead");
        cartDetails.Append("<tbody>");

        int    giftcardCount = 0;
        int    index = 0;
        string itemids = "";
        bool   IsDownloadItemInCart = false, ShowShippingAdd = false;
        int    CartID     = 0;//int CountDownloadableItem = 0, CountAllItem = 0,
        string bsketItems = "";

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

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


            itemids += item.ItemID + "#" + item.CostVariantsValueIDs + ",";

            index++;
            string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
            if (item.ImagePath == "")
            {
                imagePath = noImageCheckOutInfoPath;
            }
            else if (item.AlternateText == string.Empty)
            {
                item.AlternateText = item.ItemName;
            }
            if (item.ItemTypeID == 2)
            {
                IsDownloadItemInCart = true;
                CountDownloadableItem++;
            }
            var isVirtual = false;
            if (item.ItemTypeID == 3)
            {
                int typ = AspxGiftCardController.GetGiftCardType(aspxCommonObj, item.CartItemID);

                if (typ > 0)
                {
                    if (typ == 2)
                    {
                        ShowShippingAdd = false;
                        isVirtual       = false;
                    }
                    else
                    {
                        ShowShippingAdd = true;
                        isVirtual       = true;
                    }
                }

                giftcardCount++;
                if (lstCart.Count != giftcardCount)
                {
                    ShowShippingAdd = false;
                }
            }

            CountAllItem++;
            cartDetails.Append("<tr >");
            cartDetails.Append("<td><input type=\"hidden\" name=\"cartItemId\" value=\"");
            cartDetails.Append(item.CartItemID);
            cartDetails.Append("\" />");
            cartDetails.Append("<b>");
            cartDetails.Append(index);
            cartDetails.Append(".</b>");
            cartDetails.Append("</td>");
            cartDetails.Append("<td>");
            cartDetails.Append("<p class=\"cssClassCartPicture\">");
            cartDetails.Append("<img title=\"");
            cartDetails.Append(item.AlternateText);
            cartDetails.Append("\" src=\"");
            cartDetails.Append(aspxRedirectPath);
            cartDetails.Append(imagePath.Replace("uploads", "uploads/Small"));
            cartDetails.Append("\" ></p>");
            cartDetails.Append("<div class=\"cssClassCartPictureInformation\">");
            cartDetails.Append("<h3>");
            if (item.CostVariantsValueIDs != string.Empty)
            {
                cartDetails.Append("<a class=\"cssClassLink\" id=\"item_");
                cartDetails.Append(item.ItemID);
                cartDetails.Append(" itemType=\"");
                cartDetails.Append(item.ItemTypeID);
                cartDetails.Append("\"  href=\"");
                cartDetails.Append(aspxRedirectPath);
                cartDetails.Append("item/");
                cartDetails.Append(item.SKU);
                cartDetails.Append(pageExtension);
                cartDetails.Append("?varId=");
                cartDetails.Append(item.CostVariantsValueIDs);
                cartDetails.Append("\">");
                cartDetails.Append(item.ItemName);
                cartDetails.Append("\" </a></h3>");
            }
            else
            {
                if (item.ItemTypeID == 3)
                {
                    cartDetails.Append("<a class=\"cssClassLink\" id=\"item_");
                    cartDetails.Append(item.ItemID);
                    cartDetails.Append("_");
                    cartDetails.Append(index);
                    cartDetails.Append("\" isvirtual=\"");

                    cartDetails.Append(isVirtual);
                    cartDetails.Append("\" itemType=\"");
                    cartDetails.Append(item.ItemTypeID);
                    cartDetails.Append("\"  href=\"");
                    cartDetails.Append(aspxRedirectPath);
                    cartDetails.Append("item/");
                    cartDetails.Append(item.SKU);
                    cartDetails.Append(pageExtension);
                    cartDetails.Append("\">");
                    cartDetails.Append(item.ItemName);
                    cartDetails.Append("</a></h3>");
                }
                else
                {
                    cartDetails.Append("<a class=\"cssClassLink\" id=\"item_");
                    cartDetails.Append(item.ItemID);
                    cartDetails.Append("_");
                    cartDetails.Append(index);
                    cartDetails.Append("\"  itemType=\"");

                    cartDetails.Append(item.ItemTypeID);
                    cartDetails.Append("\"  href=\"");
                    cartDetails.Append(aspxRedirectPath);
                    cartDetails.Append("item/");
                    cartDetails.Append(item.SKU);
                    cartDetails.Append(pageExtension);
                    cartDetails.Append("\">");
                    cartDetails.Append(item.ItemName);
                    cartDetails.Append("</a></h3>");
                }
            }
            cartDetails.Append("</div>");
            cartDetails.Append("</td>");
            cartDetails.Append("<td class=\"row-variants\" varIDs=\"");
            cartDetails.Append(item.CostVariantsValueIDs);
            cartDetails.Append("\">");
            cartDetails.Append(item.CostVariants);
            cartDetails.Append("</td>");
            cartDetails.Append("<td class=\"cssClassPreviewQTY\">");
            cartDetails.Append("<input class=\"num-pallets-input\" taxrate=\"0\" price=\"");
            cartDetails.Append(item.Price);
            cartDetails.Append("\" id=\"txtQuantity_");
            cartDetails.Append(item.CartID);
            cartDetails.Append("\" type=\"text\" readonly=\"readonly\" disabled=\"disabled\" value=\"");
            cartDetails.Append(item.Quantity);
            cartDetails.Append("\">");
            cartDetails.Append("</td>");
            cartDetails.Append("<td class=\"price-per-pallet\">");
            cartDetails.Append("<span id=\"");
            cartDetails.Append(item.Weight);
            cartDetails.Append("\" class=\"cssClassFormatCurrency\">");
            cartDetails.Append(Convert.ToDecimal(item.Price).ToString("N2") + "</span>");
            cartDetails.Append("</td>");
            cartDetails.Append("<td class=\"row-total\">");
            cartDetails.Append("<input class=\"row-total-input cssClassFormatCurrency\" id=\"txtRowTotal_");
            cartDetails.Append(item.CartID);
            cartDetails.Append("\"  value=\"");
            cartDetails.Append(Convert.ToDecimal(item.TotalItemCost).ToString("N2"));
            cartDetails.Append("\" baseValue=\"");
            cartDetails.Append(Convert.ToDecimal(item.TotalItemCost).ToString("N2"));
            cartDetails.Append("\"  readonly=\"readonly\" type=\"text\" />");
            cartDetails.Append("</td>");
            cartDetails.Append("<td class=\"row-taxRate\">");
            cartDetails.Append("<span class=\"cssClassFormatCurrency\">0.00</span>");
            cartDetails.Append("</td>");
            cartDetails.Append("</tr>");
            CartID = item.CartID;
        }
        cartDetails.Append("</table>");
        if (bsketItems.Length > 1)
        {
            bsketItems = bsketItems.Substring(0, bsketItems.Length - 1);
        }
        bsketItems += "]";
        scriptBuilder.Append("  CheckOut.SetBasketItems(eval(\"");
        scriptBuilder.Append(bsketItems);
        scriptBuilder.Append("\")); CheckOut.Vars.ItemIDs=\"");
        scriptBuilder.Append(itemids);
        scriptBuilder.Append("\";");
        scriptBuilder.Append("CheckOut.UserCart.CartID=");
        scriptBuilder.Append(CartID);
        scriptBuilder.Append(";");
        scriptBuilder.Append(" CheckOut.UserCart.ShowShippingAdd=");
        scriptBuilder.Append(ShowShippingAdd.ToString().ToLower());
        scriptBuilder.Append(";");
        scriptBuilder.Append(" CheckOut.UserCart.IsDownloadItemInCart=");
        scriptBuilder.Append(IsDownloadItemInCart.ToString().ToLower());
        scriptBuilder.Append(";");
        scriptBuilder.Append(" CheckOut.UserCart.CountDownloadableItem=");
        scriptBuilder.Append(CountDownloadableItem);
        scriptBuilder.Append(";");
        scriptBuilder.Append(" CheckOut.UserCart.CountAllItem=");
        scriptBuilder.Append(CountAllItem);
        scriptBuilder.Append("; ");//CheckOut.BindFunction();
        scriptBuilder.Append("$(\"#tblCartList tr:even\").addClass(\"sfEven\");$(\"#tblCartList tr:odd\").addClass(\"sfOdd\");");
        ScriptsToRun  += scriptBuilder.ToString();
        ltTblCart.Text = cartDetails.ToString();
    }
Esempio n. 12
0
    public void GetAddressBookDetails()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = GetStoreID;
        aspxCommonObj.PortalID    = GetPortalID;
        aspxCommonObj.UserName    = GetUsername;
        aspxCommonObj.CultureName = GetCurrentCultureName;
        aspxCommonObj.CustomerID  = GetCustomerID;
        string modulePath = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        string             pageExtension = SageFrameSettingKeys.PageExtension;
        List <AddressInfo> lstAddress    = AspxUserDashController.GetUserAddressDetails(aspxCommonObj);
        StringBuilder      defaultBillingAddressElements  = new StringBuilder();
        StringBuilder      defaultShippingAddressElements = new StringBuilder();

        if (lstAddress.Count > 0)
        {
            foreach (AddressInfo value in lstAddress)
            {
                if ((bool.Parse(value.DefaultBilling.ToString())) &&
                    (bool.Parse(value.DefaultShipping.ToString())))
                {
                    addressId = value.AddressID;
                }

                if (!defaultShippingExist)
                {
                    if ((bool.Parse(value.DefaultShipping.ToString())))
                    {
                        defaultShippingExist = true;
                    }
                    else
                    {
                        defaultShippingExist = false;
                    }
                }

                if (!defaultBillingExist)
                {
                    if (bool.Parse(value.DefaultBilling.ToString()))
                    {
                        defaultBillingExist = true;
                    }
                    else
                    {
                        defaultBillingExist = false;
                    }
                }

                if ((bool.Parse(value.DefaultBilling.ToString())) ||
                    ((bool.Parse(value.DefaultShipping.ToString()))))
                {
                    if (bool.Parse(value.DefaultShipping.ToString()))
                    {
                        defaultShippingAddressElements.Append("<div id=\"liDefaultShippingAddress\">");
                        defaultShippingAddressElements.Append("<h3>");
                        defaultShippingAddressElements.Append(getLocale("Default Shipping Address"));
                        defaultShippingAddressElements.Append("</h3>");
                        defaultShippingAddressElements.Append("<div><span name=\"FirstName\">");
                        defaultShippingAddressElements.Append(value.FirstName);
                        defaultShippingAddressElements.Append("</span>");
                        defaultShippingAddressElements.Append(" ");
                        defaultShippingAddressElements.Append("<span name=\"LastName\">");
                        defaultShippingAddressElements.Append(value.LastName);
                        defaultShippingAddressElements.Append("</span></div>");
                        defaultShippingAddressElements.Append("<div><span name=\"Email\">");
                        defaultShippingAddressElements.Append(value.Email);
                        defaultShippingAddressElements.Append("</span></div>");
                        if (value.Company != "")
                        {
                            defaultShippingAddressElements.Append("<div><span name=\"Company\">");
                            defaultShippingAddressElements.Append(value.Company);
                            defaultShippingAddressElements.Append("</span></div>");
                        }
                        defaultShippingAddressElements.Append("<div><span name=\"Address1\">");
                        defaultShippingAddressElements.Append(value.Address1);
                        defaultShippingAddressElements.Append("</span></div>");
                        if (value.Address2 != "")
                        {
                            defaultShippingAddressElements.Append("<div><span name=\"Address2\">");
                            defaultShippingAddressElements.Append(value.Address2);
                            defaultShippingAddressElements.Append("</span></div>");
                        }
                        defaultShippingAddressElements.Append("<div><span name=\"City\">");
                        defaultShippingAddressElements.Append(value.City);
                        defaultShippingAddressElements.Append("</span>, ");
                        defaultShippingAddressElements.Append("<span name=\"State\">");
                        defaultShippingAddressElements.Append(value.State);
                        defaultShippingAddressElements.Append("</span>, ");
                        defaultShippingAddressElements.Append("<span name=\"Country\">");
                        defaultShippingAddressElements.Append(value.Country);
                        defaultShippingAddressElements.Append("</span></div><div>");
                        defaultShippingAddressElements.Append("Zip: <span name=\"Zip\">");
                        defaultShippingAddressElements.Append(value.Zip);
                        defaultShippingAddressElements.Append("</span></div><div>");
                        defaultShippingAddressElements.Append("<i class=\"i-phone\"></i>");
                        defaultShippingAddressElements.Append("<span name=\"Phone\">");
                        defaultShippingAddressElements.Append(value.Phone);
                        defaultShippingAddressElements.Append("</span></div>");
                        if (value.Mobile != "")
                        {
                            defaultShippingAddressElements.Append("<div>");
                            defaultShippingAddressElements.Append("<i class=\"i-mobile\"></i>");
                            defaultShippingAddressElements.Append("<span name=\"Mobile\">");
                            defaultShippingAddressElements.Append(value.Mobile);
                            defaultShippingAddressElements.Append("</span></div>");
                        }
                        if (value.Fax != "")
                        {
                            defaultShippingAddressElements.Append("<div>");
                            defaultShippingAddressElements.Append("<i class=\"i-fax\"></i>");
                            defaultShippingAddressElements.Append("<span name=\"Fax\">");
                            defaultShippingAddressElements.Append(value.Fax);
                            defaultShippingAddressElements.Append("</span></div>");
                        }
                        if (value.Website != "")
                        {
                            defaultShippingAddressElements.Append("<div>");
                            defaultShippingAddressElements.Append("<span name=\"Website\">");
                            defaultShippingAddressElements.Append(value.Website);
                            defaultShippingAddressElements.Append("</span></div>");
                        }
                        defaultShippingAddressElements.Append("</div>");
                        defaultShippingAddressElements.Append(
                            "<div class=\"cssClassChange\"><a href=\"#\" rel=\"popuprel\" name=\"EditAddress\" Flag=\"1\" value=\"");
                        defaultShippingAddressElements.Append(value.AddressID);
                        defaultShippingAddressElements.Append("\" Element=\"Shipping\">");
                        defaultShippingAddressElements.Append("<i class=\"icon-edit\"></i>");
                        defaultShippingAddressElements.Append("</a></div>");
                        ltrShipAddress.Text = defaultShippingAddressElements.ToString();
                    }

                    if (bool.Parse(value.DefaultBilling.ToString()))
                    {
                        defaultBillingAddressElements.Append("<div id=\"liDefaultBillingAddress\">");
                        defaultBillingAddressElements.Append("<h3>");
                        defaultBillingAddressElements.Append(getLocale("Default Billing Address"));
                        defaultBillingAddressElements.Append("</h3>");
                        defaultBillingAddressElements.Append("<div><span name=\"FirstName\">");
                        defaultBillingAddressElements.Append(value.FirstName);
                        defaultBillingAddressElements.Append("</span>");
                        defaultBillingAddressElements.Append(" ");
                        defaultBillingAddressElements.Append("<span name=\"LastName\">");
                        defaultBillingAddressElements.Append(value.LastName);
                        defaultBillingAddressElements.Append("</span></div>");
                        defaultBillingAddressElements.Append("<div><span name=\"Email\">");
                        defaultBillingAddressElements.Append(value.Email);
                        defaultBillingAddressElements.Append("</span></div>");
                        if (value.Company != "")
                        {
                            defaultBillingAddressElements.Append("<div><span name=\"Company\">");
                            defaultBillingAddressElements.Append(value.Company);
                            defaultBillingAddressElements.Append("</span></div>");
                        }
                        defaultBillingAddressElements.Append("<div><span name=\"Address1\">");
                        defaultBillingAddressElements.Append(value.Address1);
                        defaultBillingAddressElements.Append("</span></div>");
                        if (value.Address2 != "")
                        {
                            defaultBillingAddressElements.Append("<div><span name=\"Address2\">");
                            defaultBillingAddressElements.Append(value.Address2);
                            defaultBillingAddressElements.Append("</span></div>");
                        }
                        defaultBillingAddressElements.Append("<div><span name=\"City\">");
                        defaultBillingAddressElements.Append(value.City);
                        defaultBillingAddressElements.Append("</span>, ");
                        defaultBillingAddressElements.Append("<span name=\"State\">");
                        defaultBillingAddressElements.Append(value.State);
                        defaultBillingAddressElements.Append("</span>, ");
                        defaultBillingAddressElements.Append("<span name=\"Country\">");
                        defaultBillingAddressElements.Append(value.Country);
                        defaultBillingAddressElements.Append("</span></div><div>");
                        defaultBillingAddressElements.Append("Zip: <span name=\"Zip\">");
                        defaultBillingAddressElements.Append(value.Zip);
                        defaultBillingAddressElements.Append("</span></div><div>");
                        defaultBillingAddressElements.Append("<i class=\"i-phone\"></i>");
                        defaultBillingAddressElements.Append("<span name=\"Phone\">");
                        defaultBillingAddressElements.Append(value.Phone);
                        defaultBillingAddressElements.Append("</span></div>");
                        if (value.Mobile != "")
                        {
                            defaultBillingAddressElements.Append("<div>");
                            defaultBillingAddressElements.Append("<i class=\"i-mobile\"></i>");
                            defaultBillingAddressElements.Append("<span name=\"Mobile\">");
                            defaultBillingAddressElements.Append(value.Mobile);
                            defaultBillingAddressElements.Append("</span></div>");
                        }
                        if (value.Fax != "")
                        {
                            defaultBillingAddressElements.Append("<div>");
                            defaultBillingAddressElements.Append("<i class=\"i-fax\"></i>");
                            defaultBillingAddressElements.Append("<span name=\"Fax\">");
                            defaultBillingAddressElements.Append(value.Fax);
                            defaultBillingAddressElements.Append("</span></div>");
                        }
                        if (value.Website != "")
                        {
                            defaultBillingAddressElements.Append("<div>");
                            defaultBillingAddressElements.Append("<span name=\"Website\">");
                            defaultBillingAddressElements.Append(value.Website);
                            defaultBillingAddressElements.Append("</span></div>");
                        }
                        defaultBillingAddressElements.Append("</div>");
                        defaultBillingAddressElements.Append(
                            "<div class=\"cssClassChange\"><a href=\"#\" rel=\"popuprel\" name=\"EditAddress\" Flag=\"1\" value=\"");
                        defaultBillingAddressElements.Append(value.AddressID);
                        defaultBillingAddressElements.Append("\" Element=\"Billing\">");
                        defaultBillingAddressElements.Append("<i class=\"icon-edit\"></i>");
                        defaultBillingAddressElements.Append("</a></div>");
                        ltrBillingAddress.Text = defaultBillingAddressElements.ToString();
                    }
                }
            }
            if (!defaultShippingExist)
            {
                defaultShippingAddressElements.Append("<span class=\"cssClassNotFound\">You have not set Default Shipping Adresss Yet!</span>");
                ltrShipAddress.Text = defaultShippingAddressElements.ToString();
            }
            if (!defaultBillingExist)
            {
                defaultBillingAddressElements.Append("<span class=\"cssClassNotFound\">You have not set Default Billing Adresss Yet!</span>");
                ltrBillingAddress.Text = defaultBillingAddressElements.ToString();
            }
        }
        else
        {
            defaultBillingAddressElements.Append("<div id=\"liDefaultBillingAddress\"></div>");
            ltrBillingAddress.Text = defaultBillingAddressElements.ToString();
            defaultShippingAddressElements.Append("<div id=\"liDefaultShippingAddress\"></div>");
            ltrShipAddress.Text = defaultShippingAddressElements.ToString();
        }
    }
 public List <CategoryWiseItemInfo> GetCategoryWiseItemList(int offset, int limit, int noOfItems, AspxCommonInfo aspxCommonObj)
 {
     try
     {
         List <KeyValuePair <string, object> > parameter = new List <KeyValuePair <string, object> >();
         parameter.Add(new KeyValuePair <string, object>("@offset", offset));
         parameter.Add(new KeyValuePair <string, object>("@limit", limit));
         parameter.Add(new KeyValuePair <string, object>("@StoreID", aspxCommonObj.StoreID));
         parameter.Add(new KeyValuePair <string, object>("@PortalID", aspxCommonObj.PortalID));
         parameter.Add(new KeyValuePair <string, object>("@UserName", aspxCommonObj.UserName));
         parameter.Add(new KeyValuePair <string, object>("@CultureName", aspxCommonObj.CultureName));
         parameter.Add(new KeyValuePair <string, object>("@noofitems", noOfItems));
         SQLHandler sqlH = new SQLHandler();
         return(sqlH.ExecuteAsList <CategoryWiseItemInfo>("[dbo].[usp_Aspx_CategoryWiseItemList]", parameter));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 14
0
 public static List <ItemBasicDetailsInfo> GetUserTaggedItems(int offset, int limit, string tagIDs, int SortBy, int rowTotal, AspxCommonInfo aspxCommonObj)
 {
     try
     {
         List <ItemBasicDetailsInfo> lstItemBasic = PopularTagsProvider.GetUserTaggedItems(offset, limit, tagIDs, SortBy, rowTotal, aspxCommonObj);
         return(lstItemBasic);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
    public string SendPaymentInfoAIM(OrderDetailsCollection OrderDetail, string TemplateName, string addressPath)
    {
        WebClient objRequest = new WebClient();

        System.Collections.Specialized.NameValueCollection objInf = new System.Collections.Specialized.NameValueCollection(30);

        string strError;

        //OrderDetail.ObjOrderDetails.CustomerID = int.Parse(Crypto.GenerateCustomerID());
        OrderDetail.ObjOrderDetails.InvoiceNumber       = Crypto.GenerateInvoiceNumber();
        OrderDetail.ObjOrderDetails.PurchaseOrderNumber = Crypto.GeneratePurchaseOrderNumber();

        //merchant generated field
        objInf.Add("x_version", OrderDetail.ObjOrderDetails.Version);
        objInf.Add("x_delim_data", OrderDetail.ObjOrderDetails.DelimData);
        objInf.Add("x_login", OrderDetail.ObjOrderDetails.APILogin);
        objInf.Add("x_tran_key", OrderDetail.ObjOrderDetails.TransactionKey);
        objInf.Add("x_relay_response", OrderDetail.ObjOrderDetails.RelayResponse);
        objInf.Add("x_delim_char", OrderDetail.ObjOrderDetails.DelimChar);
        objInf.Add("x_encap_char", OrderDetail.ObjOrderDetails.EncapeChar);
        objInf.Add("x_invoice_num", OrderDetail.ObjOrderDetails.InvoiceNumber);
        objInf.Add("x_cust_id", OrderDetail.ObjOrderDetails.CustomerID.ToString());
        objInf.Add("x_po_num", OrderDetail.ObjOrderDetails.PurchaseOrderNumber);
        //for (int i = 0; i < arr; i++)
        //{

        //}

        // Billing Address
        objInf.Add("x_first_name", OrderDetail.ObjBillingAddressInfo.FirstName);
        objInf.Add("x_last_name", OrderDetail.ObjBillingAddressInfo.LastName);
        objInf.Add("x_company", OrderDetail.ObjBillingAddressInfo.CompanyName);
        objInf.Add("x_email", OrderDetail.ObjBillingAddressInfo.EmailAddress);
        objInf.Add("x_address", OrderDetail.ObjBillingAddressInfo.Address);
        objInf.Add("x_city", OrderDetail.ObjBillingAddressInfo.City);
        objInf.Add("x_state", OrderDetail.ObjBillingAddressInfo.State);
        objInf.Add("x_zip", OrderDetail.ObjBillingAddressInfo.Zip);
        objInf.Add("x_country", OrderDetail.ObjBillingAddressInfo.Country);
        objInf.Add("x_phone", OrderDetail.ObjBillingAddressInfo.Phone);
        objInf.Add("x_fax", OrderDetail.ObjBillingAddressInfo.Fax);
        objInf.Add("x_email_customer", OrderDetail.ObjOrderDetails.IsEmailCustomer);

        if (OrderDetail.ObjOrderDetails.IsMultipleCheckOut == false)
        {
            //shipping address
            objInf.Add("x_ship_to_first_name", OrderDetail.ObjShippingAddressInfo.FirstName);
            objInf.Add("x_ship_to_last_name", OrderDetail.ObjShippingAddressInfo.LastName);
            objInf.Add("x_ship_to_company", OrderDetail.ObjShippingAddressInfo.CompanyName);
            objInf.Add("x_ship_to_address", OrderDetail.ObjShippingAddressInfo.Address);
            objInf.Add("x_ship_to_city", OrderDetail.ObjShippingAddressInfo.City);
            objInf.Add("x_ship_to_state", OrderDetail.ObjShippingAddressInfo.State);
            objInf.Add("x_ship_to_zip", OrderDetail.ObjShippingAddressInfo.Zip);
            objInf.Add("x_ship_to_country", OrderDetail.ObjShippingAddressInfo.Country);
        }
        // Card Details
        objInf.Add("x_card_num", OrderDetail.ObjPaymentInfo.CardNumber);
        objInf.Add("x_card_type", OrderDetail.ObjPaymentInfo.CardType);
        objInf.Add("x_exp_date", OrderDetail.ObjPaymentInfo.ExpireDate);
        if (OrderDetail.ObjPaymentInfo.PaymentMethodCode == "CC")
        {
            // Authorization code of the card (CCV)
            objInf.Add("x_card_code", OrderDetail.ObjPaymentInfo.CardCode.ToString());
            objInf.Add("x_method", OrderDetail.ObjPaymentInfo.PaymentMethodCode);
            objInf.Add("x_type", OrderDetail.ObjPaymentInfo.TransactionType);
            string amount = Regex.Replace(OrderDetail.ObjOrderDetails.GrandTotal.ToString("0.00"), @"[A-Z]", String.Empty);
            objInf.Add("x_amount", amount);
            objInf.Add("x_description", OrderDetail.ObjOrderDetails.Remarks);
            objInf.Add("x_test_request", OrderDetail.ObjOrderDetails.IsTest);
        }
        else
        {
            //bank
            objInf.Add("x_bank_aba_code", OrderDetail.ObjPaymentInfo.RoutingNumber);
            objInf.Add("x_bank_acct_num", OrderDetail.ObjPaymentInfo.AccountNumber);
            objInf.Add("x_bank_acct_type", OrderDetail.ObjPaymentInfo.AccountType);
            objInf.Add("x_bank_name", OrderDetail.ObjPaymentInfo.BankName);
            objInf.Add("x_bank_acct_name", OrderDetail.ObjPaymentInfo.AccountHolderName);
            objInf.Add("x_echeck_type", OrderDetail.ObjPaymentInfo.ChequeType);
            objInf.Add("x_bank_check_number", OrderDetail.ObjPaymentInfo.ChequeNumber);
        }

        // Currency setting. Check the guide for other supported currencies
        objInf.Add("x_currency_code", OrderDetail.ObjOrderDetails.CurrencyCode);
        objRequest.BaseAddress = "https://test.authorize.net/gateway/transact.dll";

        try
        {
            // POST request
            byte[]   objRetBytes;
            string[] objRetVals;

            objRetBytes =
                objRequest.UploadValues(objRequest.BaseAddress, "POST", objInf);
            objRetVals =
                System.Text.Encoding.ASCII.GetString(objRetBytes).Split(",".ToCharArray());

            // Process Return Values
            OrderDetail.ObjOrderDetails.ResponseCode       = int.Parse(objRetVals[0].Trim(char.Parse("|")));
            OrderDetail.ObjOrderDetails.ResponseReasonCode = int.Parse(objRetVals[2].Trim(char.Parse("|")));
            if (objRetVals[0].Trim(char.Parse("|")) == "1")
            {
                // Returned Authorisation Code
                //response.AuthorizationCode = objRetVals[4].Trim(char.Parse("|"));
                // Returned Transaction ID
                OrderDetail.ObjOrderDetails.TransactionID = Convert.ToString(objRetVals[6].Trim(char.Parse("|")));
                strError = "Transaction completed successfully.";
                AspxCommerceWebService asws = new AspxCommerceWebService();
                OrderDetail.ObjOrderDetails.OrderStatusID = 8;
                OrderDetail.ObjOrderDetails.TransactionID = Convert.ToString(objRetVals[6].Trim(char.Parse("|")));
                asws.AddOrderDetails(OrderDetail);
                CartManageSQLProvider cms           = new CartManageSQLProvider();
                AspxCommonInfo        aspxCommonObj = new AspxCommonInfo();
                aspxCommonObj.CustomerID  = OrderDetail.ObjOrderDetails.CustomerID;
                aspxCommonObj.SessionCode = OrderDetail.ObjOrderDetails.SessionCode;
                aspxCommonObj.StoreID     = OrderDetail.ObjCommonInfo.StoreID;
                aspxCommonObj.PortalID    = OrderDetail.ObjCommonInfo.PortalID;
                cms.ClearCartAfterPayment(aspxCommonObj);
            }
            else
            {
                // Error!
                strError = objRetVals[3].Trim(char.Parse("|")) + " (" +
                           objRetVals[2].Trim(char.Parse("|")) + ")";

                if (objRetVals[2].Trim(char.Parse("|")) == "44")
                {
                    // CCV transaction decline
                    strError += "Our Card Code Verification (CCV) returned " +
                                "the following error: ";

                    switch (objRetVals[38].Trim(char.Parse("|")))
                    {
                    case "N":
                        strError += "Card Code does not match.";
                        break;

                    case "P":
                        strError += "Card Code was not processed.";
                        break;

                    case "S":
                        strError += "Card Code should be on card but was not indicated.";
                        break;

                    case "U":
                        strError += "Issuer was not certified for Card Code.";
                        break;
                    }
                }

                if (objRetVals[2].Trim(char.Parse("|")) == "45")
                {
                    if (strError.Length > 1)
                    {
                        strError += "<br />n";
                    }

                    // AVS transaction decline
                    strError += "Our Address Verification System (AVS) " +
                                "returned the following error: ";

                    switch (objRetVals[5].Trim(char.Parse("|")))
                    {
                    case "A":
                        strError += " the zip code entered does not match " +
                                    "the billing address.";
                        break;

                    case "B":
                        strError += " no information was provided for the AVS check.";
                        break;

                    case "E":
                        strError += " a general error occurred in the AVS system.";
                        break;

                    case "G":
                        strError += " the credit card was issued by a non-US bank.";
                        break;

                    case "N":
                        strError += " neither the entered street address nor zip " +
                                    "code matches the billing address.";
                        break;

                    case "P":
                        strError += " AVS is not applicable for this transaction.";
                        break;

                    case "R":
                        strError += " please retry the transaction; the AVS system " +
                                    "was unavailable or timed out.";
                        break;

                    case "S":
                        strError += " the AVS service is not supported by your " +
                                    "credit card issuer.";
                        break;

                    case "U":
                        strError += " address information is unavailable for the " +
                                    "credit card.";
                        break;

                    case "W":
                        strError += " the 9 digit zip code matches, but the " +
                                    "street address does not.";
                        break;

                    case "Z":
                        strError += " the zip code matches, but the address does not.";
                        break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            strError = ex.Message;
        }
        OrderDetail.ObjOrderDetails.ResponseReasonText = strError;
        return(OrderDetail.ObjOrderDetails.ResponseReasonText);
    }
Esempio n. 16
0
    public void GetAllGiftCards()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        int offset = 1;
        int limit  = 8;
        List <LatestItemsInfo> lstGiftItems = AspxItemMgntController.GetAllGiftCards(offset, limit, rowTotal, aspxCommonObj);
        StringBuilder          GiftItems    = new StringBuilder();
        string modulePath = this.AppRelativeTemplateSourceDirectory;

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

        if (lstGiftItems != null && lstGiftItems.Count > 0)
        {
            foreach (LatestItemsInfo item in lstGiftItems)
            {
                rowTotal = item.RowTotal;
                string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + item.ImagePath;
                if (item.ImagePath == "")
                {
                    item.ImagePath = DefaultImagePath;
                }
                if (item.AlternateText == "")
                {
                    item.AlternateText = item.Name;
                }
                if ((lstGiftItems.IndexOf(item) + 1) % NoOfItemsInARow == 0)
                {
                    GiftItems.Append("<div class=\"cssClassProductsBox cssClassNoMargin\">");
                }
                else
                {
                    GiftItems.Append("<div class=\"cssClassProductsBox\">");
                }
                string itemPrice     = Math.Round(double.Parse((item.Price).ToString()), 2).ToString();
                string itemPriceRate = Math.Round(double.Parse((item.Price).ToString()), 2).ToString("N2");

                var hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(item.SKU) + pageExtension;
                GiftItems.Append("<div id=\"productImageWrapID_");
                GiftItems.Append(item.ItemID);
                GiftItems.Append("\" class=\"cssClassProductsBoxInfo\" costvariantItem=");
                GiftItems.Append(item.IsCostVariantItem);
                GiftItems.Append("  itemid=\"");
                GiftItems.Append(item.ItemID);
                GiftItems.Append("\"><h2>");
                GiftItems.Append(item.Name);
                GiftItems.Append("</h2><h3>");
                GiftItems.Append(item.SKU);
                GiftItems.Append(
                    "</h3><div id=\"divQuickLookonHover\"><div id=\"divitemImage\" class=\"cssClassProductPicture\"><a href=\"");
                GiftItems.Append(hrefItem);
                GiftItems.Append("\" ><img id=\"");
                GiftItems.Append(item.ItemID);
                GiftItems.Append("\"  alt=\"");
                GiftItems.Append(item.AlternateText);
                GiftItems.Append("\"  title=\"");
                GiftItems.Append(item.AlternateText);
                GiftItems.Append("\" data-original=\"");
                GiftItems.Append(aspxTemplateFolderPath);
                GiftItems.Append("/images/loader_100x12.gif\" src=\"");
                GiftItems.Append(aspxRootPath);
                GiftItems.Append(imagePath.Replace("uploads", "uploads/Medium"));
                GiftItems.Append("\"></a></div>");
                if (item.HidePrice != true)
                {
                    if (item.ListPrice != null)
                    {
                        string strAmount = Math.Round((double)(item.ListPrice), 2).ToString();
                        GiftItems.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                        GiftItems.Append("<p class=\"cssClassProductOffPrice\">");
                        GiftItems.Append("<span class=\"cssClassFormatCurrency\" value=");
                        GiftItems.Append(Math.Round(double.Parse(item.ListPrice.ToString()), 2).ToString());
                        GiftItems.Append(">");
                        GiftItems.Append(strAmount);
                        GiftItems.Append("</span></p><p class=\"cssClassProductRealPrice \" >");
                        GiftItems.Append("<span class=\"cssClassFormatCurrency\" value=");
                        GiftItems.Append(itemPrice);
                        GiftItems.Append(">");
                        GiftItems.Append(itemPriceRate);
                        GiftItems.Append("</span></p></div></div>");
                    }
                    else
                    {
                        GiftItems.Append("<div class=\"cssClassProductPriceBox\"><div class=\"cssClassProductPrice\">");
                        GiftItems.Append("<p class=\"cssClassProductRealPrice \" >");
                        GiftItems.Append("<span class=\"cssClassFormatCurrency\" value=");
                        GiftItems.Append(itemPrice);
                        GiftItems.Append(">");
                        GiftItems.Append(itemPriceRate);
                        GiftItems.Append("</span></p></div></div>");
                    }
                }
                else
                {
                    GiftItems.Append("<div class=\"cssClassProductPriceBox\"></div>");
                }
                GiftItems.Append("<div class=\"cssClassProductDetail\"><p><a href=\"");
                GiftItems.Append(aspxRedirectPath);
                GiftItems.Append("item/");
                GiftItems.Append(item.SKU);
                GiftItems.Append(pageExtension);
                GiftItems.Append("\">");
                GiftItems.Append(getLocale("Details"));
                GiftItems.Append("</a></p></div>");
                GiftItems.Append("<div class=\"sfQuickLook\" style=\"display:none\">");
                GiftItems.Append("<img itemId=\"");
                GiftItems.Append(item.ItemID);
                GiftItems.Append("\" sku=\"");
                GiftItems.Append(item.SKU);
                GiftItems.Append("\" src=\"");
                GiftItems.Append(aspxTemplateFolderPath);
                GiftItems.Append("/images/QV_Button.png\" rel=\"popuprel\" />");
                GiftItems.Append("</div>");
                GiftItems.Append("</div>");
                GiftItems.Append("<div class=\"sfButtonwrapper\">");
                if (GetCustomerID > 0 && GetUsername.ToLower() != "anonymoususer")
                {
                    GiftItems.Append("<div class=\"cssClassWishListButton\">");
                    GiftItems.Append("<input type=\"hidden\" name='itemwish' value=");
                    GiftItems.Append(item.ItemID);
                    GiftItems.Append(",'");
                    GiftItems.Append(item.SKU);
                    GiftItems.Append("',this  />");
                    GiftItems.Append("</div>");
                }
                else
                {
                    GiftItems.Append("<div class=\"cssClassWishListButton\">");
                    GiftItems.Append(
                        "<button type=\"button\" id=\"addWishList\" onclick=\"AspxCommerce.RootFunction.Login();\">");
                    GiftItems.Append("<span><span><span>+</span>");
                    GiftItems.Append(getLocale("Wishlist"));
                    GiftItems.Append("</span></span></button></div>");
                }
                GiftItems.Append("<div class=\"cssClassCompareButton\">");
                GiftItems.Append("<input type=\"hidden\" name='itemcompare' value=");
                GiftItems.Append(item.ItemID);
                GiftItems.Append(",'");
                GiftItems.Append(item.SKU);
                GiftItems.Append("',this  />");
                GiftItems.Append(" </div>");

                GiftItems.Append("</div>");
                GiftItems.Append("<div class=\"cssClassclear\"></div></div>");
                string itemSKU  = item.SKU;
                string itemName = item.Name;
                if (AllowAddToCart.ToLower() == "true")
                {
                    if (AllowOutStockPurchase.ToLower() == "false")
                    {
                        if (item.IsOutOfStock == true)
                        {
                            GiftItems.Append(
                                "<div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper cssClassOutOfStock\">");
                            GiftItems.Append("<button type=\"button\"><span>");
                            GiftItems.Append(getLocale("Out Of Stock"));
                            GiftItems.Append("</span></button></div></div>");
                        }
                        else
                        {
                            GiftItems.Append("<div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\">");
                            GiftItems.Append("<button type=\"button\" class=\"addtoCart\"");
                            GiftItems.Append("data-addtocart=\"");
                            GiftItems.Append("addtocart");
                            GiftItems.Append(item.ItemID);
                            GiftItems.Append("\" title=\"");
                            GiftItems.Append(item.Name);

                            GiftItems.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                            GiftItems.Append(item.ItemID + ",");
                            GiftItems.Append(item.Price + ",");
                            GiftItems.Append("'" + item.SKU + "'" + "," + 1);
                            GiftItems.Append(",'");
                            GiftItems.Append(item.IsCostVariantItem);
                            GiftItems.Append("',this);\"><span>");
                            GiftItems.Append(getLocale("Add To Cart"));
                            GiftItems.Append("</span></button></div></div>");
                        }
                    }
                    else
                    {
                        GiftItems.Append("<div class=\"cssClassAddtoCard\"><div class=\"sfButtonwrapper\">");
                        GiftItems.Append("<button type=\"button\" class=\"addtoCart\"");
                        GiftItems.Append("data-addtocart=\"");
                        GiftItems.Append("addtocart");
                        GiftItems.Append(item.ItemID);
                        GiftItems.Append("\" title=\"");
                        GiftItems.Append(item.Name);

                        GiftItems.Append("\" onclick=\"AspxCommerce.RootFunction.AddToCartFromJS(");
                        GiftItems.Append(item.ItemID + ",");
                        GiftItems.Append(item.Price + ",");
                        GiftItems.Append("'" + item.SKU + "'" + "," + 1);
                        GiftItems.Append(",'");
                        GiftItems.Append(item.IsCostVariantItem);
                        GiftItems.Append("',this);\"><span>");
                        GiftItems.Append(getLocale("Add To Cart"));
                        GiftItems.Append("</span></button></div></div>");
                    }
                    GiftItems.Append("</div>");
                }
            }
        }

        else
        {
            GiftItems.Append("<span class=\"cssClassNotFound\">");
            GiftItems.Append(getLocale("No items found!"));
            GiftItems.Append("</span>");
        }
        divGiftCards.InnerHtml = GiftItems.ToString();
    }
 public List <MegaCategorySettingInfo> MegaCategorySettingUpdate(string SettingValues, string SettingKeys, AspxCommonInfo aspxCommonObj)
 {
     try
     {
         List <KeyValuePair <string, object> > paramCol = CommonParmBuilder.GetParamSPC(aspxCommonObj);
         paramCol.Add(new KeyValuePair <string, object>("@SettingKeys", SettingKeys));
         paramCol.Add(new KeyValuePair <string, object>("@SettingValues", SettingValues));
         SQLHandler sqlH = new SQLHandler();
         List <MegaCategorySettingInfo> view =
             sqlH.ExecuteAsList <MegaCategorySettingInfo>("[dbo].[usp_Aspx_MegaCategorySettingUpdate]", paramCol);
         return(view);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 18
0
        public static List <ItemBasicDetailsInfo> GetUserTaggedItems(int offset, int limit, string tagIDs, int SortBy, int rowTotal, AspxCommonInfo aspxCommonObj)
        {
            List <ItemBasicDetailsInfo> itemBasicDetailsInfos;

            try
            {
                List <ItemBasicDetailsInfo> userTaggedItems = PopularTagsProvider.GetUserTaggedItems(offset, limit, tagIDs, SortBy, rowTotal, aspxCommonObj);
                itemBasicDetailsInfos = userTaggedItems;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(itemBasicDetailsInfos);
        }
Esempio n. 19
0
        public void ParseAfterIPNMobile(OrderInfo orderInfo, List <CouponSession> coupons, List <OrderItem> itemsInfo, string postData, UserAddressInfo billingAddress, UserAddressInfo shippingAddress, string templateName, string addressPath)
        {
            string transId = string.Empty;

            try
            {
                String[] stringArray = postData.Split('\n');
                var      ot          = new OrderDetailsCollection();
                var      odinfo      = new OrderDetailsInfo();
                var      cms         = new CartManageSQLProvider();
                var      cf          = new CommonInfo
                {
                    StoreID = orderInfo.StoreId, PortalID = orderInfo.PortalId, AddedBy = orderInfo.AddedBy
                };
                // UpdateOrderDetails

                var sqlH = new SQLHandler();
                // use split to split array we already have using "=" as delimiter

                int i;
                for (i = 1; i < stringArray.Length - 1; i++)
                {
                    String[] stringArray1 = stringArray[i].Split('=');

                    String sKey   = stringArray1[0];
                    String sValue = HttpUtility.UrlDecode(stringArray1[1]);

                    // set string vars to hold variable names using a switch
                    switch (sKey)
                    {
                    case "payment_status":
                        odinfo.ResponseReasonText = Convert.ToString(sValue);
                        break;

                    case "mc_fee":
                        // ph.PaymentFee = Convert.ToDouble(sValue);
                        break;

                    case "payer_email":
                        // ph.PayerEmail = Convert.ToString(sValue);
                        break;

                    case "Tx Token":
                        // ph.TxToken = Convert.ToString(sValue);
                        break;

                    case "txn_id":
                        odinfo.TransactionID = Convert.ToString(sValue);
                        transId = Convert.ToString(sValue);
                        break;
                    }
                }

                ot.ObjCommonInfo = cf;
                //odinfo.OrderStatusID = 8; var orderInfo = (OrderInfo) HttpContext.Current.Session["OrderCollection"];

                UpdateItemQuantityAndCoupon(orderInfo, itemsInfo, coupons, orderInfo.StoreId, orderInfo.PortalId,
                                            orderInfo.AddedBy);
                AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
                aspxCommonObj.CustomerID  = orderInfo.CustomerId;
                aspxCommonObj.SessionCode = orderInfo.SessionCode;
                aspxCommonObj.StoreID     = orderInfo.StoreId;
                aspxCommonObj.PortalID    = orderInfo.PortalId;
                cms.ClearCartAfterPayment(aspxCommonObj);
                EmailTemplate.SendEmailForOrderMobile(orderInfo, billingAddress, shippingAddress, addressPath,
                                                      templateName, transId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 20
0
    private void BindBrandRss(List <BrandRssInfo> brandRssContent)
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = GetStoreID;
        aspxCommonObj.PortalID    = GetPortalID;
        aspxCommonObj.UserName    = GetUsername;
        aspxCommonObj.CultureName = GetCurrentCulture();
        string x         = HttpContext.Current.Request.ApplicationPath;
        string authority = HttpContext.Current.Request.Url.Authority;
        string pageUrl   = authority + x;
        string pageURL   = Request.Url.AbsoluteUri;

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

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

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

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

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

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

                description += "</div>";
                rssXml.WriteCData(description);
                rssXml.WriteEndElement();
                rssXml.WriteElementString("pubDate", rssFeedBrand.AddedOn);
                rssXml.WriteEndElement();
            }
        }
        else
        {
            rssXml.WriteStartElement("item");
            rssXml.WriteElementString("title", "");
            rssXml.WriteElementString("link", "");
            rssXml.WriteStartElement("description");
            var description = "";
            description = "<div><h2><span>" + getLocale("This store has no items listed yet!") + "</span></h2></div>";
            rssXml.WriteCData(description);
            rssXml.WriteEndElement();
            rssXml.WriteEndElement();
        }
        rssXml.WriteEndElement();
        rssXml.WriteEndElement();
        rssXml.WriteEndDocument();
        rssXml.Flush();
        rssXml.Close();
        HttpContext.Current.Response.End();
    }
Esempio n. 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string         retMsg        = "fail";
        int            maxFileSize   = 0;
        int            retStatus     = -1;
        string         oldFile       = "";
        Random         rnd           = new Random();
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        const string path = "~/Modules/AspxCommerce/AspxItemsManagement/uploads/";

        if (Request.Form["DeleteImage"] != null)
        {
            if (Request.Form["OldFileName"] != null)
            {
                try
                {
                    oldFile = Request.Form["OldFileName"].ToString();
                    oldFile = Path.GetFileName(oldFile);
                    string largImage  = path + "Large/" + oldFile;
                    string midImage   = path + "Medium/" + oldFile;
                    string smallImage = path + "Small/" + oldFile;
                    string baseImage  = path + oldFile;
                    Thread.Sleep(2000);
                    if (File.Exists(HttpContext.Current.Server.MapPath(largImage)))
                    {
                        File.Delete(HttpContext.Current.Server.MapPath(largImage));
                    }
                    if (File.Exists(HttpContext.Current.Server.MapPath(midImage)))
                    {
                        File.Delete(HttpContext.Current.Server.MapPath(midImage));
                    }
                    if (File.Exists(HttpContext.Current.Server.MapPath(smallImage)))
                    {
                        File.Delete(HttpContext.Current.Server.MapPath(smallImage));
                    }
                    if (File.Exists(HttpContext.Current.Server.MapPath(baseImage)))
                    {
                        File.Delete(HttpContext.Current.Server.MapPath(baseImage));
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        else
        {
            if (Request.Form["MaxFileSize"] != null && Request.Form["MaxFileSize"] != "" &&
                int.Parse(Request.Form["MaxFileSize"].ToString()) > 0)
            {
                maxFileSize = int.Parse(Request.Form["MaxFileSize"].ToString());
            }
            if (Request.Form["StoreID"] != null)
            {
                aspxCommonObj.StoreID     = int.Parse(Request.Form["StoreID"].ToString());
                aspxCommonObj.PortalID    = int.Parse(Request.Form["PortalID"].ToString());
                aspxCommonObj.CultureName = Request.Form["CultureName"].ToString();
            }
            string strFileName = Path.GetFileName(HttpContext.Current.Request.Files[0].FileName);
            int    strSize     = HttpContext.Current.Request.Files[0].ContentLength;

            string mapPath  = HttpContext.Current.Server.MapPath(path);
            string tempPath = HttpContext.Current.Server.MapPath("~/Upload/temp/");
            if ((strSize > 0) && (strSize < maxFileSize * 1024))
            {
                HttpPostedFile uploadedfile = HttpContext.Current.Request.Files[0];
                string         filename     = uploadedfile.FileName;
                string         strExtension = Path.GetExtension(filename).ToLower();
                filename = filename.Substring(0, filename.Length - strExtension.Length);
                filename = filename + '_' + rnd.Next(111111, 999999).ToString() + strExtension;

                uploadedfile.SaveAs(tempPath + "\\" + filename);
                FileStream fs = new FileStream(tempPath + "\\" + filename, FileMode.Open);
                AspxImageManagerController.AddWaterMarksCostVariantItem(fs, path, filename,
                                                                        aspxCommonObj);
                retMsg    = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + filename;
                retStatus = 1;
            }
            else
            {
                retMsg = "Sorry, the image must be less than " + maxFileSize + "KB";
            }
            HttpContext.Current.Response.ContentType = "text/plain";
            HttpContext.Current.Response.Write("({ 'Status': '" + retStatus + "','Message': '" + retMsg + "' })");
            HttpContext.Current.Response.End();
        }
    }
    private void BindGallery(List <ItemsInfoSettings> lstItemGallery, AspxCommonInfo aspxCommonObj)
    {
        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='thumbs jcarousel-skin'><ul id='thumblist'>");
        galleryContainer.Append("<div id='divMainImage'>");
        ImageCount = lstItemGallery.Count;
        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 == string.Empty)
                {
                    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("<a rel='' href=\"");
                    galleryContainer.Append(aspxRootPath);
                    galleryContainer.Append(imagePath);
                    galleryContainer.Append("\" id='zoom1' class='cloud-zoom'  title=\"");
                    galleryContainer.Append(item.AlternateText);
                    galleryContainer.Append("\"><img title=\"");
                    galleryContainer.Append(item.AlternateText);
                    galleryContainer.Append("\" src=\"");
                    galleryContainer.Append(aspxRootPath);
                    galleryContainer.Append(imagePath.Replace("uploads", "uploads/Large"));
                    galleryContainer.Append("\"></a>");
                }
                string rel = "useZoom: 'zoom1', smallImage: '" + aspxRootPath + imagePath.Replace("uploads", "uploads/Large") + "' ";
                galleryThumbContainer.Append("<li><a rel=\"");
                galleryThumbContainer.Append(rel);
                galleryThumbContainer.Append("\" href=\"");
                galleryThumbContainer.Append(aspxRootPath);
                galleryThumbContainer.Append(imagePath);
                galleryThumbContainer.Append("\" class='cloud-zoom-gallery'><img title=\"");
                galleryThumbContainer.Append(item.AlternateText);
                galleryThumbContainer.Append("\" src=\"");
                galleryThumbContainer.Append(aspxRootPath);
                galleryThumbContainer.Append(imagePath.Replace("uploads", "uploads/Small"));
                galleryThumbContainer.Append("\" class='zoom-tiny-image'></a></li>");
            }
        }
        else
        {
            galleryContainer.Append("<a rel='' href=\"");
            galleryContainer.Append(aspxRootPath);
            galleryContainer.Append(NoImagePath);
            galleryContainer.Append("\" id='zoom1' class='cloud-zoom' ");
            galleryContainer.Append("><img src=\"");
            galleryContainer.Append(aspxRootPath);
            galleryContainer.Append(NoImagePath.Replace("uploads", "uploads/Large"));
            galleryContainer.Append("\"></a>");
            string rel = "useZoom: 'zoom1', smallImage: '" + aspxRootPath + NoImagePath.Replace("uploads", "uploads/Large") + "' ";
            galleryThumbContainer.Append("<li><a rel=\"");
            galleryThumbContainer.Append(rel);
            galleryThumbContainer.Append("\" href=\"");
            galleryThumbContainer.Append(aspxRootPath);
            galleryThumbContainer.Append(NoImagePath);
            galleryThumbContainer.Append("\" class='cloud-zoom-gallery'><img src=\"");
            galleryThumbContainer.Append(aspxRootPath);
            galleryThumbContainer.Append(NoImagePath.Replace("uploads", "uploads/Small"));
            galleryThumbContainer.Append("\" class='zoom-tiny-image'></a></li>");
        }
        galleryContainer.Append("</ul></div>");
        galleryThumbContainer.Append("</div>");
        ltrItemGallery.Text = galleryContainer.ToString();
        ltrItemThumb.Text   = galleryThumbContainer.ToString();
    }
Esempio n. 23
0
        public void SaveWishItems(SaveWishListInfo saveWishListInfo, AspxCommonInfo aspxCommonObj)
        {
            WishItemProvider provider = new WishItemProvider();

            provider.SaveWishItems(saveWishListInfo, aspxCommonObj);
        }
 public List <YouMayAlsoLikeInfo> GetYouMayAlsoLikeItemsListByItemSKU(string itemSKU, AspxCommonInfo aspxCommonObj, int count)
 {
     try
     {
         AspxYouMayAlsoLikeProvider objYouMayLike = new AspxYouMayAlsoLikeProvider();
         List <YouMayAlsoLikeInfo>  lstYouMayLike = objYouMayLike.GetYouMayAlsoLikeItemsListByItemSKU(itemSKU, aspxCommonObj, count);
         return(lstYouMayLike);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 25
0
        public List <CategoryInfo> GetAllCategoryForSearch(string prefix, bool isActive, AspxCommonInfo aspxCommonObj)
        {
            try
            {
                int itemID = 0;
                List <CategoryInfo> catList = new List <CategoryInfo>();

                if (!CacheHelper.Get("CategoryForSearch" + aspxCommonObj.StoreID.ToString() + aspxCommonObj.PortalID.ToString() + "_" + aspxCommonObj.CultureName, out catList))
                {
                    List <KeyValuePair <string, object> > parameterCollection = CommonParmBuilder.GetParamSPUC(aspxCommonObj);
                    parameterCollection.Add(new KeyValuePair <string, object>("@Prefix", prefix));
                    parameterCollection.Add(new KeyValuePair <string, object>("@IsActive", isActive));
                    parameterCollection.Add(new KeyValuePair <string, object>("@ItemID", itemID));
                    SQLHandler sqlH = new SQLHandler();
                    catList = sqlH.ExecuteAsList <CategoryInfo>("dbo.usp_Aspx_GetCategoryList",
                                                                parameterCollection);
                    CacheHelper.Add(catList, "CategoryForSearch" + aspxCommonObj.StoreID.ToString() + aspxCommonObj.PortalID.ToString() + "_" + aspxCommonObj.CultureName);
                }
                return(catList);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
 public void YouMayAlsoLikeSettingUpdate(string SettingValues, string SettingKeys, AspxCommonInfo aspxCommonObj)
 {
     try
     {
         AspxYouMayAlsoLikeProvider objYouMayLike = new AspxYouMayAlsoLikeProvider();
         objYouMayLike.YouMayAlsoLikeSettingUpdate(SettingValues, SettingKeys, aspxCommonObj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 27
0
        public List <CompareItemListInfo> GetCompareList(string itemIDs, string CostVariantValueIDs, AspxCommonInfo aspxCommonObj)
        {
            CompareItemProvider        provider    = new CompareItemProvider();
            List <CompareItemListInfo> lstCompItem = provider.GetCompareList(itemIDs, CostVariantValueIDs, aspxCommonObj);

            return(lstCompItem);
        }
 public List <AIMAuthorizeSettingInfo> GetAllAuthorizedNetAIMSetting(int paymentGatewayID, AspxCommonInfo aspxCommonObj)
 {
     try
     {
         List <KeyValuePair <string, object> > parameterCollection = new List <KeyValuePair <string, object> >();
         parameterCollection.Add(new KeyValuePair <string, object>("@PaymentGatewayTypeID", paymentGatewayID));
         parameterCollection.Add(new KeyValuePair <string, object>("@StoreID", aspxCommonObj.StoreID));
         parameterCollection.Add(new KeyValuePair <string, object>("@PortalID", aspxCommonObj.PortalID));
         SQLHandler sqLH = new SQLHandler();
         return(sqLH.ExecuteAsList <AIMAuthorizeSettingInfo>("usp_Aspx_AIMAuthorizeNETSettingsGetAll", parameterCollection));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 29
0
        public List <ItemBasicDetailsInfo> GetCompareListImage(string itemIDs, string CostVariantValueIDs, AspxCommonInfo aspxCommonObj)
        {
            CompareItemProvider         provider     = new CompareItemProvider();
            List <ItemBasicDetailsInfo> lstItemBasic = provider.GetCompareListImage(itemIDs, CostVariantValueIDs, aspxCommonObj);

            return(lstItemBasic);
        }
Esempio n. 30
0
    private void GetNewOrderRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
    {
        try
        {
            string             noImageUrl = string.Empty;
            StoreSettingConfig ssc        = new StoreSettingConfig();
            noImageUrl = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, aspxCommonObj.StoreID,
                                                   aspxCommonObj.PortalID, aspxCommonObj.CultureName);
            string[] path      = pageURL.Split('?');
            string   pagepath  = path[0];
            string   x         = HttpContext.Current.Request.ApplicationPath;
            string   authority = HttpContext.Current.Request.Url.Authority;
            string   pageUrl   = authority + x;
            List <RssFeedNewOrders> popularTagRss = AspxRssFeedProvider.GetNewOrdersRssContent(aspxCommonObj,
                                                                                               rssOption, count);
            foreach (RssFeedNewOrders rssItemData in popularTagRss)
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", "");
                rssXml.WriteElementString("link", " ");
                rssXml.WriteStartElement("description");

                var description = "";

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

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

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