Esempio n. 1
0
 private void Init()
 {
     this.Id             = 0;
     this.StoreId        = 0;
     this.CustomerId     = string.Empty;
     this.LastUpdatedUtc = DateTime.UtcNow;
     this.ProductId      = string.Empty;
     this.Quantity       = 1;
     this.SelectionData  = new Catalog.OptionSelectionList();
 }
Esempio n. 2
0
 private void Init()
 {
     this.Id = 0;
     this.StoreId = 0;
     this.CustomerId = string.Empty;
     this.LastUpdatedUtc = DateTime.UtcNow;
     this.ProductId = string.Empty;
     this.Quantity = 1;
     this.SelectionData = new Catalog.OptionSelectionList();
 }
Esempio n. 3
0
        public static string ProductOptions(Catalog.OptionList options, Catalog.OptionSelectionList selections)
        {
            StringBuilder sb = new StringBuilder();

            foreach (Catalog.Option opt in options)
            {
                if (!opt.NameIsHidden)
                {
                    sb.Append("<label for=\"" + opt.Bvin.Replace("-", "") + "\">");
                    sb.Append(opt.Name);
                    sb.Append("</label>");
                }
                sb.Append("<span class=\"choice\">");
                sb.Append(opt.RenderWithSelection(selections));
                sb.Append("</span>");
            }

            return(sb.ToString());
        }
Esempio n. 4
0
        public string CartDescription(Option baseOption, Catalog.OptionSelectionList selections)
        {
            if (selections == null)
            {
                return(string.Empty);
            }
            OptionSelection val = selections.FindByOptionId(baseOption.Bvin);

            if (val == null)
            {
                return(string.Empty);
            }

            if (val.SelectionData.Trim().Length > 0)
            {
                return(baseOption.Name + ": " + System.Web.HttpUtility.HtmlEncode(val.SelectionData));
            }

            return(string.Empty);
        }
Esempio n. 5
0
        public string CartDescription(Option baseOption, Catalog.OptionSelectionList selections)
        {
            if (selections == null)
            {
                return(string.Empty);
            }
            OptionSelection val = selections.FindByOptionId(baseOption.Bvin);

            if (val == null)
            {
                return(string.Empty);
            }

            foreach (OptionItem oi in baseOption.Items)
            {
                string cleaned = OptionSelection.CleanBvin(oi.Bvin);
                if (cleaned == val.SelectionData)
                {
                    return(baseOption.Name + ": " + oi.Name);
                }
            }

            return(string.Empty);
        }
Esempio n. 6
0
        public string CartDescription(Option baseOption, Catalog.OptionSelectionList selections)
        {
            if (selections == null)
            {
                return(string.Empty);
            }
            OptionSelection val = selections.FindByOptionId(baseOption.Bvin);

            if (val == null)
            {
                return(string.Empty);
            }
            string[] vals = val.SelectionData.Split(',');

            string result = baseOption.Name + ": ";
            bool   first  = true;

            foreach (OptionItem oi in baseOption.Items)
            {
                string cleaned = OptionSelection.CleanBvin(oi.Bvin);
                if (vals.Contains(cleaned))
                {
                    if (!first)
                    {
                        result += ", ";
                    }
                    else
                    {
                        first = false;
                    }
                    result += oi.Name;
                }
            }

            return(result);
        }
Esempio n. 7
0
        public void SetSelectionsInPlaceholder(Option baseOption, System.Web.UI.WebControls.PlaceHolder ph, Catalog.OptionSelectionList selections)
        {
            if (ph == null)
            {
                return;
            }
            if (selections == null)
            {
                return;
            }
            OptionSelection val = selections.FindByOptionId(baseOption.Bvin);

            if (val == null)
            {
                return;
            }

            System.Web.UI.WebControls.TextBox tb = (System.Web.UI.WebControls.TextBox)ph.FindControl("opt" + baseOption.Bvin.Replace("-", ""));
            if (tb != null)
            {
                tb.Text = val.SelectionData;
            }
        }
Esempio n. 8
0
 public string CartDescription(Catalog.OptionSelectionList selections)
 {
     return(this.Processor.CartDescription(this, selections));
 }
Esempio n. 9
0
 public void SetSelectionsInPlaceholder(System.Web.UI.WebControls.PlaceHolder ph, Catalog.OptionSelectionList selections)
 {
     this.Processor.SetSelectionsInPlaceholder(this, ph, selections);
 }
Esempio n. 10
0
 public string CartDescription(Option baseOption, Catalog.OptionSelectionList selections)
 {
     return(string.Empty);
 }
Esempio n. 11
0
 public void SetSelectionsInPlaceholder(Option baseOption, System.Web.UI.WebControls.PlaceHolder ph, Catalog.OptionSelectionList selections)
 {
     // do nothing;
 }
Esempio n. 12
0
        public void SetSelectionsInPlaceholder(Option baseOption, System.Web.UI.WebControls.PlaceHolder ph, Catalog.OptionSelectionList selections)
        {
            if (ph == null)
            {
                return;
            }
            if (selections == null)
            {
                return;
            }
            OptionSelection val = selections.FindByOptionId(baseOption.Bvin);

            if (val == null)
            {
                return;
            }

            string radioId = "opt" + val.SelectionData.Replace("-", "");

            System.Web.UI.HtmlControls.HtmlInputRadioButton rb = (System.Web.UI.HtmlControls.HtmlInputRadioButton)ph.FindControl(radioId);
            if (rb != null)
            {
                rb.Checked = true;
            }
        }
Esempio n. 13
0
        public void SetSelectionsInPlaceholder(Option baseOption, System.Web.UI.WebControls.PlaceHolder ph, Catalog.OptionSelectionList selections)
        {
            if (ph == null)
            {
                return;
            }
            if (selections == null)
            {
                return;
            }
            OptionSelection val = selections.FindByOptionId(baseOption.Bvin);

            if (val == null)
            {
                return;
            }

            string[] vals = val.SelectionData.Split(',');
            foreach (string s in vals)
            {
                string checkId = "opt" + s.Replace("-", "");
                System.Web.UI.HtmlControls.HtmlInputCheckBox cb = (System.Web.UI.HtmlControls.HtmlInputCheckBox)ph.FindControl(checkId);
                if (cb != null)
                {
                    cb.Checked = true;
                }
            }
        }
Esempio n. 14
0
        public void SetSelectionsInPlaceholder(Option baseOption, System.Web.UI.WebControls.PlaceHolder ph, Catalog.OptionSelectionList selections)
        {
            if (ph == null)
            {
                return;
            }
            if (selections == null)
            {
                return;
            }
            OptionSelection val = selections.FindByOptionId(baseOption.Bvin);

            if (val == null)
            {
                return;
            }

            System.Web.UI.WebControls.DropDownList ddl = (System.Web.UI.WebControls.DropDownList)ph.FindControl("opt" + baseOption.Bvin.Replace("-", ""));
            if (ddl != null)
            {
                if (ddl.Items.FindByValue(val.SelectionData) != null)
                {
                    ddl.ClearSelection();
                    ddl.Items.FindByValue(val.SelectionData).Selected = true;
                }
            }
        }