protected ActionResult ToComboxResult(IEnumerable <ComboxItem> items) { return(new ContentResult() { Content = Combox.ToJson(items) }); }
private void cmbCurrencyType_SelectionChanged(object sender, SelectionChangedEventArgs e) { Combox cmb = sender as Combox; if (null != cmb) { OnCurrencySelected((CurrencyInfo)cmb.SelectedItem); } }
public void TestToJson() { var list = new List <ComboxItem>(); list.Add(new ComboxItem("a1", 1, "a")); list.Add(new ComboxItem("a2", 2, "a")); list.Add(new ComboxItem("b1", 3, "b")); list.Add(new ComboxItem("b2", 4, "b")); var result = new Str(); result.Add("["); result.Add("{\"value\":1,\"text\":\"a1\",\"group\":\"a\"},"); result.Add("{\"value\":2,\"text\":\"a2\",\"group\":\"a\"},"); result.Add("{\"value\":3,\"text\":\"b1\",\"group\":\"b\"},"); result.Add("{\"value\":4,\"text\":\"b2\",\"group\":\"b\"}"); result.Add("]"); Assert.AreEqual(result.ToString(), Combox.ToJson(list)); }
private void PriceType_Changed(object sender, RoutedEventArgs e) { Combox cb = sender as Combox; if (cb.SelectedValue != null) { foreach (var item in this.vm.ItemList) { item.PriceType = (RequestPriceType?)cb.SelectedValue; } if ((RequestPriceType)cb.SelectedValue == RequestPriceType.PurchasePrice) { this.productgd.Columns[5].Visibility = System.Windows.Visibility.Collapsed; } else if ((RequestPriceType)cb.SelectedValue == RequestPriceType.SalePrice) { this.productgd.Columns[5].Visibility = System.Windows.Visibility.Visible; } } }
public void TestInit() { _combox = new Combox(); }