Esempio n. 1
0
        public static void AddInvoicePL()
        {
            try
            {
                objValidation = new InvoiceBLL();
                Invoice objInvoice = new Invoice();

                Console.WriteLine("Enter Invoice No :");
                objInvoice.InvoiceNo = Int32.Parse(Console.ReadLine());

                Console.WriteLine("Enter Invoice Date :");
                objInvoice.InvoiceDate = DateTime.Parse(Console.ReadLine());

                Console.WriteLine("Enter Customer Name :");
                objInvoice.CustomerName = Console.ReadLine();

                Console.WriteLine("Enter Product Name :");
                objInvoice.ProductName = Console.ReadLine();

                Console.WriteLine("Enter Amount :");
                objInvoice.Amount = Int32.Parse(Console.ReadLine());

                objValidation.ValidateInvoice(objInvoice);


                if (objValidation.AddInvoiceBLL(objInvoice))
                {
                    Console.WriteLine("Invoice Record added successfully");
                }
            }
            catch (InvoiceException i)
            {
                Console.WriteLine("Error occurred " + i.Message);
            }
        }