public static void DocumentsForDate(Bookkeeping bookkeepingArr, int dateDay, int dateMonth, int dateYear) { int num = 0; Document[] array = (Document[])bookkeepingArr.Get(); for (int i = 0; i < array.Length; i++) { if (array[i].GetDate().Day == dateDay && array[i].GetDate().Month == dateMonth && array[i].GetDate().Year == dateYear) { num++; Console.WriteLine($"{num}. {array[i]}"); } } }
public static int CheckAmount(Bookkeeping bookkeepingArr) { int checkAmount = 0; Document[] array = (Document[])bookkeepingArr.Get(); for (int i = 0; i < array.Length; i++) { if (array[i] is Check) { checkAmount++; } } return(checkAmount); }
public static double SumPrice(Bookkeeping bookkeepingArr, string name) { double sum = 0; Document[] array = (Document[])bookkeepingArr.Get(); for (int i = 0; i < array.Length; i++) { if (array[i] is Invoice) { if (array[i].NameOfOrganization == name) { sum += array[i].Price; } } } return(sum); }