Example #1
0
 public void RUTROTDeductibleUpdated(IRUTROTable row, IRUTROTable oldRow, RUTROT rutrot)
 {
     if (row != null && oldRow?.IsRUTROTDeductible != row.IsRUTROTDeductible)
     {
         if ((rutrot == null || rutrot.RefNbr == null) && row.IsRUTROTDeductible == true)
         {
             rutrot = (RUTROT)Rutrots.Insert(new RUTROT());
         }
         else if (row.IsRUTROTDeductible != true)
         {
             Rutrots.Delete(rutrot);
         }
     }
 }
Example #2
0
 private void RUTROTDeductibleUpdated(IRUTROTable row, IRUTROTable oldRow, RUTROT rutrot)
 {
     if (row != null)
     {
         if (oldRow?.IsRUTROTDeductible != row.IsRUTROTDeductible)
         {
             if ((rutrot == null || rutrot.RefNbr == null) && row.IsRUTROTDeductible == true)
             {
                 rutrot = (RUTROT)Rutrots.Insert(new RUTROT());
             }
             else if (row.IsRUTROTDeductible != true)
             {
                 Rutrots.Delete(rutrot);
             }
         }
         else if (row.IsRUTROTDeductible == true && rutrot != null && Rutrots.Cache.GetStatus(rutrot) == PXEntryStatus.Notchanged)
         {
             //we need this to raise RowPersisting on RUTROT even it was not changed
             Rutrots.Cache.SetStatus(rutrot, PXEntryStatus.Updated);
         }
     }
 }
        public virtual void UnlockInventory(bool deleteLock = true)
        {
            _inPIStatusItem.Cache.Clear();
            foreach (PXResult <INPIStatusItem> it in PXSelect <INPIStatusItem,
                                                               Where <INPIStatusItem.pIID, Equal <Required <INPIStatusItem.pIID> > > > .Select(_graph, _piId))
            {
                if (deleteLock)
                {
                    _inPIStatusItem.Delete(it);
                }
                else
                {
                    INPIStatusItem upd = PXCache <INPIStatusItem> .CreateCopy(it);

                    upd.Active = false;
                    _inPIStatusItem.Update(upd);
                }
            }

            _inPIStatusLocation.Cache.Clear();
            foreach (PXResult <INPIStatusLoc> it in PXSelect <INPIStatusLoc,
                                                              Where <INPIStatusLoc.pIID, Equal <Required <INPIStatusLoc.pIID> > > > .Select(_graph, _piId))
            {
                if (deleteLock)
                {
                    _inPIStatusLocation.Delete(it);
                }
                else
                {
                    INPIStatusLoc upd = PXCache <INPIStatusLoc> .CreateCopy(it);

                    upd.Active = false;
                    _inPIStatusLocation.Update(upd);
                }
            }
        }