Example #1
0
 //incompleta
 private static void CalculateTotalsOfA_VATNr(List <VATNumber> vATs)
 {
     VATNumber selected = SelectVAT(vATs);
 }
Example #2
0
        static void AddBillToA_VATNr(List <VATNumber> vATs)
        {
            VATNumber selected = SelectVAT(vATs);

            if (selected != null)
            {
                selected.AddBill();
            }
            else
            { /* ??? */
            }

            //#region ConstStrings
            //const string STR_NAN = "Il dato immesso NON è un numero.";
            //const string STR_NOT_POSITIVE = "Il numero immesso NON è positivo.";
            //const string STR_NOT_A_VAT_NR = "Il numero immesso NON corrisponde ad una P.IVA salvata.";
            //const string STR_IS_A_VAT_NR = "P.IVA presente.";

            //const string IMPORT_IS_NEGATIVE = "L\'importo immesso è negativo.";

            //const string INVITE_BILL = "Immettere l\'importo della fattura d\'aggiungere: \a";
            //const string STR_ERR_BILL = "Valore immesso non valido.";
            //#endregion

            //Console.Write("Enter a VAT number: ");
            //string inputCode = Console.ReadLine();

            ///* Cerca nelle P.IVA "normali". */
            ///* Creazione d'un oggetto VATNumberNormal vuoto/null. */
            //VATNumberNormal selectedNormal = null;
            //foreach (string vAT in vATs)
            //{
            //    //if (vATs.TCode == inputCode)
            //    //{
            //    //    /* Se esiste una P.IVA corrispondente di tipo "normale",
            //    //     * viene "riempito" l'oggetto « selectedNormal » con la corrispettiva P.IVA
            //    //     * (altrimenti l'oggetto resta vuoto/null). */
            //    //    selectedNormal = normals[vATKey];
            //    //    break;
            //    //}
            //}

            ///* Trovata una P.IVA "normale" (l'oggetto « selectedNormal » è stato "riempito" quindi non è più vuoto/null). */
            //if (selectedNormal != null)
            //{
            //    Console.Write(INVITE_BILL);
            //    decimal newBill;
            //    while (true)
            //    {
            //        if (decimal.TryParse(Console.ReadLine(), out newBill))
            //            break;
            //        Console.WriteLine(STR_ERR_BILL);

            //    }
            //    selectedNormal.Bills.Add(newBill);
            //}
            ///* Cerca nelle P.IVA "semplici" (se non è una P.IVA "normale" ...). */
            //else
            //{
            //    /* Creazione d'un oggetto VATNumberNormal vuoto/null. */
            //    VATNumberSimple selectedSimple = null;
            //    //foreach (string vATKey in simples.Keys)
            //    //{
            //    //    if (simples[vATKey].VATCode == inputCode)
            //    //    {
            //    //        selectedSimple = simples[vATKey];
            //    //        break;
            //    //    }
            //    //}
            //    /* Trovata una P.IVA "normale" (l'oggetto « selectedSimple » è stato "riempito" quindi non è più vuoto/null). */
            //    if (selectedSimple != null)
            //    {
            //        Console.Write(INVITE_BILL);
            //        decimal newBill;
            //        while (true)
            //        {
            //            if (decimal.TryParse(Console.ReadLine(), out newBill))
            //                break;
            //            Console.WriteLine(STR_ERR_BILL);
            //            Console.Write(INVITE_BILL);
            //        }
            //        selectedSimple.Bills.Add(newBill);
            //    }
            //    /* P.IVA non trovata. */
            //    else
            //    {
            //        Console.WriteLine(STR_NOT_A_VAT_NR);
            //    }
            //}

            ////break;
            return;
        }