public void SetUp() { Fake<CountryInfo, CountryInfoProvider>(); Fake<StateInfo, StateInfoProvider>(); Fake().DocumentType<Contact>(Contact.CLASS_NAME); var country = new CountryInfo { CountryName = "USA", CountryTwoLetterCode = "US" }; var state = new StateInfo { StateName = "Illinois", StateDisplayName = "Illinois" }; var contact = TreeNode.New<Contact>().With(x => x.Fields.Country = "USA;Illinois"); var socialLinkRepository = Substitute.For<ISocialLinkRepository>(); var cafeRepository = Substitute.For<ICafeRepository>(); var contactRepository = Substitute.For<IContactRepository>(); var countryRepository = Substitute.For<ICountryRepository>(); var localizationService = Substitute.For<LocalizationService>(); var outputCacheDependencies = Substitute.For<IOutputCacheDependencies>(); contactRepository.GetCompanyContact().Returns(contact); countryRepository.GetCountry(country.CountryName).Returns(country); countryRepository.GetState(state.StateName).Returns(state); mFormItemRepository = Substitute.For<IFormItemRepository>(); mController = new ContactsController(cafeRepository, socialLinkRepository, contactRepository, mFormItemRepository, countryRepository, localizationService, outputCacheDependencies); mMessageModel = CreateMessageModel(); }
/// <summary> /// Creates country. Called when the "Create country" button is pressed. /// </summary> private bool CreateCountry() { // Create new country object CountryInfo newCountry = new CountryInfo(); // Set the properties newCountry.CountryDisplayName = "My new country"; newCountry.CountryName = "MyNewCountry"; // Create the country CountryInfoProvider.SetCountryInfo(newCountry); return true; }
static Bermuda() { _country = new CountryInfo { Country = Country.Bermuda, CountryType = CountryType.Region, BeongsToCountry = Country.UnitedKingdom, UNCode = "060", Alpha2Code = "BM", Alpha3Code = "BMU", Name = "The Bermuda Islands", ShorterForm = "Bermuda", ChineseName = "百慕大群岛", ChineseShorterForm = "百慕大", ChineseAlias = "旧称萨默斯岛", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, }; }
static SaintHelena() { _country = new CountryInfo { Country = Country.SaintHelena, CountryCode = CountryCode.SH, CountryType = CountryType.Region, BelongsToCountry = Country.UnitedKingdom, M49Code = "654", Cep1CrCode = 3_00_121, Alpha2Code = "SH", Alpha3Code = "SHN", Name = "Saint Helena, Ascension and Tristan da Cunha", ChineseName = "圣赫勒拿、阿森松与特里斯坦达库尼亚", Continent = Continent.Africa, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static SaintLucia() { _country = new CountryInfo { Country = Country.SaintLucia, CountryCode = CountryCode.LC, CountryType = CountryType.Country, BelongsToCountry = Country.SaintLucia, M49Code = "662", Cep1CrCode = 4_00_129, Alpha2Code = "LC", Alpha3Code = "LCA", Name = "Saint Lucia", ChineseName = "圣卢西亚", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static BouvetIsland() { _country = new CountryInfo { Country = Country.BouvetIsland, CountryCode = CountryCode.BV, CountryType = CountryType.Region, BelongsToCountry = Country.Norway, M49Code = "074", Cep1CrCode = 2_00_107, Alpha2Code = "BV", Alpha3Code = "BVT", Name = "Bouvet Island", ChineseName = "布韦岛", Continent = Continent.Europe, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static CaymanIslands() { _country = new CountryInfo { Country = Country.CaymanIslands, CountryCode = CountryCode.KY, CountryType = CountryType.Region, BelongsToCountry = Country.UnitedKingdom, M49Code = "136", Cep1CrCode = 4_00_110, Alpha2Code = "KY", Alpha3Code = "CYM", Name = "Cayman Islands", ChineseName = "开曼群岛", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static Greenland() { _country = new CountryInfo { Country = Country.Greenland, CountryCode = CountryCode.GL, CountryType = CountryType.Country, BelongsToCountry = Country.Greenland, M49Code = "304", Cep1CrCode = 4_00_116, Alpha2Code = "GL", Alpha3Code = "GRL", Name = "Greenland", ChineseName = "格陵兰岛", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static NorfolkIsland() { _country = new CountryInfo { Country = Country.NorfolkIsland, CountryCode = CountryCode.NF, CountryType = CountryType.Region, BelongsToCountry = Country.Australia, M49Code = "574", Cep1CrCode = 6_00_111, Alpha2Code = "NF", Alpha3Code = "NFK", Name = "Norfolk Island", ChineseName = "诺福克岛", Continent = Continent.Africa, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static BurkinaFaso() { _country = new CountryInfo { Country = Country.BurkinaFaso, CountryCode = CountryCode.BF, CountryType = CountryType.Country, BelongsToCountry = Country.BurkinaFaso, M49Code = "854", Cep1CrCode = 3_00_105, Alpha2Code = "BF", Alpha3Code = "BFA", Name = "Burkina Faso", ChineseName = "布基纳法索", Continent = Continent.Africa, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static FrenchSouthernTerritories() { _country = new CountryInfo { Country = Country.FrenchSouthernTerritories, CountryCode = CountryCode.TF, CountryType = CountryType.Region, BelongsToCountry = Country.France, M49Code = "260", Cep1CrCode = 3_00_124, Alpha2Code = "TF", Alpha3Code = "ATF", Name = "French Southern Territories", ChineseName = "法属南部领地", Continent = Continent.Africa, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static Russia() { _country = new CountryInfo { Country = Country.Russia, CountryType = CountryType.Country, BeongsToCountry = Country.Russia, UNCode = "643", Alpha2Code = "RU", Alpha3Code = "RUS", Name = "Russian Federation", ShorterForm = "Russia", ChineseName = "俄罗斯联邦", ChineseShorterForm = "俄罗斯", ChineseAlias = "俄联邦", ChineseAlias2 = "俄国", Continent = Continent.Europe, I18NIdentityCode = I18N_IDENTITY_CODE, }; }
static Gibraltar() { _country = new CountryInfo { Country = Country.Gibraltar, CountryCode = CountryCode.GI, CountryType = CountryType.Region, BelongsToCountry = Country.UnitedKingdom, M49Code = "292", Cep1CrCode = 2_00_114, Alpha2Code = "GI", Alpha3Code = "GIB", Name = "Gibraltar", ChineseName = "直布罗陀", Continent = Continent.Europe, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static Niue() { _country = new CountryInfo { Country = Country.Niue, CountryCode = CountryCode.NU, CountryType = CountryType.Country, BelongsToCountry = Country.Niue, M49Code = "570", Cep1CrCode = 6_00_110, Alpha2Code = "NU", Alpha3Code = "NIU", Name = "Niue", ChineseName = "纽埃", Continent = Continent.Oceania, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static Ukraine() { _country = new CountryInfo { Country = Country.Ukraine, CountryCode = CountryCode.UA, CountryType = CountryType.Country, BelongsToCountry = Country.Ukraine, M49Code = "804", Cep1CrCode = 2_00_140, Alpha2Code = "UA", Alpha3Code = "UKR", Name = "Ukraine", ChineseName = "乌克兰", Continent = Continent.Europe, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static Antarctique() { _country = new CountryInfo { Country = Country.Antarctica, CountryCode = CountryCode.AQ, CountryType = CountryType.Country, BelongsToCountry = Country.Antarctica, M49Code = "010", Cep1CrCode = 7_00_010, Alpha2Code = "AQ", Alpha3Code = "ATA", Name = "Antarctica", ChineseName = "南极洲", Continent = Continent.Antarctica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static ChristmasIsland() { _country = new CountryInfo { Country = Country.ChristmasIsland, CountryCode = CountryCode.CX, CountryType = CountryType.Region, BelongsToCountry = Country.Australia, M49Code = "162", Cep1CrCode = 1_00_110, Alpha2Code = "CX", Alpha3Code = "CXR", Name = "Christmas Island", ChineseName = "圣诞岛", Continent = Continent.Asia, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
public List <CountryInfo> GetAllCountryInfo() { try { List <CountryInfo> OBJ_LIST_CountryInfo = new List <CountryInfo>(); var _ListCountryInfo = _IUoW.Repository <CountryInfo>().Get(x => x.AuthStatusId == "A" && x.LastAction != "DEL").OrderByDescending(x => x.CountryId); foreach (var item in _ListCountryInfo) { CountryInfo OBJ_CountryInfo = new CountryInfo(); CurrencyInfoService OBJ_CurrencyInfoService = new CurrencyInfoService(); OBJ_CountryInfo.CountryId = item.CountryId; OBJ_CountryInfo.CountryNm = item.CountryNm; OBJ_CountryInfo.CountryShortNm = item.CountryShortNm; OBJ_CountryInfo.ISOCode = item.ISOCode; OBJ_CountryInfo.CBCode = item.CBCode; OBJ_CountryInfo.NationalityName = item.NationalityName; OBJ_CountryInfo.CurrencyId = item.CurrencyId; foreach (var item1 in OBJ_CurrencyInfoService.GetCurrencyInfoForDD()) { if (item1.Value == OBJ_CountryInfo.CurrencyId) { OBJ_CountryInfo.CurrencyNm = item1.Text; } } OBJ_CountryInfo.NativeCountryFlag = item.NativeCountryFlag; OBJ_CountryInfo.AuthStatusId = item.AuthStatusId; OBJ_CountryInfo.LastAction = item.LastAction; OBJ_CountryInfo.LastUpdateDT = item.LastUpdateDT; OBJ_CountryInfo.MakeBy = item.MakeBy; OBJ_CountryInfo.MakeDT = item.MakeDT; OBJ_CountryInfo.TransDT = item.TransDT; OBJ_LIST_CountryInfo.Add(OBJ_CountryInfo); } return(OBJ_LIST_CountryInfo); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "GetAllCountryInfo()", string.Empty); return(null); } }
public static CountryInfo getCountryInfo(int prop_id) { //uspGetCountryInfo @PropID CountryInfo country_info = new CountryInfo(); try { using (SqlConnection con = new SqlConnection(connString)) { using (SqlCommand cmd = new SqlCommand("uspGetCountryInfo", con)) { con.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@PropID", SqlDbType.Int).Value = prop_id; using (SqlDataReader reader = cmd.ExecuteReader()) { if (reader.HasRows) { if (reader.Read()) { //more code country_info.country = reader[0].ToString(); country_info.state = reader[1].ToString(); country_info.city = reader[2].ToString(); } } } con.Close(); } } } catch (Exception ex) { // throw ex; // return 0; } return(country_info); }
public CountryInfo GetCountryInfoBy(CountryInfo _CountryInfo) { try { if (_CountryInfo == null) { return(_CountryInfo); } return(_IUoW.Repository <CountryInfo>().GetBy(x => x.CountryId == _CountryInfo.CountryId && x.AuthStatusId == "A" && x.LastAction != "DEL")); } catch (Exception ex) { _ObjErrorLogService = new ErrorLogService(); _ObjErrorLogService.AddErrorLog(ex, string.Empty, "GetCountryInfoBy(obj)", string.Empty); return(null); } }
static SolomonIslands() { _country = new CountryInfo { Country = Country.SolomonIslands, CountryCode = CountryCode.SB, CountryType = CountryType.Country, BelongsToCountry = Country.SolomonIslands, M49Code = "090", Cep1CrCode = 6_00_115, Alpha2Code = "SB", Alpha3Code = "SLB", Name = "Solomon Islands", ChineseName = "所罗门群岛", Continent = Continent.Oceania, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static Bonaire() { _country = new CountryInfo { Country = Country.Bonaire, CountryCode = CountryCode.BQ, CountryType = CountryType.Region, BelongsToCountry = Country.Netherlands, M49Code = "535", Cep1CrCode = 4_00_109, Alpha2Code = "BQ", Alpha3Code = "BES", Name = "Bonaire, Sint Eustatius and Saba", ChineseName = "波内赫、圣尤斯特歇斯和萨巴", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static Martinique() { _country = new CountryInfo { Country = Country.Martinique, CountryCode = CountryCode.MQ, CountryType = CountryType.Region, BelongsToCountry = Country.France, M49Code = "474", Cep1CrCode = 4_00_122, Alpha2Code = "MQ", Alpha3Code = "MTQ", Name = "Martinique", ChineseName = "马提尼克岛", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static Curaçao() { _country = new CountryInfo { Country = Country.Curaçao, CountryCode = CountryCode.CW, CountryType = CountryType.Region, BelongsToCountry = Country.Netherlands, M49Code = "531", Cep1CrCode = 4_00_112, Alpha2Code = "CW", Alpha3Code = "CUW", Name = "Curaçao", ChineseName = "库拉索", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static UnitedStatesMinorOutlyingIslands() { _country = new CountryInfo { Country = Country.UnitedStatesMinorOutlyingIslands, CountryCode = CountryCode.UM, CountryType = CountryType.Region, BelongsToCountry = Country.UnitedStates, M49Code = "581", Cep1CrCode = 4_00_136, Alpha2Code = "UM", Alpha3Code = "UMI", Name = "United States Minor Outlying Islands", ChineseName = "美国本土外小岛屿", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static Guadeloupe() { _country = new CountryInfo { Country = Country.Guadeloupe, CountryCode = CountryCode.GP, CountryType = CountryType.Region, BelongsToCountry = Country.France, M49Code = "312", Cep1CrCode = 4_00_118, Alpha2Code = "GP", Alpha3Code = "GLP", Name = "Guadeloupe", ChineseName = "瓜德罗普", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static TurksAndCaicosIslands() { _country = new CountryInfo { Country = Country.TurksAndCaicosIslands, CountryCode = CountryCode.TC, CountryType = CountryType.Country, BelongsToCountry = Country.TurksAndCaicosIslands, M49Code = "796", Cep1CrCode = 4_00_135, Alpha2Code = "TC", Alpha3Code = "TCA", Name = "The Turks and Caicos Islands", ChineseName = "特克斯和凯科斯群岛", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static Belize() { _country = new CountryInfo { Country = Country.Belize, CountryCode = CountryCode.BZ, CountryType = CountryType.Country, BelongsToCountry = Country.Belize, M49Code = "084", Cep1CrCode = 4_00_107, Alpha2Code = "BZ", Alpha3Code = "BLZ", Name = "Belize", ChineseName = "伯利兹", Continent = Continent.NorthAmerica, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = GetRegionEnumValue }; }
static NewCaledonia() { _country = new CountryInfo { Country = Country.NewCaledonia, CountryCode = CountryCode.NC, CountryType = CountryType.Country, BelongsToCountry = Country.NewCaledonia, M49Code = "540", Cep1CrCode = 6_00_109, Alpha2Code = "NC", Alpha3Code = "NCL", Name = "New Caledonia", ChineseName = "新喀里多尼亚", Continent = Continent.Oceania, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
static Hungary() { _country = new CountryInfo { Country = Country.Hungary, CountryCode = CountryCode.HU, CountryType = CountryType.Country, BelongsToCountry = Country.Hungary, M49Code = "348", Cep1CrCode = 2_00_013, Alpha2Code = "HU", Alpha3Code = "HUN", Name = "Hungary", ChineseName = "匈牙利", Continent = Continent.Europe, I18NIdentityCode = I18N_IDENTITY_CODE, GetRegionEnumValue = RegionEnumHelper.Unknown }; }
public ActionResult Index() { var items = new List <CountryInfo>(); foreach (CountryCode countryCode in Enum.GetValues(typeof(CountryCode))) { var item = new CountryInfo(); item.Name = this.GetName(countryCode); item.CountryCode = countryCode.ToString(); item.PublicHolidayCount = DateSystem.GetPublicHoliday(DateTime.Now.Year, countryCode).GroupBy(o => o.Date).Count(); if (item.PublicHolidayCount > 0) { items.Add(item); } } return(View(items)); }
/// <summary> /// Gets the list of countries. /// </summary> /// <returns>List of countries.</returns> public List <CountryInfo> GetCountries() { List <CountryInfo> countries = new List <CountryInfo>(); // Execute a query to read the countries. using (SqlDataReader reader = SQLHelper.ExecuteReader(SQLHelper.CONNECTION_STRING, CommandType.Text, SQLHelper.GetSQLStatement(MODULE_NAME, "SQL_GET_COUNTRIES"), null)) { while (reader.Read()) { CountryInfo country = new CountryInfo(reader.GetInt32(0), reader.GetString(1), reader.GetBoolean(2)); countries.Add(country); } } return(countries); }
private static void Main() { string currentLine = Console.ReadLine(); CitiesByCountry populationDatabase = new CitiesByCountry(); while (currentLine != "report") { string[] cityCountryPolulation = currentLine.Split('|'); string city = cityCountryPolulation[0]; string country = cityCountryPolulation[1]; ulong population = ulong.Parse(cityCountryPolulation[2]); if (!populationDatabase.ContainsKey(country)) { populationDatabase[country] = new CountryInfo(country); } populationDatabase[country].Cities.Add(new CityInfo(city, population)); populationDatabase[country].Population += population; currentLine = Console.ReadLine(); } var orderedCountries = populationDatabase.OrderByDescending(c => c.Value.Population); foreach (var item in orderedCountries) { Console.WriteLine("{0} (total population: {1})", item.Key, item.Value.Population); var orderedCities = item.Value.Cities.OrderByDescending(c => c.Population); foreach (CityInfo city in orderedCities) { Console.WriteLine("=>{0}: {1}", city.Name, city.Population); } } }
public PlaceInfo(Bobs.Place place) { this.name = place.UniqueName; this.k = place.K; this.country = new CountryInfo(place.Country); }
internal TeeyootLocalizationInfo(CountryInfo countryInfo) { Country = countryInfo.Country; CountryIsoCode = countryInfo.CountryIsoCode; }
/// <summary> /// Gets and bulk updates countries. Called when the "Get and bulk update countries" button is pressed. /// Expects the CreateCountry method to be run first. /// </summary> private bool GetAndBulkUpdateCountries() { // Prepare the parameters string where = "CountryName LIKE N'MyNewCountry%'"; // Get the data DataSet countries = CountryInfoProvider.GetCountries(where, null); if (!DataHelper.DataSourceIsEmpty(countries)) { // Loop through the individual items foreach (DataRow countryDr in countries.Tables[0].Rows) { // Create object from DataRow CountryInfo modifyCountry = new CountryInfo(countryDr); // Update the property modifyCountry.CountryDisplayName = modifyCountry.CountryDisplayName.ToUpper(); // Update the country CountryInfoProvider.SetCountryInfo(modifyCountry); } return true; } return false; }