public static TransactionItem Map(ExcelRow request, WorkbookPart workbookPart)
        {
            var response = new TransactionItem();
            foreach (var cell in request.Cells)
            {
                var column = cell.CellId.First().ToString();

                switch (column.ToUpper())
                {
                    case "A":
                        response.TransactionDate = DateTime.FromOADate(double.Parse(cell.Value));
                        break;
                    case "B":
                        var value = Math.Abs(decimal.Parse(cell.Value));
                        response.Amount = Math.Round(value, 2);
                        break;
                    case "C":
                        response.Description = ExcelHelper.GetSharedStringItemById(workbookPart, int.Parse(cell.Value));
                        break;
                }
            }

            return response;
        }
Beispiel #2
0
 public bool Equals(TransactionItem obj)
 {
     return TransactionDate.Equals(obj.TransactionDate) && Amount.Equals(obj.Amount) &&
            Description.Equals(obj.Description);
 }
Beispiel #3
0
 public bool Equals(TransactionItem obj)
 {
     return(TransactionDate.Equals(obj.TransactionDate) && Amount.Equals(obj.Amount) &&
            Description.Equals(obj.Description));
 }