Ejemplo n.º 1
0
        protected virtual void _(Events.RowInserted <FSWFStage> e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSWFStage fsWFStageRow = e.Row as FSWFStage;

            if (fsWFStageRow != null && Filter.Current != null)
            {
                NodeFilter.Current.ParentWFStageID = fsWFStageRow.ParentWFStageID;
            }
        }
Ejemplo n.º 2
0
        protected virtual void _(Events.RowInserted <Document> e)
        {
            var row = e.Row as Document;

            if (row == null)
            {
                return;
            }

            bool oldContactDirty = GetContactCache().IsDirty;
            bool oldAddressDirty = GetAddressCache().IsDirty;

            Contact oldContact = null;
            Address oldAddress = null;

            if (row.ContactID != null)
            {
                oldContact = PXSelect <Contact,
                                       Where <Contact.contactID, Equal <Current <Document.contactID> > > > .Select(Base);

                oldAddress = PXSelectJoin <Address,
                                           LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> > >,
                                           Where <Contact.contactID, Equal <Current <Document.contactID> > > > .Select(Base);
            }
            else if (row.LocationID != null)
            {
                oldContact = PXSelectJoin <Contact,
                                           LeftJoin <Location, On <Location.locationID, Equal <Current <Document.locationID> > > >,
                                           Where <Contact.contactID, Equal <Location.defContactID> > > .Select(Base);

                oldAddress = PXSelectJoin <Address,
                                           LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> >,
                                                     LeftJoin <Location, On <Location.locationID, Equal <Current <Document.locationID> > > > >,
                                           Where <Address.addressID, Equal <Location.defAddressID> > > .Select(Base);
            }

            ChangedData forContactInfo = new ChangedData();

            forContactInfo.OldContact = oldContact;
            forContactInfo.OldAddress = oldAddress;

            DefaultRecords(row, forContactInfo, new ChangedData(false));

            GetContactCache().IsDirty = oldContactDirty;
            GetAddressCache().IsDirty = oldAddressDirty;
        }
Ejemplo n.º 3
0
        protected virtual void _(Events.RowInserted <ComplianceDocument> args)
        {
            var currentArPayment = Base.Document.Current;

            if (currentArPayment != null)
            {
                var complianceDocument = args.Row;
                if (complianceDocument != null)
                {
                    complianceDocument.CustomerID   = currentArPayment.CustomerID;
                    complianceDocument.CustomerName = GetCustomerName(complianceDocument.CustomerID);
                    complianceDocument.ArPaymentID  = CreateComplianceDocumentReference(currentArPayment)
                                                      .ComplianceDocumentReferenceId;
                    complianceDocument.ArPaymentMethodID = currentArPayment.PaymentMethodID;
                }
            }
        }
Ejemplo n.º 4
0
        protected virtual void _(Events.RowInserted <EPEquipment> e)
        {
            if (e.Row == null)
            {
                return;
            }

            EPEquipment epEquipmentRow = (EPEquipment)e.Row;

            // Inserting the corresponding Equipment record
            if (VehicleSelected.Current == null)
            {
                FSVehicle fsVehicleRow = new FSVehicle();
                fsVehicleRow          = VehicleSelected.Insert(fsVehicleRow);
                fsVehicleRow.SourceID = epEquipmentRow.EquipmentID;
                this.VehicleSelected.Cache.IsDirty = false;
            }
        }
Ejemplo n.º 5
0
        protected virtual void _(Events.RowInserted <FSGPSTrackingLocation> e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSGPSTrackingLocation fsGPSTrackingLocationRow = e.Row as FSGPSTrackingLocation;
            UserPreferences       userPreferencesRow       = Base.UserPrefs.Current;

            if (userPreferencesRow != null)
            {
                FSxUserPreferences fsxUserPreferencesRow = PXCache <UserPreferences> .GetExtension <FSxUserPreferences>(userPreferencesRow);

                fsGPSTrackingLocationRow.Interval = fsxUserPreferencesRow.Interval;
                fsGPSTrackingLocationRow.Distance = fsxUserPreferencesRow.Distance;
            }
        }
Ejemplo n.º 6
0
        /// <summary>The RowInserted event handler for the <see cref="Discount" /> mapped cache extension.</summary>
        /// <param name="e">Parameters of the event.</param>
        protected virtual void _(Events.RowInserted <Discount> e)
        {
            if (!DiscountEngineGraph.IsInternalDiscountEngineCall && e.Row != null)
            {
                if (e.Row.DiscountID != null)
                {
                    DiscountEngineGraph.InsertManualDocGroupDiscount(Details.Cache, Details, Discounts, e.Row, e.Row.DiscountID, null,
                                                                     Documents.Current.BranchID, Documents.Current.LocationID ?? 0, Documents.Current.DocumentDate, DiscountEngine.DefaultARDiscountCalculationParameters);
                    RefreshTotalsAndFreeItems(Discounts.Cache);
                    (Discounts.Cache as PXModelExtension <Discount>)?.UpdateExtensionMapping(e.Row);
                }

                if (DiscountEngineGraph.SetExternalManualDocDiscount(Details.Cache, Details, Discounts, e.Row, null, DiscountEngine.DefaultARDiscountCalculationParameters))
                {
                    RefreshTotalsAndFreeItems(Discounts.Cache);
                    (Discounts.Cache as PXModelExtension <Discount>)?.UpdateExtensionMapping(e.Row);
                }
            }
        }
