Exemplo n.º 1
0
        private static void OnProductSelectedChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            UProductPriceDiscountTray control = obj as UProductPriceDiscountTray;
            MPackageTrayPriceDiscount d       = (MPackageTrayPriceDiscount)e.NewValue;

            updateGui(control, d);
        }
Exemplo n.º 2
0
        private void cboSelectionType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UProductPriceDiscountTray control = this;

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

            ComboBox cbo = sender as ComboBox;

            if (lkupItem != null)
            {
                if (cbo.SelectedIndex == 0)
                {
                    lkupItem.Lookup = LookupSearchType2.ServiceLookup;
                }
                else if (cbo.SelectedIndex == 1)
                {
                    lkupItem.Lookup = LookupSearchType2.InventoryItemLookup;
                }
                else if (cbo.SelectedIndex == 2)
                {
                    lkupItem.Lookup = LookupSearchType2.ItemCategoryLookup;
                }

                lkupItem.SelectedObject = null;
            }

            updateObject();
        }
Exemplo n.º 3
0
        private void lkupItem_SelectedObjectChanged(object sender, EventArgs e)
        {
            UProductPriceDiscountTray control = this;

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

            if (lkupItem != null)
            {
                updateObject();
            }
        }
Exemplo n.º 4
0
        private void cbxStdPrice_Unchecked(object sender, RoutedEventArgs e)
        {
            UProductPriceDiscountTray control = this;

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

            MPackageTrayPriceDiscount v = (MPackageTrayPriceDiscount)ProductSelected;

            if (v == null)
            {
                return;
            }

            v.StdPriceFlag = "N";
        }
Exemplo n.º 5
0
        private static void updateGui(UProductPriceDiscountTray control, MPackageTrayPriceDiscount v)
        {
            if (v == null)
            {
                return;
            }

            MPackageTrayPriceDiscount o = new MPackageTrayPriceDiscount(v.GetDbObject().Clone());

            control.cbxEnable.IsChecked            = o.EnabledFlag.Equals("Y");
            control.cboSelectionType.SelectedIndex = CUtil.StringToInt(o.SelectionType) - 1;
            //control.cbxStdPrice.IsChecked = o.StdPriceFlag.Equals("Y");

            if (o.SelectionType.Equals("1"))
            {
                control.lkupItem.Lookup         = LookupSearchType2.ServiceLookup;
                control.lkupItem.SelectedObject = o.ServiceObj;
            }
            else if (o.SelectionType.Equals("2"))
            {
                control.lkupItem.Lookup         = LookupSearchType2.InventoryItemLookup;
                control.lkupItem.SelectedObject = o.ItemObj;
            }
            else
            {
                control.lkupItem.Lookup         = LookupSearchType2.ItemCategoryLookup;
                control.lkupItem.SelectedObject = o.ItemCategoryObj;
            }

            //This function call only one at the beginning
            v.ExtFlag = "I";
            if (v.PackageTrayPriceID.Equals(""))
            {
                v.ExtFlag = "A";
            }
        }
Exemplo n.º 6
0
        private void cmdDiscInterval_Click(object sender, RoutedEventArgs e)
        {
            MPackageTrayPriceDiscount v = (MPackageTrayPriceDiscount)ProductSelected;

            if (v == null)
            {
                return;
            }

            UProductPriceDiscountTray control = this;

            WinAddEditIntervalConfigEx w = new WinAddEditIntervalConfigEx(v.DiscountDefination, v.Name, "DISCOUNT");

            w.ShowDialog();
            if (w.IsOK)
            {
                v.DiscountDefination = w.ConfigString;

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