private static MapRequest CreateMapRequest(MapRequestAVM mapRequestAVM) { var mapRequest = new MapRequest(mapRequestAVM.Email, mapRequestAVM.Latitude.Value, mapRequestAVM.Longitude.Value, DateTime.Now); using (MediatelModel context = new MediatelModel()) { context.MapRequests.Add(mapRequest); context.SaveChanges(); } return(mapRequest); }
private static MapRequest CreateMapRequest(MapRequestVM mapRequestVM) { double latitude = MapRequestsHelper.ConvertLatitude(mapRequestVM.LatDegrees, mapRequestVM.LatMinutes, mapRequestVM.LatSeconds, mapRequestVM.LatDirection); double longitude = MapRequestsHelper.ConvertLongitude(mapRequestVM.LonDegrees, mapRequestVM.LonMinutes, mapRequestVM.LonSeconds, mapRequestVM.LonDirection); var mapRequest = new MapRequest(mapRequestVM.Email, latitude, longitude, DateTime.Now); using (MediatelModel context = new MediatelModel()) { context.MapRequests.Add(mapRequest); context.SaveChanges(); } return(mapRequest); }
private static MapSearchResult CreateMapSearchResult(MapSearchResultVM mapSearchResultVM, int mapRequestId) { MapSearchResult mapSearchResult = new MapSearchResult(); mapSearchResult.City = mapSearchResultVM.City; mapSearchResult.Country = mapSearchResultVM.Country; mapSearchResult.DateCreate = DateTime.Now; mapSearchResult.HouseNumber = mapSearchResultVM.HouseNumber; mapSearchResult.MapRequestId = mapRequestId; mapSearchResult.PostCode = mapSearchResultVM.PostCode; mapSearchResult.ResultCode = mapSearchResultVM.ResultCode; using (MediatelModel context = new MediatelModel()) { context.MapSearchResults.Add(mapSearchResult); context.SaveChanges(); } return(mapSearchResult); }