public static void ChangeCurrency(string newCurrencyCode)
        {
            if (currency.Equals(newCurrencyCode))
            {
                return;
            }
            newCurrencyCode = newCurrencyCode.ToUpper();
            InitializeValute();

            if (newCurrencyCode.Equals("AZN"))
            {
                Accounts.Deindexify(codeValute[currency]);
                Categories.Deindexify(codeValute[currency]);
            }
            else
            {
                if (!currency.Equals("AZN"))
                {
                    Accounts.Deindexify(codeValute[currency]);
                    Categories.Deindexify(codeValute[currency]);
                }
                Accounts.Indexify(codeValute[newCurrencyCode]);
                Categories.Indexify(codeValute[newCurrencyCode]);
            }
            Accounts.Save();
            Categories.Save();
            currency = newCurrencyCode;
            SaveCurrency();
        }
Example #2
0
        static void Main(string[] args)
        {
            Accounts   accounts   = Accounts.GetInstance();
            Categories categories = Categories.GetInstance();
            Payments   payments   = Payments.GetInstance();

            Console.ForegroundColor = ConsoleColor.Green;
            Console.OutputEncoding  = System.Text.Encoding.UTF8;
            AppFront.Run();
            Accounts.Save();
            Categories.Save();
            Payments.Save();
            CurrencyModule.SaveCurrency();
        }