public static void AddOrdersToNavCalculation(IDalSession session, INavCalculation calc) { if (calc.Status != NavCalculationStati.Booked) { IList<IOrder> orders = NavCalculationOrderMapper.NewOrdersForFund(session, calc.Fund.Key, calc.ValuationDate); foreach (IOrder order in orders) { NavCalculationOrder newOrder = new NavCalculationOrder(order, calc); calc.NewOrders.Add(newOrder); } } }
public NavCalculation(INavCalculation lastNavCalculation, IVirtualFund fund) : this() { Fund = fund; if (lastNavCalculation != null) { ValuationDate = getNextWorkingDay(lastNavCalculation.ValuationDate); if (ValuationDate > DateTime.Today) throw new ApplicationException( string.Format("Fund '{0}' is up-to-date: a NAV Calculation for the last working day already exists.", fund.Name)); PrevNavCalculation = lastNavCalculation; TotalParticipationsBeforeFill = lastNavCalculation.TotalParticipationsAfterFill; TotalParticipationsAfterFill = lastNavCalculation.TotalParticipationsAfterFill; GrossAssetValue = lastNavCalculation.GrossAssetValue; NettAssetValue = lastNavCalculation.NettAssetValue; NavPerUnit = lastNavCalculation.NavPerUnit; Status = NavCalculationStati.New; PublicOfferPrice = lastNavCalculation.PublicOfferPrice; } }
private static void createJournalEntryForNav(IDalSession session, INavCalculation calc, DateTime bookingDate) { IVirtualFund fund = calc.Fund; string nextJournalNumber = JournalEntryMapper.GetNextJournalEntryNumber(session, fund.JournalForFund); IMemorialBooking newEntry = new MemorialBooking(fund.JournalForFund, nextJournalNumber); newEntry.TransactionDate = calc.ValuationDate; calc.Bookings = newEntry; }
public CalculationDetails(INavCalculation Calc) { this.Key = Calc.Key; this.Fund = new FundDetails(Calc.Fund); this.ValuationDate = Calc.ValuationDate; this.DisplayStatus = Calc.DisplayStatus; this.ParticipationsBefore = Calc.TotalParticipationsBeforeFill; this.ParticipationsAfter = Calc.TotalParticipationsAfterFill; if (this.ParticipationsAfter > 0) this.ParticipationsDuring = decimal.Subtract(Calc.TotalParticipationsAfterFill, Calc.TotalParticipationsBeforeFill); this.GrossAssetValue = Calc.GrossAssetValue; this.GrossAssetValueDisplay = Calc.GrossAssetValue.DisplayString; this.NettAssetValue = Calc.NettAssetValue; this.NettAssetValueDisplay = Calc.NettAssetValue.DisplayString; this.NavPerUnit = Calc.NavPerUnit; this.NavPerUnitDisplay = Calc.NavPerUnitDisplayString; this.PublicOfferPrice = Calc.PublicOfferPrice; this.PublicOfferPriceDisplay = Calc.PublicOfferPriceDisplayString; this.JournalEntryKey = Calc.Bookings.Key; }
public NavCalculationOrder(IOrder newOrder, INavCalculation parent) { this.Order = newOrder; this.Parent = parent; }
public static void Update(IDalSession session, INavCalculation obj) { session.InsertOrUpdate(obj); ; }
public static void Insert(IDalSession session, INavCalculation obj) { session.Insert(obj); ; }