private static void updateGui(UProductTestSelect control, MSelectedItem v) { if (v == null) { return; } MSelectedItem o = new MSelectedItem(v.GetDbObject().Clone()); control.cbxEnable.IsChecked = o.EnabledFlag.Equals("Y"); control.cbxTray.IsChecked = o.TrayFlag.Equals("Y"); int selectionType = CUtil.StringToInt(o.SelectionType); control.cboSelectionType.SelectedIndex = selectionType - 1; if (o.SelectionType.Equals("1")) { control.lkupItem.SelectedObject = o.ServiceObj; } else if (o.SelectionType.Equals("2")) { control.lkupItem.SelectedObject = o.ItemObj; } else { control.lkupItem.SelectedObject = o.ServiceObj; } control.txtValue.Text = o.ItemQuantity; }
private static void OnProductSelectedChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { UProductTestSelect control = obj as UProductTestSelect; MSelectedItem d = (MSelectedItem)e.NewValue; updateGui(control, d); }
private void cboSelectionType_SelectionChanged(object sender, SelectionChangedEventArgs e) { UProductTestSelect control = this; if (control.OnChanged != null) { control.OnChanged(control, null); } ComboBox cbo = sender as ComboBox; if (lkupItem != null) { lkupItem.Lookup = LookupSearchType2.ServiceLookup; lkupItem.SelectedObject = null; } if (cbo.SelectedIndex == 0) { lkupItem.Lookup = LookupSearchType2.ServiceLookup; } else if (cbo.SelectedIndex == 1) { lkupItem.Lookup = LookupSearchType2.InventoryItemLookup; } lkupItem.SelectedObject = null; updateObject(); }
private void txtValue_TextChanged(object sender, TextChangedEventArgs e) { UProductTestSelect control = this; if (control.OnChanged != null) { control.OnChanged(control, null); } updateObject(); }
private void lkupItem_SelectedObjectChanged(object sender, EventArgs e) { UProductTestSelect control = this; if (control.OnChanged != null) { control.OnChanged(control, null); } if (lkupItem != null) { updateObject(); } }
private void cbxEnable_Checked(object sender, RoutedEventArgs e) { UProductTestSelect control = this; if (control.OnChanged != null) { control.OnChanged(control, null); } MSelectedItem v = (MSelectedItem)ProductSelected; if (v == null) { return; } v.EnabledFlag = "Y"; }