コード例 #1
0
        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()
            });
        }
コード例 #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);
 }