예제 #1
0
        public string GetLocationByIID(Int64 locationIID)
        {
            try
            {
                Int64  locID       = 0;
                string fulladdress = null;
                OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext();
                var material = dbContext.Materials.FirstOrDefault(x => x.IID == locationIID);
                if (material != null)
                {
                    locID = material.LocationID;
                }
                var location = dbContext.SP_GetLocationForGoogleMap(locID).SingleOrDefault();
                fulladdress = location.CurrentLocation + ',' + location.PoliceStationName + ',' + location.DistrictName + ',' + location.DivisionOrStateName + ',' + location.CountryName;

                dbContext.Dispose();
                return(fulladdress);
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }