public override void RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
 {
     if (_IsIntegrityCheck == false)
     {
         base.RowPersisted(sender, e);
     }
 }
        protected void EPEquipment_RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            if (e.TranStatus == PXTranStatus.Open)
            {
                EPEquipment epEquipmentRow = (EPEquipment)e.Row;
                FSEquipment fsEquipmentRow = GetRelatedFSEquipmentRow(cache.Graph);

                if (fsEquipmentRow != null)
                {
                    PXCache <FSEquipment> cacheFSEquipment = new PXCache <FSEquipment>(Base);

                    // This is to prevent an error on the FSEquipment cache trying to change a common field (status, description)
                    // after extending an equipment to FSEquipment.
                    cacheFSEquipment.Graph.SelectTimeStamp();

                    if (EquipmentHelper.UpdateFSEquipmentWithEPEquipment(cacheFSEquipment, fsEquipmentRow, cache, epEquipmentRow))
                    {
                        cacheFSEquipment.Update(fsEquipmentRow);
                        cacheFSEquipment.Persist(PXDBOperation.Update);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 protected virtual void Country_RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
 {
     if (e.TranStatus == PXTranStatus.Completed)
     {
         PXZipValidationAttribute.Clear <Country>();
     }
 }
 public virtual void RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
 {
     if (e.TranStatus == PXTranStatus.Open)
     {
         List <PXDataFieldAssign> field = new List <PXDataFieldAssign>();
         PXDatabase.Insert <ARInvoiceNbr>(fields.ToArray());
     }
 }
Ejemplo n.º 5
0
 protected virtual void INTranSplit_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
 {
     //for cluster only. SelectQueries sometimes does not contain all the needed records after failed Save operation
     if (e.TranStatus == PXTranStatus.Aborted && PX.Common.WebConfig.IsClusterEnabled)
     {
         sender.ClearQueryCacheObsolete();
     }
 }
Ejemplo n.º 6
0
        public virtual void CATran_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            PXCache cache = sender.Graph.Caches[_ChildType];
            long?   newKey;

            if (e.Operation == PXDBOperation.Insert && e.TranStatus == PXTranStatus.Open && _SelfKeyToAbort != null)
            {
                newKey = (long?)sender.GetValue <CATran.tranID>(e.Row);

                if (!_persisted.ContainsKey(newKey))
                {
                    _persisted.Add(newKey, _SelfKeyToAbort);
                }

                foreach (object item in cache.Inserted)
                {
                    if ((long?)cache.GetValue(item, _FieldOrdinal) == (long?)_SelfKeyToAbort)
                    {
                        cache.SetValue(item, _FieldOrdinal, newKey);
                    }
                }

                foreach (object item in cache.Updated)
                {
                    if ((long?)cache.GetValue(item, _FieldOrdinal) == (long?)_SelfKeyToAbort)
                    {
                        cache.SetValue(item, _FieldOrdinal, newKey);
                    }
                }

                _SelfKeyToAbort = null;
            }

            if (e.Operation == PXDBOperation.Insert && e.TranStatus == PXTranStatus.Aborted)
            {
                foreach (object item in cache.Inserted)
                {
                    if ((newKey = (long?)cache.GetValue(item, _FieldOrdinal)) != null && _persisted.TryGetValue(newKey, out _SelfKeyToAbort))
                    {
                        cache.SetValue(item, _FieldOrdinal, _SelfKeyToAbort);
                    }
                }

                foreach (object item in cache.Updated)
                {
                    if ((newKey = (long?)cache.GetValue(item, _FieldOrdinal)) != null && _persisted.TryGetValue(newKey, out _SelfKeyToAbort))
                    {
                        cache.SetValue(item, _FieldOrdinal, _SelfKeyToAbort);
                    }
                }
            }

            if (e.TranStatus != PXTranStatus.Open)
            {
                _KeyToAbort     = null;
                _SelfKeyToAbort = null;
            }
        }
Ejemplo n.º 7
0
        protected virtual void ARDiscount_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            if ((e.Operation & PXDBOperation.Delete) == PXDBOperation.Delete && e.TranStatus == PXTranStatus.Open)
            {
                RemoveChildReferences((ARDiscount)e.Row);
            }

            DiscountEngine.GetDiscountTypes(true);
        }
 public override void RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
 {
     if (IsTopLevel && e.TranStatus != PXTranStatus.Open)
     {
         PXCache cache = sender.Graph.Caches[typeof(CurrencyInfo)];
         cache.Persisted(e.TranStatus == PXTranStatus.Aborted);
     }
     base.RowPersisted(sender, e);
 }
        protected virtual void CRActivity_RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
        {
            if (e.TranStatus == PXTranStatus.Open)
            {
                CRActivity crActivityRow = (CRActivity)e.Row;

                UpdateServiceOrderDetail(cache, crActivityRow, e.Operation);
            }
        }
Ejemplo n.º 10
0
        public virtual void InventoryItem_RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            SharedFunctions.PropagateBaseUnitToContracts(cache, (InventoryItem)e.Row, e.TranStatus, e.Operation, baseUnitChanged);
        }
