public static AdddressDetails GetAddressDetailsFromReader(IDataReader reader)
 {
     AdddressDetails addressDetailsCol = new AdddressDetails();
     while (reader.Read())
         addressDetailsCol = GetAddressDetails(reader);
     return addressDetailsCol;
 }
        private void PopulateMap(IncidentDetails incidentDetails, AdddressDetails incidentAddr, StoreDetails loggedinUserAddress)
        {
            IncidentMap.MapType = MapType.Roadmap;
            IncidentMap.EnterpriseKey = Utility.GetGoogleAPIKey();
            IncidentMap.Latitude = incidentAddr.Latitude;
            IncidentMap.Longitude = incidentAddr.Longitude;
            IncidentMap.Zoom = Utility.GetGoogleZoomLevel(incidentAddr.Latitude, incidentAddr.Longitude, loggedinUserAddress.Store_Address.Latitude, loggedinUserAddress.Store_Address.Longitude);

            MarkerImage incidentMarkerIamge = new MarkerImage();
            incidentMarkerIamge.Url = "http://www.eyedentify.co.nz/Images/Map/map_Incident_Icon.jpg";

            MarkerImage homeMarkerIamge = new MarkerImage();
            homeMarkerIamge.Url = "http://www.eyedentify.co.nz/Images/Map/map_Home_Icon.png";

            Marker incidentMarker = new Marker();
            incidentMarker.Address = incidentAddr.Latitude + " " + incidentAddr.Longitude;
            incidentMarker.Info = incidentDetails.Description;
            incidentMarker.Icon = incidentMarkerIamge;
            IncidentMap.Markers.Add(incidentMarker);

            Marker yourAddressMarker = new Marker();
            yourAddressMarker.Address = loggedinUserAddress.Store_Address.Latitude + " " + loggedinUserAddress.Store_Address.Longitude;
            yourAddressMarker.Info = "Your Store";
            yourAddressMarker.Icon = homeMarkerIamge;
            IncidentMap.Markers.Add(yourAddressMarker);
        }
        public static AdddressDetails GetAddressDetails(IDataReader reader)
        {
            var sgeo = SqlGeography.Parse(reader["Geo_Code"].ToString());
            double latitude = sgeo.Lat.Value;
            double longitude = sgeo.Long.Value;

            AdddressDetails addressDetails = new AdddressDetails(
                int.Parse(reader["Address_ID"].ToString()),
                reader["Unit_Number"].ToString(),
                int.Parse(reader["Street_Number"].ToString()),
                reader["Street_Name"].ToString(),
                reader["Suburb"].ToString(),
                reader["City"].ToString(),
                reader["State"].ToString(),
                reader["Country"].ToString(),
                reader["Post_Code"].ToString(),
                latitude,
                longitude);
            return addressDetails;
        }
        private void PopulateLabels(IncidentDetails id, string userID, AdddressDetails incidentAddr)
        {
            if (!id.Store_Name.Equals(string.Empty))
                LocationLabel.Text = id.Store_Name + ", ";
            else
                LocationLabel.Text = string.Empty;
            LocationLabel.Text = LocationLabel.Text + incidentAddr.Suburb + ", " + incidentAddr.City + ", " + incidentAddr.Country;

            TimeLabel.Text = id.Incident_datetime.ToShortDateString() + " " + id.Incident_datetime.ToShortTimeString();

            DescriptionLabel.Text = id.Description;
            if (id.People_Involved == 0)
            {
                PeopleInvolvedLabel.Text = "No details of involved offenders";
            }
            else
            {
                PeopleInvolvedLabel.Text = id.People_Involved + "";
                PeopleBindData(id.Incident_people);
            }

            List<IncidentTypeDetails> itds = sip.Incident_Get_Types(id.Incident_ID);
            string incidentTypeString = string.Empty;
            if (itds.Count == 0)
            {
                incidentTypeString = "type of incident not defined";
            }
            else
            {
                foreach (IncidentTypeDetails itd in itds)
                {
                    incidentTypeString += itd.Incident_Type_Name + ", ";
                }
            }
            TypeLabel.Text = incidentTypeString.Substring(0, incidentTypeString.Length - 2);
        }