Exemplo n.º 1
0
        public static GeoPoint GetGeoPointFromDB(string streetAndNumber, string zipCode, string city, string countryCode)
        {
            Data.CSBooster_DataAccessDataContext csbDAC = new _4screen.CSB.DataAccess.Data.CSBooster_DataAccessDataContext();
            var cachedGeoPoint = csbDAC.hisp_GeoKoordinates_Get(streetAndNumber, zipCode, city, countryCode).ElementAtOrDefault(0);

            if (cachedGeoPoint != null)
            {
                GeoPoint geoPoint = new GeoPoint()
                {
                    StreetAndNumber = cachedGeoPoint.GEO_Street, ZipCode = cachedGeoPoint.GEO_PLZ, City = cachedGeoPoint.GEO_City, Region = cachedGeoPoint.GEO_Kanton, CountryCode = cachedGeoPoint.GEO_Land, Lat = cachedGeoPoint.GEO_Breite, Long = cachedGeoPoint.GEO_Laenge,
                };
                return(geoPoint);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public static string GetDelimitedCommunityIDs(string delimitedCommunities, char delimiter)
        {
            string allObjs = string.Empty;

            if (!string.IsNullOrEmpty(delimitedCommunities))
            {
                string   allObjsToFind = string.Empty;
                string[] ids           = delimitedCommunities.RemoveDuplicates(delimiter).Split(delimiter);
                foreach (string id in ids)
                {
                    if (id.Length > 0)
                    {
                        if (id.IsGuid())
                        {
                            allObjs += id + "|";
                        }
                        else
                        {
                            allObjsToFind += string.Format("{0}|", id);
                        }
                    }
                }
                if (allObjsToFind.Length > 0)
                {
                    allObjsToFind = allObjsToFind.TrimEnd('|');
                    Data.CSBooster_DataAccessDataContext csbDAC = new _4screen.CSB.DataAccess.Data.CSBooster_DataAccessDataContext();
                    var founsIDs = csbDAC.hisp_Community_GetIDSByVUrls(allObjsToFind);
                    foreach (var foundID in founsIDs)
                    {
                        allObjs += foundID.CTY_ID.ToString() + "|";
                    }
                }
                if (allObjs.Length > 0)
                {
                    allObjs = allObjs.TrimEnd('|');
                    allObjs.RemoveDuplicates('|');
                }
            }
            return(allObjs);
        }
Exemplo n.º 3
0
 public static void StoreGeoPointInDB(GeoPoint geoPoint)
 {
     Data.CSBooster_DataAccessDataContext csbDAC = new _4screen.CSB.DataAccess.Data.CSBooster_DataAccessDataContext();
     csbDAC.hisp_GeoKoordinates_Save(geoPoint.StreetAndNumber, geoPoint.ZipCode, geoPoint.City, geoPoint.CountryCode, geoPoint.Region, geoPoint.Lat, geoPoint.Long);
 }
Exemplo n.º 4
0
 public static void Delete(Guid comId)
 {
     _4screen.CSB.DataAccess.Data.CSBooster_DataAccessDataContext cdc = new _4screen.CSB.DataAccess.Data.CSBooster_DataAccessDataContext(ConfigurationManager.ConnectionStrings["CSBoosterConnectionString"].ConnectionString);
     cdc.hisp_Comments_SetCommentStatus(comId, (int?)CommentStatus.Deleted);
 }