public void listvariations_databound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { simplestecommerce.Variation v = (simplestecommerce.Variation)e.Item.DataItem; ((Label)e.Item.FindControl("lblnomevar")).Text = simplestecommerce.lingua.getforfrontendfromdb(v.Nome); ((HiddenField)e.Item.FindControl("hiddenidvar")).Value = v.Id.ToString(); DropDownList d = (DropDownList)e.Item.FindControl("dlistoptions"); bool first = true; foreach (simplestecommerce.Option o in v.Opzioni) { string segno; string testo = ""; string valore; double prezzo; prezzo = o.Prezzodoposcontoprodottoutentelistino; testo = simplestecommerce.lingua.getforfrontendfromdb(o.Testo); if (prezzo != 0) { segno = (prezzo > 0 ? "+" : "-"); testo += " " + segno + currencies.tostrusercurrency(prezzo); } valore = o.Id.ToString(); if (first) { d.Items.Add(new ListItem( simplestecommerce.lingua.getforfrontendbypseudo("article.options.select.option"), "-1")); } d.Items.Add(new ListItem(testo, valore)); first = false; } } }
public void listsamples_databound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { simplestecommerce.Variation v = (simplestecommerce.Variation)e.Item.DataItem; Literal lblsamples = (Literal)e.Item.FindControl("lblsamples"); bool hassamples = false; bool first = true; foreach (simplestecommerce.Option o in v.Opzioni) { if (o.Img.Length > 0) { hassamples = true; if (first) { lblsamples.Text += "<fieldset><legend>" + lingua.getforfrontendfromdb(v.Nome) + "</legend><table cellpadding=0 cellspacing=0><tr>"; } lblsamples.Text += "<td valign=bottom align=left nowrap><img src='" + ResolveUrl(o.Img) + "' width='30' height='30'><br>" + simplestecommerce.lingua.getforfrontendfromdb(o.Testo) + "</td><td width='10'> </td>"; first = false; } } if (hassamples) { lblsamples.Text += "</tr></table></fieldset>"; } } }