/// <summary> /// Create the ListViewItem contents /// </summary> public static void CreateAruddItem(System.Windows.Forms.ListViewItem eitem, int index, List <Formats.ARUDD.ReturnedDebitItem> data) { Formats.ARUDD.ReturnedDebitItem item = data[index]; eitem.Text = item.@ref; eitem.SubItems.Add(item.PayerAccount.name); eitem.SubItems.Add(item.returnDescription); eitem.SubItems.Add(item.returnCode); eitem.SubItems.Add(item.transCode); eitem.SubItems.Add(item.originalProcessingDate); eitem.SubItems.Add(item.valueOf.ToString("C")); //as we are dealing with the UK here eitem.SubItems.Add(item.PayerAccount.@ref); eitem.SubItems.Add(item.PayerAccount.sortCode); eitem.SubItems.Add(item.PayerAccount.number); eitem.SubItems.Add(item.PayerAccount.bankName); eitem.SubItems.Add(item.PayerAccount.branchName); }
/// <summary> /// This would probably be better done in a more generic fashion... /// </summary> public static string FormatAruddItem(Formats.ARUDD.ReturnedDebitItem item) { var result = String.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11}", item.@ref, item.PayerAccount.name, item.returnDescription, item.returnCode, item.transCode, item.originalProcessingDate, item.valueOf.ToString("C"), item.PayerAccount.@ref, item.PayerAccount.sortCode, item.PayerAccount.number, item.PayerAccount.bankName, item.PayerAccount.branchName); return(result); }