當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。