private void updateObject()
        {
            MPackageBundle v = (MPackageBundle)ProductSelected;

            if (v == null)
            {
                return;
            }

            v.ServiceObj      = null;
            v.ItemObj         = null;
            v.ItemCategoryObj = null;

            if (lkupItem.SelectedObject != null)
            {
                if (lkupItem.Lookup == LookupSearchType2.ServiceLookup)
                {
                    v.ServiceObj    = lkupItem.SelectedObject;
                    v.SelectionType = "1";
                }
                else if (lkupItem.Lookup == LookupSearchType2.InventoryItemLookup)
                {
                    v.ItemObj       = lkupItem.SelectedObject;
                    v.SelectionType = "2";
                }
                else if (lkupItem.Lookup == LookupSearchType2.ItemCategoryLookup)
                {
                    v.ItemCategoryObj = lkupItem.SelectedObject;
                    v.SelectionType   = "3";
                }
            }

            v.Quantity = txtQuantity.Text;
        }
        private static void OnProductSelectedChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            UProductBundleSelection control = obj as UProductBundleSelection;
            MPackageBundle          d       = (MPackageBundle)e.NewValue;

            updateGui(control, d);
        }
Beispiel #3
0
        private void cmdBundleDelete_Click(object sender, RoutedEventArgs e)
        {
            MPackageBundle pp = (MPackageBundle)(sender as Button).Tag;

            vw.RemoveBundleItem(pp);

            vw.IsModified = true;
        }
Beispiel #4
0
        private void cmdBundleAdd_Click(object sender, RoutedEventArgs e)
        {
            MPackageBundle pp = new MPackageBundle(new CTable(""));

            pp.EnabledFlag   = "Y";
            pp.SelectionType = "1";
            vw.AddBundleItem(pp);

            vw.IsModified = true;
        }
Beispiel #5
0
        public CPackageItemAdapter(MBaseModel vw)
        {
            item = vw;

            if (item is MPackageBonus)
            {
                bonus = (MPackageBonus)item;
            }
            else if (item is MPackageBundle)
            {
                bundle = (MPackageBundle)item;
            }
            else if (item is MPackageVoucher)
            {
                voucher = (MPackageVoucher)item;
            }
        }
        private void cbxEnable_Unchecked(object sender, RoutedEventArgs e)
        {
            UProductBundleSelection control = this;

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

            MPackageBundle v = (MPackageBundle)ProductSelected;

            if (v == null)
            {
                return;
            }

            v.EnabledFlag = "N";
        }
        private static void updateGui(UProductBundleSelection control, MPackageBundle v)
        {
            if (v == null)
            {
                return;
            }

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

            control.cbxEnable.IsChecked = o.EnabledFlag.Equals("Y");
            int selectionType = CUtil.StringToInt(o.SelectionType);

            control.cboSelectionType.SelectedIndex = selectionType - 1;

            if (selectionType == 1)
            {
                control.lkupItem.SelectedObject = o.ServiceObj;
            }
            else if (selectionType == 2)
            {
                control.lkupItem.SelectedObject = o.ItemObj;
            }
            else if (selectionType == 3)
            {
                control.lkupItem.SelectedObject = o.ItemCategoryObj;
            }
            else
            {
                control.lkupItem.SelectedObject = o.ServiceObj;
            }

            control.txtQuantity.Text = o.Quantity;

            v.ExtFlag = "I";
            if (v.PackageBundleID.Equals(""))
            {
                v.ExtFlag = "A";
            }
        }