public bool IsOptionSelected(ActiveProductAttribute apo, IAttributeOption ao, IActiveProductAttribute a) { if (apo.Name == a.Name && apo.AttributeOptionList.Count > 0) { foreach (AttributeOption lee in apo.AttributeOptionList) { if (lee.ShortCode == ao.ShortCode) { return true; } } } return false; }
public decimal UpdateOptionPrice(ActiveProductAttribute apo, IAttributeOption ao, IActiveProductAttribute a) { if (apo.Name == a.Name && apo.AttributeOptionList.Count > 0) { foreach (AttributeOption lee in apo.AttributeOptionList) { if (lee.ShortCode == ao.ShortCode) { ao.Price = lee.Price; } } } return ao.Price; }
public void CreateOptionFields(IAttributeOption ao, bool IsSelected, string dataType) { HtmlGenericControl lblCol = new HtmlGenericControl(); lblCol.InnerHtml = "<tr><td>"; plhAttributeEditor.Controls.Add(lblCol); CheckBox rb = new CheckBox(); rb.Text = ao.PickListValue; rb.ID = "option" + ao.ShortCode; if (ao.Price > 0 || IsSelected) { rb.Checked = true; } plhAttributeEditor.Controls.Add(rb); TextBox txtPrice = new TextBox(); txtPrice.Text = ao.Price.ToString(); txtPrice.ID = "txt" + ao.ShortCode; HtmlGenericControl lblColMiddle = new HtmlGenericControl(); lblColMiddle.InnerHtml = "</td><td>"; plhAttributeEditor.Controls.Add(lblColMiddle); plhAttributeEditor.Controls.Add(txtPrice); HtmlGenericControl lblColEnd = new HtmlGenericControl(); lblColEnd.InnerHtml = "</td>"; plhAttributeEditor.Controls.Add(lblColEnd); }