partial void DeletegeoLocation(geoLocation instance);
partial void UpdategeoLocation(geoLocation instance);
partial void InsertgeoLocation(geoLocation instance);
public void Delete(geoLocation address) { db.geoLocations.DeleteOnSubmit(address); }
// // Insert/Delete Methods public void Add(geoLocation address) { db.geoLocations.InsertOnSubmit(address); }
public ActionResult Index(string urlEnter, geoLocation location) { var address = addressObj.AllLocations().ToList(); var url = Request.Form["urlEnter"]; int x = 0; bool found = false; string Locations = ""; while (x != address.Count) { if (address[x].URL == url) { found = true; break; } x++; } if (found) { ViewData["URL"] = address[x].URL; ViewData["IP"] = address[x].IP; ViewData["Latitude"] = address[x].Latitude; ViewData["Longitude"] = address[x].Longitute; Locations += Environment.NewLine + " map.addOverlay(new GMarker(new GLatLng(" + address[x].Latitude + "," + address[x].Longitute + ")));"; } else { var ip = addressObj.FindIpAddress(urlEnter); if (ip != null) { DataTable dt = addressObj.GetGeoLocationByIP(ip); location.IP = ip; location.URL = urlEnter; if (dt.Rows.Count > 0) { if (dt.Rows.Count == 12) { location.City = dt.Rows[0]["City"].ToString(); location.Region = dt.Rows[0]["StateProvince"].ToString(); } location.Country = dt.Rows[0]["Country"].ToString(); location.CountryCode = dt.Rows[0]["CountryCode"].ToString(); location.Latitude = dt.Rows[0]["Latitude"].ToString(); location.Longitute = dt.Rows[0]["Longitude"].ToString(); addressObj.Add(location); addressObj.Save(); ViewData["URL"] = location.URL; ViewData["IP"] = location.IP; ViewData["Latitude"] = location.Latitude; ViewData["Longitude"] = location.Longitute; // Locations += Environment.NewLine + " map.addOverlay(new GMarker(new GLatLng(" + location.Latitude + "," + location.Longitute + ")));"; } else { } } } return View(); }