Esempio n. 1
0
        private void VerifyXRefUOMExists(PXCache sender, INItemXRef row)
        {
            var item = Item.Current;

            sender.RaiseExceptionHandling <INItemXRef.uOM>(
                row,
                row.UOM,
                itemunits.Select()
                .RowCast <INUnit>()
                .Select(u => u.FromUnit)
                .Concat(new[] { null, item.BaseUnit })
                .Contains(row.UOM)
                                        ? null
                                        : new PXSetPropertyException(Messages.UOMAssignedToAltIDIsNotDefined, PXErrorLevel.Warning));
        }
        protected virtual void INSubItem_RowDeleting(PXCache sender, PXRowDeletingEventArgs e)
        {
            INSubItem row = e.Row as INSubItem;

            if (row != null)
            {
                INSiteStatus status = PXSelect <INSiteStatus, Where <INSiteStatus.subItemID, Equal <Required <INSubItem.subItemID> > > > .SelectWindowed(this, 0, 1, row.SubItemID);

                if (status != null)
                {
                    throw new PXSetPropertyException(Messages.SubitemDeleteError);
                }

                INItemXRef itemRef = PXSelect <INItemXRef, Where <INItemXRef.subItemID, Equal <Required <INSubItem.subItemID> > > > .SelectWindowed(this, 0, 1, row.SubItemID);

                if (itemRef != null)
                {
                    throw new PXSetPropertyException(Messages.SubitemDeleteError);
                }
            }
        }