Ejemplo n.º 1
0
        /// <summary>
        /// Handles entity Saved event.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">The <see cref="T:Terrasoft.Core.Entities.EntityAfterEventArgs" /> instance containing the
        /// event data.</param>
        public override void OnSaved(object sender, EntityAfterEventArgs e)
        {
            base.OnSaved(sender, e);
            UserConnection                    userConnection = ((Entity)sender).UserConnection;
            IEntityEventAsyncExecutor         asyncExecutor  = ClassFactory.Get <IEntityEventAsyncExecutor>(new ConstructorArgument("userConnection", userConnection));
            LeadEntityEventAsyncOperationArgs operationArgs  = new LeadEntityEventAsyncOperationArgs((Entity)sender, e);

            asyncExecutor.ExecuteAsync <LeadRightsRegulator>(operationArgs);
        }
 private void ManageLeadOwnerRights(LeadEntityEventAsyncOperationArgs arguments)
 {
     if (arguments.SalesChannel != _partnerSaleOpportunityType)
     {
         return;
     }
     _rightsRegulator.ManageEntityOwnerRights(
         arguments.EntityId,
         arguments.EntityColumnValues.GetTypedValue <Guid>("OwnerId"),
         arguments.OldEntityColumnValues.GetTypedValue <Guid>("OwnerId"));;
 }