public override object GetNotaFields(INota nota) { INotaInstrumentConversion n = (INotaInstrumentConversion)nota; return new { n.Key, n.NotaNumber, n.TransactionDate, Account_Number = n.Account.Number, Account_AccountOwner_CompanyName = n.Account.AccountOwner.CompanyName, n.ModelPortfolioName, n.IsStorno, n.TxSide, StornoedTransactionNota_NotaNumber = n.StornoedTransactionNota != null ? n.StornoedTransactionNota.NotaNumber : "", n.Description, ConvertedInstrumentSize_Underlying_DisplayName = n.ConvertedInstrumentSize.Underlying.DisplayName, ConvertedInstrumentSize_Quantity = n.ConvertedInstrumentSize.Quantity, ValueSize_Underlying_DisplayName = n.ValueSize.Underlying.DisplayName, ValueSize_Quantity = n.ValueSize.Quantity, InstrumentTransformation_Description = n.InstrumentTransformation != null ? n.InstrumentTransformation.Description : "" }; }
public override object GetNotaFields(INota nota) { INotaTransfer n = (INotaTransfer)nota; return new { n.Key, n.NotaNumber, n.TransactionDate, Account_Number = n.Account.Number, Account_AccountOwner_CompanyName = n.Account.AccountOwner.CompanyName, n.ModelPortfolioName, n.IsStorno, n.TxSide, StornoedTransactionNota_NotaNumber = n.StornoedTransactionNota != null ? n.StornoedTransactionNota.NotaNumber : "", Instrument_DisplayName = n.Instrument.DisplayName, Instrument_Isin = n.Instrument.Isin, ValueSize_Quantity = n.ValueSize.Quantity, Price_Quantity = n.Price.Quantity, Price_Underlying_Symbol = n.Price.Underlying.Symbol, Price_ShortDisplayString = n.Price.ShortDisplayString }; }
protected override void BeforeDataSetBuild(IDalSession session, INota[] notaGroup) { foreach (INotaDeposit nota in notaGroup) if (nota.IsWithdrawalPeriodic && (nota.TegenrekeningNumber == null || nota.TegenrekeningNumber == string.Empty)) throw new ApplicationException( "Periodic Withdrawal Nota cannot be printed because Tegenrekening Number is missing on the Cash Transfer."); }
public override object GetNotaFields(INota nota) { INotaDeposit n = (INotaDeposit)nota; return new { n.Key, n.NotaNumber, n.TransactionDate, Account_Number = n.Account.Number, Account_AccountOwner_CompanyName = n.Account.AccountOwner.CompanyName, n.ModelPortfolioName, n.IsStorno, n.Formatter.DearSirForm, TotalValueAbs_DisplayString = n.GrandTotalValue.Abs().DisplayString, n.TegenrekeningNumber, n.IsWithdrawalOneOff, n.IsWithdrawalPeriodic, n.IsWithdrawalTermination, n.IsDeposit, TransferFeeAbs_Quantity = n.TransferFee != null ? n.TransferFee.Abs().Quantity : 0m, TransferFeeAbs_DisplayString = n.TransferFee != null ? n.TransferFee.Abs().DisplayString : "" }; }
public override object GetNotaFields(INota nota) { INotaTransaction n = (INotaTransaction)nota; return new { n.Key, n.NotaNumber, n.TransactionDate, Account_Number = n.Account.Number, Account_AccountOwner_CompanyName = n.Account.AccountOwner.CompanyName, n.ModelPortfolioName, n.IsStorno, n.TxSide, StornoedTransactionNota_NotaNumber = n.StornoedTransactionNota != null ? n.StornoedTransactionNota.NotaNumber : "", Order_OrderID = n.Order.OrderID, Order_OrderInfo = n.Order.OrderInfo, n.ExchangeName, TradedInstrument_DisplayName = n.TradedInstrument.DisplayName, TradedInstrument_Isin = n.TradedInstrument.Isin, ValueSize_Quantity = n.ValueSize.Quantity, Price_Quantity = n.Price.Quantity, Price_ShortDisplayString = n.Price.ShortDisplayString, n.ExchangeRate, CounterValue_Quantity = n.CounterValue.Quantity, CounterValue_UnderlyingShortName = n.CounterValue.UnderlyingShortName, TotalValue_Quantity = n.TotalValue.Quantity, TotalValue_UnderlyingShortName = n.TotalValue.UnderlyingShortName, n.ServiceChargePercentage, ServiceCharge_Quantity = n.ServiceCharge.Quantity, ServiceCharge_UnderlyingShortName = n.ServiceCharge.UnderlyingShortName, Commission_Quantity = n.Commission.Quantity, Commission_UnderlyingShortName = n.Commission.UnderlyingShortName, GrandTotalValue_Quantity = n.GrandTotalValue.Quantity, GrandTotalValue_UnderlyingShortName = n.GrandTotalValue.UnderlyingShortName, n.TransactionDateTime }; }
public override INota[][] GetGroups(IList notas) { INota[][] groups = new INota[1][]; groups[0] = new INota[notas.Count]; for (int i = 0; i < notas.Count; i++) groups[0][i] = (INota)notas[i]; return groups; }
public void AddNota(INota nota) { if (this.Notas == null) { this.Notas = new List <INota>(); } this.Notas.Add(nota); }
private void btnPlay_Click(object sender, EventArgs e) { Piano Mozart = new Piano(); NotasMusicais nm = new NotasMusicais(); int x = 0; foreach (var item in this.listNotasMusica.Items) { string nameItem = this.listNotasMusica.GetItemText(item); INota nota = nm.Pega(nameItem); if (nota != null) { MessageBox.Show(nota.GetType().Name + "-" + nota.Frequencia); } } }
public override object GetNotaFields(INota nota) { INotaDividend n = (INotaDividend)nota; return new { n.Key, n.NotaNumber, n.TransactionDate, Account_Number = n.Account.Number, Account_AccountOwner_CompanyName = n.Account.AccountOwner.CompanyName, n.ModelPortfolioName, n.IsStorno, Instrument_DisplayName = n.Instrument.DisplayName, Instrument_Isin = n.Instrument.Isin, n.ExDividendDate, n.SettlementDate, Units_Quantity = n.Units.Quantity, UnitPrice_Quantity = n.UnitPrice.Quantity, UnitPrice_ShortDisplayString = n.UnitPrice.ShortDisplayString, DividendAmount_Quantity = n.DividendAmount.Quantity, DividendAmount_UnderlyingShortName = n.DividendAmount.UnderlyingShortName, n.TaxPercentage, Tax_Quantity = n.Tax.Quantity, Tax_UnderlyingShortName = n.Tax.UnderlyingShortName, ValueIncludingTax_Quantity = n.ValueIncludingTax.Quantity, ValueIncludingTax_UnderlyingShortName = n.ValueIncludingTax.UnderlyingShortName }; }
public override object GetNotaFields(INota nota) { INotaFees n = (INotaFees)nota; return new { n.Key, n.NotaNumber, n.TransactionDate, Account_Number = n.Account.Number, Account_AccountOwner_CompanyName = n.Account.AccountOwner.CompanyName, n.ModelPortfolioName, n.IsStorno, n.Description, StornoedBookNota_NotaNumber = n.StornoedBookNota != null ? n.StornoedBookNota.NotaNumber : "", ManagementFeeAmount_Quantity = n.ManagementFeeAmount.Quantity, ManagementFeeAmount_UnderlyingShortName = n.ManagementFeeAmount.UnderlyingShortName, n.TaxPercentage, Tax_Quantity = n.Tax.Quantity, Tax_UnderlyingShortName = n.Tax.UnderlyingShortName, ValueIncludingTax_Quantity = n.ValueIncludingTax.Quantity, ValueIncludingTax_UnderlyingShortName = n.ValueIncludingTax.UnderlyingShortName, PeriodStartDate_Month = n.PeriodStartDate.Month, PeriodStartDate_Year = n.PeriodStartDate.Year }; }
protected override string GetFileSuffix(INota[] notaGroup) { return "CorporateAction"; }
protected virtual void GenerateParamValues(List<string> paramValues, bool showLogo, INota[] notaGroup) { paramValues.Add(showLogo.ToString()); }
protected override string GetFileSuffix(INota[] notaGroup) { return "Transfer"; }
public NotaService(INota notaRepository) { _notaRepository = notaRepository; }
public static T ConvertTo <T>(this INota nota) where T : INota, new() => new T { Titulo = nota.Titulo, Descricao = nota.Descricao };
public static bool Update(IDalSession session, INota obj) { return session.InsertOrUpdate(obj); }
public object GetHeaderFields(INota n) { n.Formatter.AssertAddressIsComplete(); return new { n.PrintCount, n.Formatter.AddressFirstLine, n.Formatter.AddressSecondLine, n.Formatter.Address.StreetAddressLine, n.Formatter.Address.CityAddressLine, n.Formatter.Address.CountryAddressLine }; }
protected override string GetFileSuffix(INota[] notaGroup) { return "Dividend"; }
private DataSet buildDataSet(IDalSession session, INota[] notaGroup) { BeforeDataSetBuild(session, notaGroup); DataSet ds = new DataSet(); DataTable dt = notaGroup.Take(1) .Select<INota, object>(GetHeaderFields) .ToDataTable(HeaderDataTableName); ds.Tables.Add(dt); dt = notaGroup.Select<INota, object>(GetNotaFields) .ToDataTable(NotaDataTableName); createPageGrouping(dt); ds.Tables.Add(dt); AfterDataSetBuild(session, notaGroup, ds); return ds; }
private void registerNotaPrinting(IDalSession session, INota[] notas, string pdfFileName, string pdfOnlineReportsFolder, bool sentByPost) { // TODO: create a document object only when PrintCount is zero (in case this is a reprint) INotaDocument document = new NotaDocument(pdfFileName, pdfOnlineReportsFolder, sentByPost); DocumentMapper.Update(session, document); foreach (INota nota in notas) { nota.Document = document; nota.IncrementPrintCount(); } NotaMapper.Update(session, notas); }
private static NotaReturnClass getNotaReturnClass(INota nota) { if (nota is INotaTransaction) return NotaReturnClass.NotaTransaction; else if (nota is INotaDeposit) return NotaReturnClass.NotaDeposit; else if (nota is INotaDividend) return NotaReturnClass.NotaDividend; else if (nota is INotaTransfer) return NotaReturnClass.NotaTransfer; else if (nota is INotaFees) return NotaReturnClass.NotaFees; else if (nota is INotaInstrumentConversion) return NotaReturnClass.NotaInstrumentConversion; else return NotaReturnClass.Nota; }
protected override void AfterDataSetBuild(IDalSession session, INota[] notaGroup, DataSet ds) { // there's only one NotaFees per report INotaFees notaFees = (INotaFees)notaGroup[0]; // Pivot the table DataTable dt = new DataTable("AverageValuations"); dt.Columns.Add("InstrumentID", typeof(int)); dt.Columns.Add("InstrumentName", typeof(string)); dt.Columns.Add("IsTradeable", typeof(bool)); dt.Columns.Add("HasManagementFees", typeof(bool)); dt.Columns.Add("AvgMarketValueMonth1", typeof(decimal)); dt.Columns.Add("AvgMarketValueMonth2", typeof(decimal)); dt.Columns.Add("AvgMarketValueMonth3", typeof(decimal)); Hashtable monthColumnsByMonth = new Hashtable(); for (int i = 0; i < 3; i++) monthColumnsByMonth[notaFees.PeriodStartDate.Month + i] = string.Format("AvgMarketValueMonth{0}", i + 1); Hashtable rowsById = new Hashtable(); foreach (IAverageHolding averageHolding in notaFees.AverageHoldings) if (averageHolding.AverageValue.Quantity != 0m && monthColumnsByMonth.Contains(averageHolding.Month)) { int instrumentId = averageHolding.Instrument.Key; if (!rowsById.Contains(instrumentId)) { DataRow dr = dt.NewRow(); dr["InstrumentID"] = instrumentId; dr["InstrumentName"] = averageHolding.Instrument.Name; dr["IsTradeable"] = averageHolding.Instrument.IsTradeable; dr["HasManagementFees"] = false; dr["AvgMarketValueMonth1"] = 0m; dr["AvgMarketValueMonth2"] = 0m; dr["AvgMarketValueMonth3"] = 0m; dt.Rows.Add(dr); rowsById[instrumentId] = dr; } if (monthColumnsByMonth.Contains(averageHolding.Month)) { ((DataRow)rowsById[instrumentId])[(string)monthColumnsByMonth[averageHolding.Month]] = averageHolding.AverageValue.Quantity; if (averageHolding.FeeItems.GetItemByType(FeeTypes.ManagementFee) != null) ((DataRow)rowsById[instrumentId])["HasManagementFees"] = true; } else throw new ApplicationException( string.Format("Period {0:dd-MM-yyyy} to {1:dd-MM-yyyy} has more months than the Management Fee nota can display (3).", notaFees.PeriodStartDate, notaFees.PeriodEndDate)); } ds.Tables.Add(dt); var p = from a in notaFees.FeeDetails where ((IManagementFeeComponent)a).MgtFeeType != null group a by ((IManagementFeeComponent)a).MgtFeeType into g select new { MgtFeeType = g.Key, FeeAmount = g.Select(x => x.ComponentValue).Sum() }; if (p == null || p.Count() == 0) throw new ApplicationException("No breakup lines were found."); dt = p.Select(c => new { Key = c.MgtFeeType != null ? (int)c.MgtFeeType.Key : (int)FeeTypes.None, FeeTypeKey = c.MgtFeeType != null ? (int)c.MgtFeeType.Key : (int)FeeTypes.None, MgtFeeType_Description = c.MgtFeeType != null ? c.MgtFeeType.Description : "Unknown", Amount_Quantity = c.FeeAmount.Quantity, Amount_UnderlyingShortName = c.FeeAmount.UnderlyingShortName }) .ToDataTable("BreakupLines"); ds.Tables.Add(dt); }
public abstract object GetNotaFields(INota n);
protected virtual void BeforeDataSetBuild(IDalSession session, INota[] notaGroup) { }
protected virtual void AfterDataSetBuild(IDalSession session, INota[] notaGroup, DataSet ds) { }
protected override string GetFileSuffix(INota[] notaGroup) { return (((INotaDeposit)notaGroup[0]).IsDeposit ? "Deposit" : "Withdrawal"); }
protected abstract string GetFileSuffix(INota[] notaGroup);