예제 #1
0
        protected bool transform(SecurityInstrument newInstrument, DateTime changeDate, decimal oldChildRatio, byte newParentRatio, bool isSpinOff,
                string instrumentName, string isin, DateTime issueDate)
        {
            if (ParentInstrument != null)
                throw new ApplicationException(string.Format("This instrument already has been transformed to {0} (key {1})", ParentInstrument.Name, ParentInstrument.Key.ToString()));

            newInstrument.AllowNetting = this.AllowNetting;
            newInstrument.CompanyName = this.CompanyName;
            newInstrument.IsGreenFund = this.IsGreenFund;
            newInstrument.IsCultureFund = this.IsCultureFund;
            newInstrument.CreationDate = DateTime.Now;
            newInstrument.CurrencyNominal = this.CurrencyNominal;
            newInstrument.DecimalPlaces = this.DecimalPlaces;
            newInstrument.DefaultExchange = this.DefaultExchange;
            newInstrument.DefaultRoute = this.DefaultRoute;
            newInstrument.HomeExchange = this.HomeExchange;
            newInstrument.IsActive = true;
            newInstrument.Isin = isin;
            newInstrument.IssueDate = issueDate;
            newInstrument.LastUpdated = DateTime.Now;
            newInstrument.Name = instrumentName;
            newInstrument.PriceType = this.PriceType;
            newInstrument.SecCategory = this.SecCategory;
            newInstrument.IsGreenFund = this.IsGreenFund;
            newInstrument.IsCultureFund = this.IsCultureFund;
            this.ParentInstrument = newInstrument;
            this.InActiveDate = changeDate;
            InstrumentHistory history = new InstrumentsHistoryConversion(this, newInstrument, changeDate, oldChildRatio, newParentRatio, isSpinOff);
            this.HistoricalTransformations.Add(history);
            return newInstrument.Validate();
        }
예제 #2
0
        protected bool transform(SecurityInstrument newInstrument, DateTime changeDate, decimal oldChildRatio, byte newParentRatio, bool isSpinOff,
                                 string instrumentName, string isin, DateTime issueDate)
        {
            if (ParentInstrument != null)
            {
                throw new ApplicationException(string.Format("This instrument already has been transformed to {0} (key {1})", ParentInstrument.Name, ParentInstrument.Key.ToString()));
            }

            newInstrument.AllowNetting    = this.AllowNetting;
            newInstrument.CompanyName     = this.CompanyName;
            newInstrument.IsGreenFund     = this.IsGreenFund;
            newInstrument.IsCultureFund   = this.IsCultureFund;
            newInstrument.CreationDate    = DateTime.Now;
            newInstrument.CurrencyNominal = this.CurrencyNominal;
            newInstrument.DecimalPlaces   = this.DecimalPlaces;
            newInstrument.DefaultExchange = this.DefaultExchange;
            newInstrument.DefaultRoute    = this.DefaultRoute;
            newInstrument.HomeExchange    = this.HomeExchange;
            newInstrument.IsActive        = true;
            newInstrument.Isin            = isin;
            newInstrument.IssueDate       = issueDate;
            newInstrument.LastUpdated     = DateTime.Now;
            newInstrument.Name            = instrumentName;
            newInstrument.PriceType       = this.PriceType;
            newInstrument.SecCategory     = this.SecCategory;
            newInstrument.IsGreenFund     = this.IsGreenFund;
            newInstrument.IsCultureFund   = this.IsCultureFund;
            this.ParentInstrument         = newInstrument;
            this.InActiveDate             = changeDate;
            InstrumentHistory history = new InstrumentsHistoryConversion(this, newInstrument, changeDate, oldChildRatio, newParentRatio, isSpinOff);

            this.HistoricalTransformations.Add(history);
            return(newInstrument.Validate());
        }