Ejemplo n.º 1
0
        /// <summary>
        /// Các quốc gia
        /// </summary>
        /// <returns></returns>
        public static List <SelectListItem> Countries(bool allSelectAll = true)
        {
            List <Country> getList = new List <Country>();

            getList = CountryBLL.GetList();
            List <SelectListItem> List = new List <SelectListItem>();

            if (allSelectAll)
            {
                List.Add(new SelectListItem()
                {
                    Value = "", Text = "-- All Countries --"
                });
            }
            foreach (var country in getList)
            {
                List.Add(new SelectListItem {
                    Value = country.Abbreviation, Text = country.CountryName
                });
            }
            return(List);
        }