Esempio n. 1
0
        public virtual void APSalesPriceFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            APSalesPriceFilter row = (APSalesPriceFilter)e.Row;

            Records.Cache.AllowInsert     = row.VendorID != null && row.CuryID != null;
            Records.Cache.AllowUpdate     =
                Records.Cache.AllowDelete = row.VendorID != null;

            Vendor vend = (Vendor)PXParentAttribute.SelectParent(sender, e.Row, typeof(Vendor));

            if (vend != null)
            {
                PXUIFieldAttribute.SetEnabled <APSalesPriceFilter.curyID>(sender, e.Row, vend.CuryID == null || vend.AllowOverrideCury == true);
            }

            PXUIFieldAttribute.SetVisible <APSalesPrice.pendingBreakQty>(Records.Cache, null, row.PromotionalPrice == false);
            PXUIFieldAttribute.SetVisible <APSalesPrice.pendingPrice>(Records.Cache, null, row.PromotionalPrice == false);
            PXUIFieldAttribute.SetVisible <APSalesPrice.effectiveDate>(Records.Cache, null, row.PromotionalPrice == false);
            PXUIFieldAttribute.SetVisible <APSalesPrice.lastPrice>(Records.Cache, null, row.PromotionalPrice == false);
            PXUIFieldAttribute.SetVisible <APSalesPrice.lastBreakQty>(Records.Cache, null, row.PromotionalPrice == false);
            PXUIFieldAttribute.SetVisible <APSalesPrice.expirationDate>(Records.Cache, null, row.PromotionalPrice == true);

            PXUIFieldAttribute.SetEnabled <APSalesPrice.salesPrice>(Records.Cache, null, row.PromotionalPrice == true);
            PXUIFieldAttribute.SetEnabled <APSalesPrice.breakQty>(Records.Cache, null, row.PromotionalPrice == true);
            PXUIFieldAttribute.SetEnabled <APSalesPrice.lastDate>(Records.Cache, null, row.PromotionalPrice == true);

            PXUIFieldAttribute.SetEnabled(sender, e.Row, typeof(TM.OwnedFilter.ownerID).Name, e.Row == null || (bool?)sender.GetValue(e.Row, typeof(TM.OwnedFilter.myOwner).Name) == false);
            PXUIFieldAttribute.SetEnabled(sender, e.Row, typeof(TM.OwnedFilter.workGroupID).Name, e.Row == null || (bool?)sender.GetValue(e.Row, typeof(TM.OwnedFilter.myWorkGroup).Name) == false);

            update.SetEnabled(row.PromotionalPrice != true);
        }
Esempio n. 2
0
        public virtual void APSalesPriceFilter_VendorID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            APSalesPriceFilter row = e.Row as APSalesPriceFilter;

            if (row != null)
            {
                Vendor vend = (Vendor)PXParentAttribute.SelectParent(sender, e.Row, typeof(Vendor));
                if (vend != null)
                {
                    row.CuryID = vend.CuryID;
                }
            }
        }