Esempio n. 1
0
        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]}");
                }
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }