public void SaveOneTown()
        {
            Town town = _repository.GetAllList().Query(_city, _district, _town);

            if (town != null)
            {
                return;
            }
            _repository.Insert(new Town
            {
                CityName     = _city.Trim(),
                DistrictName = _district.Trim(),
                TownName     = _town.Trim()
            });
        }
Beispiel #2
0
 /// <summary>
 /// Method whose purpose is to insert a
 /// new town in the database.
 /// </summary>
 /// <param name="town">
 /// Newly created TownModel object.
 /// </param>
 /// <returns>
 /// Returns true if the query is successfully executed
 /// otherwise returns false.
 /// </returns>
 public bool Insert(TownModel town)
 {
     return(_townRepository.Insert(town) > 0 ? true : false);
 }