Ejemplo n.º 7
0
        protected override void _(Events.RowInserted <Extensions.ContactAddress.Document> e)
        {
            var row = e.Row as Extensions.ContactAddress.Document;

            if (row == null)
            {
                return;
            }

            bool oldContactDirty = GetContactCache().IsDirty;
            bool oldAddressDirty = GetAddressCache().IsDirty;

            int?branchLocationID = (int?)e.Cache.GetValue <FSServiceOrder.branchLocationID>(row);

            SetDefaultContactAndAddress(e.Cache, e.Row, row.ContactID, row.LocationID, branchLocationID, ContacAddressCallerEnum.Insert);

            GetContactCache().IsDirty = oldContactDirty;
            GetAddressCache().IsDirty = oldAddressDirty;
        }
Ejemplo n.º 8
0
 //Insert the default detail record.
 protected virtual void _(Events.RowInserted <RSSVRepairPrice> e)
 {
     if (Warranty.Select().Count == 0)
     {
         bool oldDirty = Warranty.Cache.IsDirty;
         // Retrieve the default warranty.
         Contract defaultWarranty = (Contract)DefaultWarranty.Select();
         if (defaultWarranty != null)
         {
             RSSVWarranty line = new RSSVWarranty();
             line.ContractID      = defaultWarranty.ContractID;
             line.DefaultWarranty = true;
             // Insert the data record into
             // the cache of the Warranty data view.
             Warranty.Insert(line);
             // Clear the flag that indicates in the UI whether the cache
             // contains changes.
             Warranty.Cache.IsDirty = oldDirty;
         }
     }
 }
Ejemplo n.º 9
0
 protected virtual void _(Events.RowInserted <FSRouteSetup> e)
 {
 }
Ejemplo n.º 10
0
 protected virtual void _(Events.RowInserted <EPEmployee> e)
 {
 }
Ejemplo n.º 11
0
 protected virtual void _(Events.RowInserted <FSGeoZoneEmp> e)
 {
 }
Ejemplo n.º 12
0
 protected virtual void _(Events.RowInserted <FSLicense> e)
 {
 }
Ejemplo n.º 13
0
 protected virtual void _(Events.RowInserted <FSEmployeeSkill> e)
 {
 }
Ejemplo n.º 14
0
 protected virtual void _(Events.RowInserted <StoragePlaceEnq.StoragePlaceFilter> e) => e.Cache.IsDirty = false;
 protected virtual void _(Events.RowInserted <CROpportunityProducts> e)
 {
     InvalidateExternalTax(Base.Opportunity.Current);
 }
Ejemplo n.º 16
0
 protected virtual void _(Events.RowInserted <EPTimeCard> e)
 {
 }
Ejemplo n.º 17
0
 protected virtual void _(Events.RowInserted <CROpportunityProducts> e)
 {
 }
Ejemplo n.º 18
0
 protected virtual void _(Events.RowInserted <APTran> e)
 {
 }
Ejemplo n.º 19
0
 protected virtual void _(Events.RowInserted <ARPayment> e)
 {
 }
Ejemplo n.º 20
0
 protected virtual void _(Events.RowInserted <FSRouteDocument> e)
 {
 }
 protected virtual void _(Events.RowInserted <CROpportunityDiscountDetail> e)
 {
     InvalidateExternalTax(Base.Opportunity.Current);
 }
Ejemplo n.º 22
0
 protected virtual void _(Events.RowInserted <SOInvoice> e)
 {
     PXLongOperation.StartOperation(this, null);
 }
Ejemplo n.º 23
0
 protected virtual void _(Events.RowInserted <FSAdjust> e)
 {
 }
Ejemplo n.º 24
0
 protected virtual void _(Events.RowInserted <DescriptionGenerationRule> eventArgs)
 {
     GenerationRuleRowInserted(eventArgs.Cache, eventArgs.Row);
     ResetValue <InventoryItem.sampleDescription>();
 }
Ejemplo n.º 25
0
 protected virtual void _(Events.RowInserted <APInvoice> e)
 {
 }
Ejemplo n.º 26
0
 protected virtual void _(Events.RowInserted <SOInvoice> e)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 27
0
 protected virtual void _(Events.RowInserted <TimeCardMaint.EPTimecardDetail> e)
 {
 }
Ejemplo n.º 28
0
 protected virtual void _(Events.RowInserted <Users> e)
 {
 }
Ejemplo n.º 29
0
 protected virtual void _(Events.RowInserted <FSServiceTemplate> e)
 {
 }
Ejemplo n.º 30
0
 protected virtual void _(Events.RowInserted <UserPreferences> e)
 {
 }