コード例 #1
0
        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;
        }
コード例 #2
0
        private static void OnProductSelectedChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            UProductTestSelect control = obj as UProductTestSelect;
            MSelectedItem      d       = (MSelectedItem)e.NewValue;

            updateGui(control, d);
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        private void txtValue_TextChanged(object sender, TextChangedEventArgs e)
        {
            UProductTestSelect control = this;

            if (control.OnChanged != null)
            {
                control.OnChanged(control, null);
            }

            updateObject();
        }
コード例 #5
0
        private void lkupItem_SelectedObjectChanged(object sender, EventArgs e)
        {
            UProductTestSelect control = this;

            if (control.OnChanged != null)
            {
                control.OnChanged(control, null);
            }

            if (lkupItem != null)
            {
                updateObject();
            }
        }
コード例 #6
0
        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";
        }