protected void ApplyUpdateChange(UpdateChange change, Changeset changeset, Int32 changeId, Int32 changesetId, IDataManager manager) { var changeInfo = new TargetingTypeBasketPortfolioTargetChangeInfo( changeId, changeset.TargetingTypeId, change.BasketId, changeset.PortfolioId, change.TargetBefore, change.TargetAfter, change.Comment, changesetId ); manager.InsertTargetingTypeBasketPortfolioTargetChange(changeInfo); var info = new TargetingTypeBasketPortfolioTargetInfo( changeset.TargetingTypeId, change.BasketId, changeset.PortfolioId, change.TargetAfter, changeId ); manager.UpdateTargetingTypeBasketPortfolioTarget(info); }
internal void MailUpdateChange(UpdateChange change, IDataManager dataManager, SecurityRepository securityRepository, List <String> mailMessage, String username, DateTime date, String ttName, BasketRepository basketRepository, String portfolioName) { StringBuilder bodyAppendix = new StringBuilder("\n"); bodyAppendix.AppendLine("---" + date + ", Approved by: " + username + "---"); var basket = basketRepository.GetBasket(change.BasketId); string basketName = ""; if (basket.TryAsCountryBasket() != null) { basketName = basket.AsCountryBasket().Country.Name; } else { basketName = basket.AsRegionBasket().Name; } bodyAppendix.AppendLine(portfolioName + " Adjustment in " + basketName + " for " + ttName + " from " + MailSender.TransformTargetToString(change.TargetBefore) + " to " + MailSender.TransformTargetToString(change.TargetAfter)); bodyAppendix.AppendLine("COMMENT: " + change.Comment); mailMessage.Add(bodyAppendix.ToString()); }
public void Resolve(UpdateChange change) { this.applier.ApplyUpdateChange(change, this.changeset, this.changeId, this.changesetId, this.manager); }
public void Resolve(UpdateChange change) { this.applier.MailUpdateChange(change, this.manager, this.securityRepository, this.mail, this.username, this.date, this.ttName, this.basketRepository, this.portfolioName); }