当前位置: 首页>>代码示例>>C#>>正文


C# Catalog.FindByOptionId方法代码示例

本文整理汇总了C#中Catalog.FindByOptionId方法的典型用法代码示例。如果您正苦于以下问题:C# Catalog.FindByOptionId方法的具体用法?C# Catalog.FindByOptionId怎么用?C# Catalog.FindByOptionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Catalog的用法示例。


在下文中一共展示了Catalog.FindByOptionId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CartDescription

        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;
        }
开发者ID:mcastells,项目名称:MerchantTribe,代码行数:17,代码来源:RadioButtonList.cs

示例2: SetSelectionsInPlaceholder

        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;
                }                
            }            
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:17,代码来源:DropDownList.cs

示例3: SetSelectionsInPlaceholder

        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;
            }            
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:14,代码来源:RadioButtonList.cs

示例4: CartDescription

        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;
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:13,代码来源:TextInput.cs

示例5: SetSelectionsInPlaceholder

        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;                
            }

        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:14,代码来源:TextInput.cs

示例6: CartDescription

        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;
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:23,代码来源:CheckBoxes.cs

示例7: SetSelectionsInPlaceholder

        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;
                }            
            }                                           
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:18,代码来源:CheckBoxes.cs


注:本文中的Catalog.FindByOptionId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。