private void cboSelectionType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UProductDiscountSelection 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();
        }
        private void cmdInterval_Click(object sender, RoutedEventArgs e)
        {
            MPackageDiscount v = (MPackageDiscount)ProductSelected;

            if (v == null)
            {
                return;
            }

            UProductDiscountSelection control = this;

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

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


                if (control.OnChanged != null)
                {
                    control.OnChanged(control, null);
                }
            }
        }
        private void lkupItem_SelectedObjectChanged(object sender, EventArgs e)
        {
            UProductDiscountSelection control = this;

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

            if (lkupItem != null)
            {
                updateObject();
            }
        }
        private void cbxEnable_Unchecked(object sender, RoutedEventArgs e)
        {
            UProductDiscountSelection control = this;

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

            MPackageDiscount v = (MPackageDiscount)ProductSelected;

            if (v == null)
            {
                return;
            }

            v.EnabledFlag = "N";
        }