private static (TransferType, string) GetTransactionTypeAndAccount(TradeDataRow td) { var split = td.Description.Split(' ').ToList(); var keyword = split.First(); if (keyword == "Převod" && (split.Count == 4 || split.Count == 5)) { return(TransferType.Out, split.Last()); } if (keyword == "Vloženo") { return(TransferType.In, split[4]); } throw new InvalidOperationException($"Unrecognized description for suposed transfer <{td.Description}>"); }
private DividentTransactionType GetDividendTransactionType(TradeDataRow td) { if (string.IsNullOrWhiteSpace(td.Type)) { var parts = td.Description.Split(" "); if (parts[0] != td.Symbol || parts[1] != "-") { throw new InvalidOperationException("Unexpocted dividend description"); } if (parts[2] == "Daň") { return(DividentTransactionType.Tax); } if (parts[2] == "Dividenda") { return(DividentTransactionType.Payment); } } throw new InvalidOperationException("Unexpocted dividend description"); }
private static TradeType GetTradeType(TradeDataRow td) { if (td.Type == "Nákup") { if (td.Description.StartsWith("NEPÁROVANÝ PŘEVOD")) { return(TradeType.TransferIn); } return(TradeType.Buy); } if (td.Type == "Prodej") { if (td.Description.StartsWith("NEPÁROVANÝ PŘEVOD")) { return(TradeType.TransferOut); } return(TradeType.Sell); } if (td.Type == "Převod mezi měnami") { return(TradeType.Exchange); } throw new InvalidOperationException("Unexpected type "); }
public TradeDataRowChangeEvent(TradeDataRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; }