protected WebLocationSearch() { objLocPresenter = new locSearchPresenter(this); objNearByPre = new nearbyPointPresenter(this); objSvcInfo = ServiceInfo.ServiceConfig; objDataPointInfo = DataPointInfo.getDataPointObject; objLocInfo = LocationInfo.getLocationInfoObj; }
//Method to fetch near by stations public DataSet getNearByStations(double dlat, double dlong, int intMaxAllowedDist, int intMaxAllowedAlt, int intResultCount) { DataTable dtStations = new DataTable(); DataSet ds = new DataSet(); try { ObjNearByPre = new nearbyPointPresenter(this); ObjNearByPre.getNearbyDataService(dlat, dlong, intMaxAllowedDist, intMaxAllowedAlt, intResultCount); ds.Tables.Add(dtNearByPoints); } catch (Exception ex) { AgriCastException currEx = new AgriCastException(GetServiceDetails(), ex); AgriCastLogger.Publish(currEx, AgriCastLogger.LogType.Error); // HttpContext.Current.Session["ErrorMessage"] = objComUtil.getTransText(Constants.WS_GETSVCDATA_FAILURE) + " : " + ex.Message.ToString(); } finally { IDictionary dictAudit = new Hashtable(); dictAudit["userIP"] = "";// HttpContext.Current.Request.UserHostAddress; dictAudit["userID"] = ""; dictAudit["token"] = ""; dictAudit["referrer"] = "none"; dictAudit["entrancePath"] = HttpContext.Current != null ? "EmbeddedJS" : "WebService"; dictAudit["culture"] = ""; dictAudit["sessionID"] = "";// HttpContext.Current.Session.SessionID; dictAudit["service"] = "LocSearchWebService"; dictAudit["module"] = ""; dictAudit["locSearchType"] = ""; dictAudit["locSearchStringType"] = ""; dictAudit["locSearchString"] = ""; dictAudit["locSearchDatasource"] = ""; dictAudit["numOfLocs"] = 0; if (dlat == 0) dictAudit["searchLat"] = DBNull.Value; else dictAudit["searchLat"] = dlat; if (dlong == 0) dictAudit["searchLong"] = DBNull.Value; else dictAudit["searchLong"] = dlong; dictAudit["countryName"] = ""; dictAudit["locName"] = ""; dictAudit["weatherDatasource"] = ""; dictAudit["weatherLat"] = DBNull.Value; dictAudit["weatherLong"] = DBNull.Value; dictAudit["weatherDateFrom"] = ""; dictAudit["weatherDateTo"] = ""; dictAudit["weatherSeries"] = ""; dictAudit["weatherParams"] = DBNull.Value; objSvcPre.SaveServiceAuditData(dictAudit); } return ds; }