Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
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;
                }
            }
        }
Exemplo n.º 3
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;
                }
            }
        }
Exemplo 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);
        }
Exemplo n.º 5
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;
            }
        }
Exemplo 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);
            }

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

            return(string.Empty);
        }
Exemplo n.º 7
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);
        }