Beispiel #1
0
        public static void PrintGroupedInvoices(Invoice[] invs)
        {
            Console.WriteLine(">>>>>>>>>>>> Print grouped invoices >");
            //todo get the class property..
            var grouppedInv = invs.GroupBy(type => type);

        }
Beispiel #2
0
 static void Main(string[] args)
 {
     //Console.WriteLine("213");
     Invoice i = new Invoice();
     Invoice i2 = new Invoice();
     Invoice i3 = new Invoice();
     Console.WriteLine(i.ToString());
     Console.WriteLine(i2.ToString());
     Console.WriteLine(i3.ToString());
 }
Beispiel #3
0
        public static void PrintSortedInvoices(Invoice[] invs)
        {
            var sorted = invs.OrderBy(number => number.InvoiceNumber).Select(inv => inv);

            Console.WriteLine(">>>>>>>>>>>> Print sorted invoices >");

            foreach (var inv in sorted)
            {
                Console.WriteLine(inv.ToString());
            }

            
        }
Beispiel #4
0
 //copy constructor
 public Invoice(Invoice inv)
     : this(inv.InvoiceItems)
 {
 }
Beispiel #5
0
        public static Invoice Add(Invoice[] invoices)
        {
            double total = 0;

            foreach (var details in invoices)
            {
                for(int i = 0; i < details.InvoiceItems.Length; i++)
                {
                    if (details is ReceivableInvoice)
                        total += details.InvoiceItems[i].DblLineTotal;
                    else if (details is OutgoingInvoice)
                        total -= details.InvoiceItems[i].DblLineTotal;
                }
            }

            return new Invoice(new InvoiceDetail[] { new InvoiceDetail(total) });
        }