Ejemplo n.º 11
0
        public void INLocation_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            if (e.TranStatus != PXTranStatus.Completed)
            {
                return;
            }

            var graph = new PXGraph();
        }
Ejemplo n.º 12
0
        public void INLocation_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            if (e.TranStatus != PXTranStatus.Completed)
            {
                return;
            }

            var orderMaint = new SOOrderEntry();
        }
Ejemplo n.º 13
0
        protected override void Location_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            base.Location_RowPersisted(sender, e);

            if (e.TranStatus == PXTranStatus.Completed)
            {
                DiscountEngine.RemoveFromCachedCustomerPriceClasses(((Location)e.Row).BAccountID);
            }
        }
        protected virtual void SOOrderType_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            SOOrderType r = e.Row as SOOrderType;

            if (e.Exception != null && e.Operation == PXDBOperation.Insert && r != null && r.Template == r.OrderType)
            {
                r.Template = null;
            }
        }
Ejemplo n.º 15
0
        public void INLocation_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            if (e.TranStatus != PXTranStatus.Completed)
            {
                return;
            }

            var orderMaint = PXGraph.CreateInstance <SOOrderEntry>();
        }
Ejemplo n.º 16
0
        protected virtual void EPAssignmentRoute_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            EPAssignmentRoute row = (EPAssignmentRoute)e.Row;

            if (row == current && e.TranStatus == PXTranStatus.Completed)
            {
                PositionFilter.Current.MapID  = row.AssignmentMapID;
                PositionFilter.Current.NodeID = row.AssignmentRouteID;
            }
        }
Ejemplo n.º 17
0
        public virtual void VendorClass_RowPersisted(PXCache cache, PXRowPersistedEventArgs args)
        {
            var status = cache.GetStatus(args.Row);

            if (status == PXEntryStatus.Inserted && IsAddVendorClassConfirmed() &&
                LienWaiverRecipientProjects.AskExt(true).IsPositive())
            {
                LienWaiverRecipientProjects.SelectMain().ForEach(MaintainLienWaiverRecipientsLinks);
            }
        }
Ejemplo n.º 18
0
 public virtual void RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
 {
     if ((e.Operation & PXDBOperation.Command) == PXDBOperation.Insert &&
         e.TranStatus == PXTranStatus.Aborted)
     {
         sender.SetValue(e.Row, _FieldOrdinal, NewValue);
         Type setupType = BqlCommand.GetItemType(_AutoNumberingField);
         sender.Graph.Caches[setupType].Clear();
     }
 }
        protected virtual void FSWFStage_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            FSWFStage fsWFStageRow = (FSWFStage)e.Row;

            if (fsWFStageRow == fsWFStageRow_Current && e.TranStatus == PXTranStatus.Completed)
            {
                NodeFilter.Current.WFID      = fsWFStageRow.WFID;
                NodeFilter.Current.WFStageID = fsWFStageRow.WFStageID;
            }
        }
Ejemplo n.º 20
0
        public void RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
        {
            var refCache = cache.Graph.Caches[typeof(ComplianceDocumentReference)];

            if (e.TranStatus == PXTranStatus.Open)
            {
                ComplianceDocument doc = e.Row as ComplianceDocument;

                if (doc == null)
                {
                    return;
                }

                var referenceId = (Guid?)cache.GetValue(e.Row, _FieldOrdinal);

                if (referenceId.HasValue && referenceId.Value != Guid.Empty)
                {
                    var reference =
                        ComplianceDocumentReferenceRetriever.GetComplianceDocumentReference(cache.Graph, referenceId);

                    if (reference != null)
                    {
                        reference = (ComplianceDocumentReference)refCache.Locate(reference);

                        if (reference != null)
                        {
                            if (refCache.GetStatus(reference) == PXEntryStatus.Inserted)
                            {
                                refCache.PersistInserted(reference);
                            }
                            else if (refCache.GetStatus(reference) == PXEntryStatus.Updated)
                            {
                                refCache.PersistUpdated(reference);
                            }
                        }
                    }
                    else
                    {
                        reference = (ComplianceDocumentReference)refCache.Locate(new ComplianceDocumentReference()
                        {
                            ComplianceDocumentReferenceId = referenceId
                        });

                        if (reference != null && refCache.GetStatus(reference) == PXEntryStatus.Deleted)
                        {
                            refCache.PersistDeleted(reference);
                        }
                    }
                }
            }
            else if (e.TranStatus == PXTranStatus.Aborted || e.TranStatus == PXTranStatus.Completed)
            {
                refCache.Persisted(e.TranStatus == PXTranStatus.Aborted);
            }
        }
 protected virtual void SOOrder_RowPersisted(PXCache sender, PXRowPersistedEventArgs e, PXRowPersisted baseHandler)
 {
     baseHandler?.Invoke(sender, e);
     if (!(e.Row is SOOrder row))
     {
         return;
     }
     Base.GetExtension <SOOrderEntryPCExt>().ReorderLines();
     row.CuryOrderTotal = GetOrderTotals(Base.CurrentDocument.Current);
     RestoreTaxes(row);
 }
