public void Save(CountryViewModel country) { Country coutr = new Country(country.id) { Name = country.Name, Code = country.Code, Currency = country.Currency }; _countryRepository.Save(coutr); }
CountryViewModel Map(Country country) { return new CountryViewModel { id = country.Id, Name = country.Name, Currency = country.Currency, Code = country.Code, isActive = country._Status == EntityStatus.Active ? true : false }; }
protected ValidationResultInfo Validate(Country country) { return _countryRepository.Validate(country); }
protected Country Map(CountryImport countryImport) { var exists = Queryable.FirstOrDefault(_context.tblCountry, p => p.Code == countryImport.Code); Guid id = exists != null ? exists.id : Guid.NewGuid(); var country = new Country(id); country.Name = countryImport.Name; country.Code = countryImport.Code; country.Currency = ""; return country; }
public CountryDTO Map(Country country) { if (country == null) return null; return Mapper.Map<Country, CountryDTO>(country); }
public static Country Map(this tblCountry country) { Country cntry = new Country(country.id) { Name = country.Name, Code=country.Code, Currency=country.Currency }; cntry._SetStatus((EntityStatus)country.IM_Status); cntry._SetDateCreated(country.IM_DateCreated); cntry._SetDateLastUpdated(country.IM_DateLastUpdated); return cntry; }
public bool CheckCountryIsUsed(Country country, EntityStatus intendedStatus) { if (intendedStatus == EntityStatus.Inactive) { if (_ctx.tblRegion.Any(n => n.Country == country.Id && n.IM_Status == (int)EntityStatus.Active)) return true; } else if (intendedStatus == EntityStatus.Deleted) { if (_ctx.tblRegion.Any(n => n.Country == country.Id && (n.IM_Status == (int)EntityStatus.Active || n.IM_Status == (int)EntityStatus.Inactive))) return true; } return false; }
protected Guid AddCountry(string name, string currency, string code) { Country country = new Country(Guid.NewGuid(), DateTime.Now, DateTime.Now, EntityStatus.Active) { Name = name, Currency=currency, Code=code }; return _countryRepository.Save(country); }
private void AssertCountry(Country country, Country savedCountry) { Assert.AreEqual(country.Code,savedCountry.Code); Assert.AreEqual(country.Name,savedCountry.Name); Assert.AreEqual(country.Currency,savedCountry.Currency); Assert.AreEqual(country._Status,EntityStatus.Active); }