using System.Collections.Generic;
using System.Collections.ObjectModel;
public string InternalId { get; set; }
public int? companyCode { get; set; }
public int? branchCode { get; set; }
public int? levelEducationCode { get; set; }
public string[] studentCodes { get; set; }
public int? termCode { get; set; }
public string termCodeDescription { get; set; }
public int? specializationBranchCode { get; set; }
public decimal? scholarshipVAV { get; set; }
public decimal? scholarshipESC { get; set; }
public DateTime? dueDate { get; set; }
public string companyCodeCFO { get; set; }
public string CFOCode { get; set; }
public string CFOCodeDescription { get; set; }
public decimal? originalValue { get; set; }
public decimal? discountValue { get; set; }
public int? bankBilletCode { get; set; }
public string bankBilletStatus { get; set; }
public string CNABStatus { get; set; }
public string bankDocumentNumber { get; set; }
public DateTime? paymentProcessingDate { get; set; }
public int? financialEntryStatus { get; set; }
public decimal? agreementAddedValue { get; set; }
public decimal? agreementInterestValue { get; set; }
public decimal? agreementDiscountValue { get; set; }
public string canPayWithCredit { get; set; }
public string canPayWithDebit { get; set; }
public string ipte { get; set; }
public bool? bankSlipRegistered { get; set; }
public bool? allowBankSlipRegister { get; set; }
public DateTime serverDate { get; set; }
public byte[] ImagemUsuario { get; set; }
} private bool _isSelected = false;
} private string _colorFrame;
public string CorCalendario
if (VencendoHoje(dueDate))
else if (this.dueDate < this.serverDate)
private bool VencendoHoje(DateTime? data)
int dataDia = data.GetValueOrDefault().Day;
int dataMes = data.GetValueOrDefault().Month;
int dataAno = data.GetValueOrDefault().Year;
DateTime hoje = this.serverDate;
return (dataDia == hoje.Day && dataMes == hoje.Month && dataAno == hoje.Year);
public static void ImprimeListaBoleto()
ObservableCollection<BoletoItem> ListaBoletos = new ObservableCollection<BoletoItem>();
dueDate = new DateTime(2019, 09, 24),
serverDate = new DateTime(2019, 09, 24),
studentCodes = new string[]{"ES-00179"},
paymentProcessingDate = null,
termCodeDescription = "2019/1"
dueDate = new DateTime(2019, 09, 24),
serverDate = new DateTime(2019, 09, 24),
studentCodes = new string[]{"ES-00179", "ES-00178"},
paymentProcessingDate = null,
termCodeDescription = "2019/1"
Dictionary<string, BoletoItem> dictAlunosBoletos = new Dictionary<string, BoletoItem>();
var proximosBoletosAVencer = from b in ListaBoletos
where b.bankBilletStatus == "0"
&& b.dueDate >= b.serverDate
group b by b.studentCodes into g
select g.FirstOrDefault();
foreach (var boleto in proximosBoletosAVencer)
foreach (var ra in boleto.studentCodes)
if (dictAlunosBoletos.ContainsKey(ra))
if (dictAlunosBoletos[ra].dueDate.HasValue && boleto.dueDate < dictAlunosBoletos[ra].dueDate)
dictAlunosBoletos[ra] = boleto;
dictAlunosBoletos.Add(ra, boleto);
List<BoletoItem> result = new List<BoletoItem>();
foreach (KeyValuePair<string, BoletoItem> boletoRA in dictAlunosBoletos)
if (!result.Exists(b => b.companyCode == boletoRA.Value.companyCode && b.bankBilletCode == boletoRA.Value.bankBilletCode))
result.Add(boletoRA.Value);
foreach(var boleto in result)
Console.WriteLine("Boleto.bankBilletCode = " + boleto.bankBilletCode + " boleto.valor = " + boleto.originalValue + " boleto.dueDate = " + boleto.dueDate);
public static void Main()