// clsCurrencyConvert.cs
// Copyright (C) 2008 Karel Jordaan karel_jordaan@yahoo.com.au
// 
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

using System;

namespace ZANZI.cls
{
	/// <summary>
	/// Summary description for clsCurrencyConvert.
	/// </summary>
	public class clsCurrencyConvert
	{
		#region Variable declaration

		#endregion

		#region Structures

		#endregion

		#region Functions

		/// <summary>Main entry for clsCurrencyConvert</summary>
		/// <returns>Returns nothing</returns>
		/// <param name="frm">Used to pass the MDIParent as reference</param>
		/// <remarks>clsCurrencyConvert is the constructor for the clsCurrencyConvert class.  
		/// The <paramref name="frm"/> parameter takes a reference to frmMain.
		/// The <paramref name="cls"/> parameter takes a reference to frmMain.
		/// The <paramref name="trv"/> parameter takes a reference to frmMain's Treeview.
		/// <c>public clsCurrencyConvert(clsMain cls, clsTreeView trv)</c>
		/// <c>public clsCurrencyConvert(clsCurrencyConvert frm)</c>
		/// <summary>Main entry for clsCurrencyConvert</summary>
		/// <returns>Takes no variables and returns nothing</returns>
		///<c>public clsCurrencyConvert()</c>
		public clsCurrencyConvert()
		{
			//
			// TODO: Add constructor logic here
			//
		}
        /// <summary>
        /// This function will enumerate all the availble currencies 
        /// in order to select one to be used as an input to a web service
        /// for the currency converter to work
        /// </summary>
        /// <returns>An arraylist with an object region name and currency symbol</returns>
        /// <remarks>None</remarks>
		public  arraylist GetEnumCurrency()
		{

			try
           ArrayList aStr;  
           CultureInfo ci;
           RegionInfo ri;
	       String str;
           System.Web.HttpContext app;

		if (activeChild != null)

            If app.Current.Cache.Item("aCountrys") Is Nothing Then
                For Each ci In CultureInfo.GetCultures(CultureTypes.SpecificCultures)

                    Try
                        str = New RegionInfo(ci.LCID).EnglishName

                        If Not aStr.Contains(str) Then

                            aStr.Add(str)

                        End If

                    Catch ex As Exception

                    End Try

                Next ci

                aStr.Sort()
                aStr.Insert(0, GetResourceText(CBO_DEFAULT))
                app.Current.Cache.Insert("aCountrys", aStr, Nothing, DateTime.Now.AddHours(6), TimeSpan.Zero)

            Else

                aStr = app.Current.Cache.Item("aCountrys")

            End If

            Return aStr
        Catch ex As Exception

            Dim err As New clsMailBug(ex)

        End Try

		}


		#endregion

		#region Menu handlers

		#endregion

		#region Custom Windows Form Designer generated code

		#endregion

		#region Events

		#endregion

	}
}
