private void DisplayVariant(Entry entry) { if (entry.Entries.Entry != null) { var variants = new Entry[] { entry }.Select(e => new { DisplayText = e.Name + " (" + e.ID + ")" }); VariantsList.DataSource = variants; VariantPanel.Visible = true; BindSkus(new Entry[] { entry }); BindPrices(); } VariantsList.DataBind(); }
void InitialFillTest() { VariantsList.Clear(); TranslationOneColor = Color.FromArgb(255, 0, 0, 0); TranslationTwoColor = Color.FromArgb(255, 0, 0, 0); TranslationThreeColor = Color.FromArgb(255, 0, 0, 0); TranslationFourColor = Color.FromArgb(255, 0, 0, 0); Term = TermList[InitialFillTestIndex].Remove(TermList[InitialFillTestIndex].Length - 2); VariantsList.Add(new Dictionary <string, bool> { { TranslationList[InitialFillTestIndex], true } }); List <int> indexesList = new List <int>(); indexesList.Add(InitialFillTestIndex); int translationIndex = 0; int tempIndex = 0; Random rnd = new Random(); for (int i = 0; i < 3; i++) { AnotherIndex: tempIndex = rnd.Next(0, TermList.Count - 1); if (!indexesList.Contains(tempIndex)) { translationIndex = tempIndex; indexesList.Add(tempIndex); } else { goto AnotherIndex; } VariantsList.Add(new Dictionary <string, bool> { { TranslationList[translationIndex], false } }); } VariantsList.Shuffle(); TranslationOne = VariantsList[0]; TranslationTwo = VariantsList[1]; TranslationThree = VariantsList[2]; TranslationFour = VariantsList[3]; TranslationClickCanExecute = true; InitialFillTestIndex += 1; }
private void DisplayStyle(Entry entry) { StyleNameValue.Text = entry.Name; StylePanel.Visible = true; if (entry.Entries.Entry != null) { var variants = entry.Entries.Entry.Select(e => new { DisplayText = e.Name + " (" + e.ID + ")" }); VariantsList.DataSource = variants; VariantPanel.Visible = true; BindSkus(entry.Entries.Entry); BindPrices(); } VariantsList.DataBind(); }