日期:2014-05-17 浏览次数:20500 次
/// <summary>
/// 创建控件
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
private string createControl(Model.ProductAttribute item)
{
string input = "";
if (item.OptionalType.Value == 0)
{
if (item.EntryType.Value == 0) /*input*/
{
input += string.Format("<div><input type=\"text\" class=\"ipt1\" name=\"attr_[{0}]\"/></div>", item.ID);
}
else if (item.EntryType.Value == 1)/*select*/
{
input += string.Format("<div><select name=\"attr_[{0}]\">", item.ID);
input += "<option value=\"请选择\">请选择</option>";
foreach (string option in Regex.Split(item.OptionalValueList, "\r\n"))
{
if (!string.IsNullOrEmpty(option))
{
input += "<option value=\"" + option + "\">" + option +