private static void updateGui(UPostGiftBuySelection control, MPackageVoucher v)
        {
            if (v == null)
            {
                return;
            }

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

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

            control.cboSelectionType.SelectedIndex = selectionType - 1;

            MMasterRef mr = CUtil.MasterIDToObject(CMasterReference.Instance.ProductSpecificSelectionTypes, o.SelectionType);

            if (mr != null)
            {
                if (mr.MasterID.Equals("1"))
                {
                    control.lkupItem.Lookup         = LookupSearchType2.ServiceLookup;
                    control.lkupItem.SelectedObject = o.ServiceObj;
                }
                else if (mr.MasterID.Equals("2"))
                {
                    control.lkupItem.Lookup         = LookupSearchType2.InventoryItemLookup;
                    control.lkupItem.SelectedObject = o.ItemObj;
                }
                else
                {
                    control.lkupItem.Lookup         = LookupSearchType2.ServiceLookup;
                    control.lkupItem.SelectedObject = o.ServiceObj;
                }
            }

            control.txtQuantity.Text = o.Quantity;

            v.ExtFlag = "I";
            if (v.PackageVoucherID.Equals(""))
            {
                v.ExtFlag = "A";
            }
        }
Beispiel #2
0
        private static void updateGui(UVoucherBuyProduct control, MPackageVoucher v)
        {
            if (v == null)
            {
                return;
            }

            MPackageVoucher o = new MPackageVoucher(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.PackageVoucherID.Equals(""))
            {
                v.ExtFlag = "A";
            }
        }
Beispiel #3
0
        private static void updateGui(UVoucherFreeProduct control, MPackageVoucher v)
        {
            if (v == null)
            {
                return;
            }


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

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

            int i = 1;

            if (selectionType >= 4)
            {
                i = 2;
            }
            control.cboSelectionType.SelectedIndex = selectionType - i;

            control.stackValue.Visibility = Visibility.Visible;
            control.stackOther.Visibility = Visibility.Collapsed;

            if (selectionType == 1)
            {
                control.lkupItem.Lookup         = LookupSearchType2.ServiceLookup;
                control.lkupItem.SelectedObject = o.ServiceObj;
            }
            else if (selectionType == 2)
            {
                control.lkupItem.Lookup         = LookupSearchType2.InventoryItemLookup;
                control.lkupItem.SelectedObject = o.ItemObj;
            }
            else if (selectionType == 3)
            {
                control.lkupItem.Lookup         = LookupSearchType2.ItemCategoryLookup;
                control.lkupItem.SelectedObject = o.ItemCategoryObj;
            }
            //else if (selectionType == 4)
            //{
            //    control.lkupItem.Lookup = LookupSearchType2.VoucherLookup;
            //    control.lkupItem.SelectedObject = o.VoucherObj;
            //}
            else if (selectionType == 5)
            {
                control.stackValue.Visibility = Visibility.Collapsed;
                control.stackOther.Visibility = Visibility.Visible;
            }
            else
            {
                control.lkupItem.Lookup         = LookupSearchType2.ServiceLookup;
                control.lkupItem.SelectedObject = o.ServiceObj;
            }

            control.txtQuantity.Text = o.Quantity;
            control.txtOther.Text    = o.FreeText;

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