本文整理汇总了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;
}
示例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;
}
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
}
}