public void SaveNewLocation(GeocodingAddressModelQueryParams parameters) { //get data from API RootGeocodingDataModel <GeocodingAddressResponseModel> data = _geocodingDomain.GetCoordsFromAddress(parameters); County county = _countiesDomain.GetCountyByCountyName(parameters.County); if (county != null) { District district = _districtDomain.RetrieveDistrictByCountyName(parameters.County); //save in database int affectedRows = _locationDomain.InsertLocationData(data, district.Id_District, county.CountyId); } }
public int GetHistoryEvaporationByCountyName(string countyName) { County county = _countiesDomain.GetCountyByCountyName(countyName); if (county != null) { District district = _districtDomain.RetrieveDistrictByCountyName(countyName); string[] evaporationhistory = _weatherHistoryDomain.GetHistoryEvaporationByCountyName(county, district.DistrictName); if (evaporationhistory.Length == 0) { return(-1); } int affectedrows = _weatherHistoryDomain.SaveEvaporationHistoryInDatabase(evaporationhistory, county.CountyId); return(affectedrows); } return(0); }
public District RetrieveDistrictByCountyName(string countyName) => _districtDomain.RetrieveDistrictByCountyName(countyName);