Ejemplo n.º 22
0
        public virtual void Vendor_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            Vendor vendor = e.Row as Vendor;

            if (vendor != null && e.Operation == PXDBOperation.Insert && e.TranStatus == PXTranStatus.Completed)
            {
                PXLongOperation.StartOperation(Base, delegate()
                {
                    // Add your webservice call here
                });
            }
        }
 protected virtual void UserPreferences_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
 {
     if (e.TranStatus == PXTranStatus.Completed)
     {
         if (System.Web.HttpContext.Current != null &&
             String.Equals(this.UserProfile.Current.Username, PXAccess.GetUserName()))
         {
             // do not throw an exception to prevent breaking of the event-handling chain
             Redirector.Refresh(System.Web.HttpContext.Current);
         }
     }
 }
        protected virtual void Contact_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            Contact row = e.Row as Contact;

            if (row == null || e.TranStatus != PXTranStatus.Open)
            {
                return;
            }
            if (CRGrammProcess.PersistGrams(this, row))
            {
                row.DuplicateStatus = DuplicateStatusAttribute.NotValidated;
            }
        }
Ejemplo n.º 25
0
        protected virtual void SalesPerson_RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
        {
            SalesPerson row = e.Row as SalesPerson;

            if (e.TranStatus == PXTranStatus.Completed)
            {
                if (row != null)
                {
                    row.HasContact      = row.ContactID.HasValue;
                    Salesperson.Current = row;
                }
            }
        }
Ejemplo n.º 26
0
        protected virtual void Users_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            Users   user = (Users)e.Row;
            Contact c    = (Contact)contact.View.SelectSingleBound(new object[] { user });

            if (user == null || c == null || user.PKID == c.UserID)
            {
                return;
            }

            c        = (Contact)contact.Cache.CreateCopy(c);
            c.UserID = user.PKID;
            contact.Update(c);
        }
Ejemplo n.º 27
0
        protected virtual void APInvoice_RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
        {
            if (e.Row == null || SharedFunctions.isFSSetupSet(Base) == false)
            {
                return;
            }

            APInvoice apInvoiceRow = (APInvoice)e.Row;

            if (e.Operation == PXDBOperation.Delete &&
                e.TranStatus == PXTranStatus.Open)
            {
                InvoicingFunctions.CleanPostingInfoLinkedToDoc(apInvoiceRow);
            }
        }
Ejemplo n.º 28
0
        protected virtual void Contact_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            Contact row = e.Row as Contact;

            if (row == null || e.TranStatus != PXTranStatus.Open)
            {
                return;
            }
            if (CRGrammProcess.PersistGrams(this, row) &&
                Setup.Current.ValidateContactDuplicatesOnEntry == true &&
                Object.Equals(sender.GetValue <Contact.duplicateStatus>(e.Row), sender.GetValueOriginal <Contact.duplicateStatus>(e.Row)))
            {
                row.DuplicateStatus = DuplicateStatusAttribute.NotValidated;
            }
        }
        protected virtual void SOLine_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            SOLine invoiceLine = e.Row as SOLine;

            switch (Mode)
            {
            case 0:
                throw new PXRowPersistedException(typeof(SOLine.refNbr).Name, invoiceLine.RefNbr, "Persist error");                                                                                               //No diagnostic

            case 1:
                throw new PXLockViolationException(typeof(SOLine), PXDBOperation.Insert, new object[] { invoiceLine.RefNbr, invoiceLine.LineNbr });                           //No diagnostic

            default:
                throw new PXException("Something bad happened");                                //No diagnostic in processing graph
            }
        }
Ejemplo n.º 30
0
        protected virtual void FSTimeSlot_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSTimeSlot fsTimeSlotRow = (FSTimeSlot)e.Row;

            // Checking if is necessary compress the rules for an Employee for a specific day
            if (fsTimeSlotRow.SlotLevel == ID.EmployeeTimeSlotLevel.BASE && e.TranStatus == PXTranStatus.Completed)
            {
                DeleteTimeSlotsByLevel(fsTimeSlotRow, ID.EmployeeTimeSlotLevel.COMPRESS);
                CreateAndCompressedTimeSlots(fsTimeSlotRow, this);
            }            
        }