/// <summary>
        /// Queries Graph containing Facebook context items for Facebook Checkin info
        /// and calls MyLoDB method to add to DB
        /// </summary>
        private void AddFacebookCheckins()
        {
            string sparqlQ = "PREFIX mylo: <http://mylo.com/schema/> " +
                             "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " +
                             "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
                             "SELECT  DISTINCT ?activity ?time ?placename ?sourceId ?lat ?long ?state ?street ?city ?zip ?country ?name " +
                             "WHERE {" +
                             "      ?activity rdf:type mylo:Activity ." +
                             "      ?activity rdf:type mylo:FacebookCheckin ." +
                             "      ?activity mylo:HasLocation ?loc ." +
                             "      ?activity mylo:HasSourceId ?sourceId ." +
                             "      ?loc mylo:HasLocationName ?placename ." +
                             "      ?loc mylo:HasGpsLatitude ?lat ." +
                             "      ?loc mylo:HasGpsLongitude ?long ." +
                             "      ?activity mylo:HasTimePeriod ?period ." +
                             "      ?period rdf:type mylo:Instant ." +
                             "      ?period mylo:HasTimeValue ?time ." +
                             "      OPTIONAL { ?loc mylo:HasAddress ?adr }" +
                             "      OPTIONAL { ?adr mylo:HasState ?state }" +
                             "      OPTIONAL { ?adr mylo:HasCity ?city }" +
                             "      OPTIONAL { ?adr mylo:HasZip ?zip }" +
                             "      OPTIONAL { ?adr mylo:HasCountry ?country }" +
                             "      OPTIONAL { ?adr mylo:HasStreet ?street }" +
                             "      OPTIONAL { ?activity mylo:HasPersonCheckinTag ?name }" +
                             "}";
            try
            {
                SparqlQueryParser sparqlparser = new SparqlQueryParser();
                SparqlQuery query = sparqlparser.ParseFromString(sparqlQ);
                Object results = _store.ExecuteQuery(query);
                if (results is SparqlResultSet)
                {
                    Dictionary<string, INode> vals = new Dictionary<string, INode>();
                    SparqlResultSet rset = (SparqlResultSet)results;
                    foreach (SparqlResult r in rset)
                    {
                        foreach (string var in rset.Variables)
                        {

                            if (r.HasValue(var))
                            {
                                vals[var] = r[var];
                            }
                            else
                            {
                                vals[var] = null;
                            }
                        }
                        try
                        {
                            Activity act = new Activity();
                            Address loc = new Address();
                            TimePeriod startDate = new TimePeriod();
                            TimePeriod endDate = new TimePeriod();
                            if (vals["sourceId"] != null)
                            {
                                act.SourceId = vals["sourceId"].ToString();
                            }
                            if (vals["time"] != null)
                            {
                                string[] parts = vals["time"].ToString().Split('^');
                                startDate.AltKey = Convert.ToDateTime(parts[0]);
                                //endDate.AltKey = DateTime.MinValue;
                                endDate.AltKey = startDate.AltKey;
                                act.StartDate = startDate.AltKey;
                                act.EndDate = endDate.AltKey;
                                startDate.Hour = (short)startDate.AltKey.Hour;
                                startDate.Year = (short)startDate.AltKey.Year;
                                startDate.Month = (short)startDate.AltKey.Month;
                                startDate.Day = startDate.AltKey.DayOfWeek.ToString();
                                startDate.DayNumber = (short)startDate.AltKey.Day;
                            }
                            if (vals["placename"] != null)
                            {
                                act.ActivityName = vals["placename"].ToString();
                            }
                            if (vals["lat"] != null)
                            {
                                string[] parts = vals["lat"].ToString().Split('^');
                                act.Latitude = Convert.ToDouble(parts[0]); ;
                            }
                            if (vals["long"] != null)
                            {
                                string[] parts = vals["long"].ToString().Split('^');
                                act.Longitude = Convert.ToDouble(parts[0]);
                            }

                            Address locGps = new Address();
                            if (vals["lat"] != null && vals["long"] != null)
                            {
                                locGps = ReverseLookupGPScoordinates(act.Latitude, act.Longitude);
                            }

                            if (vals["street"] != null)
                            {
                                loc.Street = vals["street"].ToString();
                            }
                            else
                            {
                                if (locGps.Street != null || locGps.Street != " ")
                                {
                                    loc.Street = locGps.Street;
                                }
                            }
                            if (vals["city"] != null)
                            {
                                loc.City = vals["city"].ToString();
                            }
                            else
                            {
                                if (locGps.City != null || locGps.City != " ")
                                {
                                    loc.City = locGps.City;
                                }
                            }
                            if (vals["state"] != null)
                            {
                                loc.State = vals["state"].ToString();
                            }
                            else
                            {
                                if (locGps.State != null || locGps.State != " ")
                                {
                                    loc.State = locGps.State;
                                }
                            }
                            if (vals["zip"] != null)
                            {
                                loc.Zip = vals["zip"].ToString();
                            }
                            else
                            {
                                if (locGps.Zip != null || locGps.Zip != " ")
                                {
                                    loc.Zip = locGps.Zip;
                                }
                            }
                            if (vals["country"] != null)
                            {
                                loc.Country = vals["country"].ToString();
                            }
                            else
                            {
                                if (locGps.Country != null || locGps.Country != " ")
                                {
                                    loc.Country = locGps.Country;
                                }
                            }

                            act.Source = "Facebook";
                            act.ActivityKind = "FacebookCheckin";
                            Debug.WriteLine("Loc is: {0}, {1}, {2}, {3}, {4}", loc.Street, loc.City, loc.State, loc.Zip, loc.Country);
                            act.ActivityId = _myloStore.AddActivity(_userId, act, startDate, endDate, loc);

                            if (vals["name"] != null)
                            {
                                Party party = new Party();
                                party.Name = vals["name"].ToString();
                                party.PartyKind = "Person";
                                party.PartyId = _myloStore.AddParty(_userId, party);
                                long result2 = _myloStore.AddPartyToActivityByIds(_userId, party, act);
                            }
                        }
                        catch (MyLoDataStoreException dsEx)
                        {
                            throw new MyLoException("DataStore Error: Inner exception: " + dsEx);
                        }
                        catch (Exception ex)
                        {
                            throw new MyLoException("Add Activity Error: Inner exception: " + ex);
                        }
                    }

                }
            }
            catch (RdfException rdfEx)
            {
                throw new MyLoException("Save Context RDF Error: Inner exception: " + rdfEx);
            }
            catch (Exception ex)
            {
                throw new MyLoException("Save Context Error: Inner exception: " + ex);
            }
        }
 /// <summary>
 /// Queries Graph containing Facebook context items for Facebook Post info
 /// and calls MyLoDB method to add to DB
 /// </summary>
 private void AddFacebookPeople()
 {
     string sparqlQ = "PREFIX mylo: <http://mylo.com/schema/> " +
                      "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " +
                      "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
                      "SELECT DISTINCT ?fbname ?fbid " +
                      "WHERE {" +
                      "      ?person rdf:type mylo:Person ." +
                      "      ?person mylo:FacebookId ?fbid ." +
                      "      ?person mylo:FacebookName ?fbname ." +
                      "}";
     try
     {
         SparqlQueryParser sparqlparser = new SparqlQueryParser();
         SparqlQuery query = sparqlparser.ParseFromString(sparqlQ);
         Object results = _store.ExecuteQuery(query);
         if (results is SparqlResultSet)
         {
             Dictionary<string, INode> vals = new Dictionary<string, INode>();
             SparqlResultSet rset = (SparqlResultSet)results;
             foreach (SparqlResult r in rset)
             {
                 foreach (string var in rset.Variables)
                 {
                     if (r.HasValue(var))
                     {
                         vals[var] = r[var];
                     }
                     else
                     {
                         vals[var] = null;
                     }
                 }
                 try
                 {
                     Party person = new Party();
                     if (vals["fbname"] != null)
                     {
                         person.Name = vals["fbname"].ToString();
                         person.PartyKind = "Person";
                         long result = _myloStore.AddParty(_userId, person);
                     }
                 }
                 catch (MyLoDataStoreException dsEx)
                 {
                     throw new MyLoException("DataStore Error: Inner exception: " + dsEx);
                 }
                 catch (Exception ex)
                 {
                     throw new MyLoException("Add People Error: Inner exception: " + ex);
                 }
             }
         }
     }
     catch (RdfException rdfEx)
     {
         throw new MyLoException("Save Context People Error: Inner exception: " + rdfEx);
     }
     catch (Exception ex)
     {
         throw new MyLoException("Save Context People Error: Inner exception: " + ex);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Retrieves Selected Photos in a MyLo DataStore for current account holder
        /// Using Dimension Ids
        /// </summary>
        /// <param name="userId">An identifier for a MyLo Account</param>
        /// <param name="timePeriod">An identifier for a Time Period</param>
        /// <param name="person">An identifier for a Party</param>
        /// <param name="address">An identifier for a Location</param>
        public DataSet GetPhotosByDimensionFields(long userId, Address addr, TimePeriod timePeriod, Party person)
        {
            DataSet ds = new DataSet();
            NpgsqlDataAdapter da = new NpgsqlDataAdapter();
            NpgsqlCommand command = new NpgsqlCommand();
            string withClause = "WITH parties AS ( " +
                                        "SELECT PAP.activityid FROM partyactivityparticipation AS PAP " +
                                        "JOIN person AS P ON P.partyid = PAP.partyid " +
                                        "WHERE P.name = @personname) ";
            string selectClause = "SELECT P.uri, P.datetaken, P.camera, P.gpslat, P.gpslong, P.thumbnail FROM photo AS P " +
                                                                "LEFT JOIN Activity AS A ON P.activityId = A.activityId " +
                                                                "JOIN TimePeriod AS TP ON A.starttimeperiodid = TP.timeperiodid " +
                                                                "LEFT JOIN Address AS L ON A.addressid = L.addressid ";
            string joinWithClause = "JOIN parties AS PTY ON PTY.activityid = A.activityid ";

            int i = 0;

            if (person.Name != String.Empty)
            {
                command.Parameters.Add(new NpgsqlParameter("personname", DbType.String));
                command.Parameters[i].Value = person.Name; i++;
                command.CommandText += withClause;
                command.CommandText += selectClause;
                command.CommandText += joinWithClause;
            }
            else
            {
                command.CommandText += selectClause;
            }
            string whereClause = " WHERE P.MyLoAccountId = @userid ";
            command.Parameters.Add(new NpgsqlParameter("userid", DbType.Int64));
            command.Parameters[i].Value = userId; i++;

            if (addr.City != String.Empty)
            {
                whereClause += "AND L.city = @city ";
                command.Parameters.Add(new NpgsqlParameter("city", DbType.String));
                command.Parameters[i].Value = addr.City; i++;
            }
            if (addr.Country != String.Empty)
            {
                whereClause += "AND L.country = @country ";
                command.Parameters.Add(new NpgsqlParameter("country", DbType.String));
                command.Parameters[i].Value = addr.Country; i++;
            }
            if (timePeriod.Year != 0)
            {
                whereClause += "AND TP.year = @year ";
                command.Parameters.Add(new NpgsqlParameter("year", DbType.Int16));
                command.Parameters[i].Value = timePeriod.Year; i++;
            }
            if (timePeriod.Month != 0)
            {
                whereClause += "AND TP.month = @month ";
                command.Parameters.Add(new NpgsqlParameter("month", DbType.Int16));
                command.Parameters[i].Value = timePeriod.Month; i++;
            }
            if (timePeriod.Day != String.Empty)
            {
                whereClause += "AND TP.dayname = @day ";
                command.Parameters.Add(new NpgsqlParameter("day", DbType.String));
                command.Parameters[i].Value = timePeriod.Day; i++;
            }

            command.CommandText += whereClause;
            command.Connection = _conn;
            da.SelectCommand = command;

            da.Fill(ds);
            _conn.Close();
            if (ds != null)
            {
                return ds;
            }
            else
            {
                return null;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Adds Party to an Activity in MyLo datastore using PostgreSQL function 'AddPartyToActivityByIds'
        /// </summary>
        /// <param name="userId">An identifier for a MyLoAccount holder</param>
        /// <param name="party">A Person instance with partyId set to identifier</param>
        /// <param name="activity">An Activity instance with AcyivtyId set to identifier</param>
        public long AddPartyToActivityByIds(long userId, Party party, Activity activity)
        {
            try
            {
                NpgsqlCommand command = new NpgsqlCommand("AddPartyToActivityByIds", _conn);
                command.CommandType = CommandType.StoredProcedure;

                // create 2 parameters for this function
                for (int i = 0; i < 4; i++)
                {
                    command.Parameters.Add(new NpgsqlParameter());
                }

                command.Parameters[0].DbType = DbType.Int64;
                command.Parameters[0].Value = userId;
                command.Parameters[1].DbType = DbType.Int64;
                command.Parameters[1].Value = party.PartyId;
                command.Parameters[2].DbType = DbType.String;
                command.Parameters[2].Value = party.PartyKind;
                command.Parameters[3].DbType = DbType.Int64;
                command.Parameters[3].Value = activity.ActivityId;

                long result = (long)command.ExecuteScalar();
                return result;

            }
            catch (NpgsqlException npex)
            {
                _conn.Close();
                throw new MyLoDataStoreException(npex.Message, npex);
            }
            catch (Exception ex)
            {
                _conn.Close();
                throw new MyLoDataStoreException(ex.Message);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Adds Party to MyLo datastore using PostgreSQL function 'addParty'
        /// </summary>
        /// <param name="userId">An identifier for a MyLoAccount holder</param>
        /// <param name="act">An Party instance</param>
        public long AddParty(long userId, Party person)
        {
            try
            {
                NpgsqlCommand command = new NpgsqlCommand("AddParty", _conn);
                command.CommandType = CommandType.StoredProcedure;

                // create 2 parameters for this function
                for (int i = 0; i < 2; i++)
                {
                    command.Parameters.Add(new NpgsqlParameter());
                }

                command.Parameters[0].DbType = DbType.Int64;
                command.Parameters[0].Value = userId;
                command.Parameters[1].DbType = DbType.String;
                command.Parameters[1].Value = String.IsNullOrEmpty(person.Name) ? null : person.Name;

                long result = (long)command.ExecuteScalar();
                return result;
            }
            catch (NpgsqlException npex)
            {
                _conn.Close();
                throw new MyLoDataStoreException(npex.Message, npex);
            }
            catch (Exception ex)
            {
                _conn.Close();
                throw new MyLoDataStoreException(ex.Message);
            }
        }
 /// <summary>
 /// Method for returning a all Photos using slection by Dimension(Time Party, Location) in a given context
 /// </summary>
 /// <param name="country">A country name</param>
 /// <param name="city">A city name</param>
 /// <param name="year">A year</param>
 /// <param name="month">A month</param>
 /// <param name="day">A day name</param>
 /// <param name="name">A unique name for a person</param>
 public DataSet GetPhotosByDimensionFields(string country, string city, string year, string month, string day, string name)
 {
     try
     {
         DataSet ds = new DataSet();
         if (country == String.Empty && city == String.Empty
             && year == String.Empty && month == String.Empty
             && day == String.Empty && name == String.Empty)
         {
             return ds;
         }
         else
         {
             Address loc = new Address();
             loc.Country = country; loc.City = city;
             TimePeriod tp = new TimePeriod();
             if (year != String.Empty)
             {
                 tp.Year = Convert.ToInt16(year);
             }
             else
             {
                 tp.Year = 0;
             }
             if (month != String.Empty)
             {
                 tp.Month = Convert.ToInt16(month);
             }
             else
             {
                 tp.Month = 0;
             }
             tp.Day = day;
             Party p = new Party();
             p.Name = name;
             return ds = _myLoStore.GetPhotosByDimensionFields(_userId, loc, tp, p);
         }
     }
     catch (MyLoException ex)
     {
         throw new Exception(ex.Message);
     }
 }
        private void AddEvents()
        {
            Address loc = new Address();
            TimePeriod start = new TimePeriod();
            TimePeriod end = new TimePeriod();
            Party person = new Party();
            Activity activity = new Activity();
            BingMapsGPSlookup gpsl = new BingMapsGPSlookup();

            // Setup the event called "Jeff and Tami's Wedding
            string city, street, zip, country, state;
            gpsl.LatLongToAddressLookup(47.7337578, -122.1469737, out street, out city, out state, out zip, out country);
            loc.Street = street;
            loc.City = city;
            loc.State = state;
            loc.Zip = zip;
            loc.Country = country;

            start.Year = 2012;
            start.Month = 6;
            start.DayNumber = 2;
            start.Day = "Saturday";
            start.Hour = 10;
            start.AltKey = new DateTime(2012, 6, 2, 10, 0, 0, DateTimeKind.Local);

            end.Year = 2012;
            end.Month = 6;
            end.DayNumber = 2;
            end.Day = "Saturday";
            end.Hour = 16;
            end.AltKey = new DateTime(2012, 6, 2, 16, 0, 0, DateTimeKind.Local);

            activity.ActivityKind = "Calendar";
            activity.Source = "Outlook";
            activity.SourceId = "0001";
            activity.StartDate = new DateTime(2012, 6, 2, 10, 0, 0, DateTimeKind.Local);
            activity.EndDate = new DateTime(2012, 6, 2, 16, 0, 0, DateTimeKind.Local);
            activity.ActivityName = "Jeff and Tami's Wedding";
            activity.Latitude = 47.7337578;
            activity.Longitude = -122.1469737;

            activity.ActivityId = _myloStore.AddActivity(_userId, activity, start, end,loc);

            person.Name = "Rebecca Short";
            person.PartyId = _myloStore.AddParty(_userId, person);
            person.PartyKind = "Person";
            long paId = _myloStore.AddPartyToActivityByIds(_userId, person, activity);

            // Setup the event called "Cabo San Lucas Vacation"
            gpsl.LatLongToAddressLookup(22.890980, -109.916676, out street, out city, out state, out zip, out country);
            loc.Street = street;
            loc.City = city;
            loc.State = state;
            loc.Zip = zip;
            loc.Country = country;

            start.Year = 2012;
            start.Month = 2;
            start.DayNumber = 20;
            start.Day = "Monday";
            start.Hour = 10;
            start.AltKey = new DateTime(2012, 2, 20, 10, 0, 0, DateTimeKind.Local);

            end.Year = 2012;
            end.Month = 2;
            end.DayNumber = 26;
            end.Day = "Sunday";
            end.Hour = 18;
            end.AltKey = new DateTime(2012, 2, 26, 18, 0, 0, DateTimeKind.Local);

            activity.ActivityKind = "Calendar";
            activity.Source = "Outlook";
            activity.SourceId = "0002";
            activity.StartDate = new DateTime(2012, 2, 20, 10, 0, 0, DateTimeKind.Local);
            activity.EndDate = new DateTime(2012, 2, 26, 18, 0, 0, DateTimeKind.Local);
            activity.ActivityName = "Cabo San Lucas Vacation";
            activity.Latitude = 22.890980;
            activity.Longitude = -109.916676;

            activity.ActivityId = _myloStore.AddActivity(_userId, activity, start, end, loc);

            person.Name = "Rebecca Short";
            person.PartyKind = "Person";
            person.PartyId = _myloStore.AddParty(_userId, person);
            long paId2 = _myloStore.AddPartyToActivityByIds(_userId, person, activity);

            // Setup the event called "Wine Club and Steven's 50th"
            gpsl.LatLongToAddressLookup(47.6885173, -122.1321265, out street, out city, out state, out zip, out country);
            loc.Street = street;
            loc.City = city;
            loc.State = state;
            loc.Zip = zip;
            loc.Country = country;

            start.Year = 2012;
            start.Month = 6;
            start.DayNumber = 8;
            start.Day = "Friday";
            start.Hour = 19;
            start.AltKey = new DateTime(2012, 6, 8, 19, 0, 0, DateTimeKind.Local);

            end.Year = 2012;
            end.Month = 6;
            end.DayNumber = 8;
            end.Day = "Friday";
            end.Hour = 23;
            end.AltKey = new DateTime(2012, 6, 8, 23, 0, 0, DateTimeKind.Local);

            activity.ActivityKind = "Calendar";
            activity.Source = "Outlook";
            activity.SourceId = "0003";
            activity.StartDate = new DateTime(2012, 6, 8, 19, 0, 0, DateTimeKind.Local);
            activity.EndDate = new DateTime(2012, 6, 8, 23, 0, 0, DateTimeKind.Local);
            activity.ActivityName = "Wine Club and Steven's 50th";
            activity.Latitude = 47.6885173;
            activity.Longitude = -122.1321265;

            activity.ActivityId = _myloStore.AddActivity(_userId, activity, start, end, loc);

            person.Name = "Rebecca Short";
            person.PartyKind = "Person";
            person.PartyId = _myloStore.AddParty(_userId, person);
            long paId3 = _myloStore.AddPartyToActivityByIds(_userId, person, activity);

            // Setup the event called "Maui Vacation"
            gpsl.LatLongToAddressLookup(20.7180257, -156.4472008, out street, out city, out state, out zip, out country);
            loc.Street = street;
            loc.City = city;
            loc.State = state;
            loc.Zip = zip;
            loc.Country = country;

            start.Year = 2011;
            start.Month = 12;
            start.DayNumber = 5;
            start.Day = "Monday";
            start.Hour = 11;
            start.AltKey = new DateTime(2011, 12, 5, 11, 0, 0, DateTimeKind.Local);

            end.Year = 2011;
            end.Month = 12;
            end.DayNumber = 10;
            end.Day = "Saturday";
            end.Hour = 22;
            end.AltKey = new DateTime(2011, 12, 10, 22, 0, 0, DateTimeKind.Local);

            activity.ActivityKind = "Calendar";
            activity.Source = "Outlook";
            activity.SourceId = "0004";
            activity.StartDate = new DateTime(2011, 12, 5, 11, 0, 0, DateTimeKind.Local);
            activity.EndDate = new DateTime(2011, 12, 10, 22, 0, 0, DateTimeKind.Local);
            activity.ActivityName = "Vacation in Maui";
            activity.Latitude = 20.7180257;
            activity.Longitude = -156.4472008;

            activity.ActivityId = _myloStore.AddActivity(_userId, activity, start, end, loc);

            person.Name = "Rebecca Short";
            person.PartyKind = "Person";
            person.PartyId = _myloStore.AddParty(_userId, person);
            long paId4 = _myloStore.AddPartyToActivityByIds(_userId, person, activity);

            // Setup the event called "Mount Haleakela"
            gpsl.LatLongToAddressLookup(20.709722, -156.253333, out street, out city, out state, out zip, out country);
            loc.Street = street;
            loc.City = city;
            loc.State = state;
            loc.Zip = zip;
            loc.Country = country;

            start.Year = 2011;
            start.Month = 12;
            start.DayNumber = 7;
            start.Day = "Wednesday";
            start.Hour = 5;
            start.AltKey = new DateTime(2011, 12, 7, 5, 0, 0, DateTimeKind.Local);

            end.Year = 2011;
            end.Month = 12;
            end.DayNumber = 7;
            end.Day = "Wednesday";
            end.Hour = 14;
            end.AltKey = new DateTime(2011, 12, 7, 14, 0, 0, DateTimeKind.Local);

            activity.ActivityKind = "Calendar";
            activity.Source = "Outlook";
            activity.SourceId = "0005";
            activity.StartDate = new DateTime(2011, 12, 7, 5, 0, 0, DateTimeKind.Local);
            activity.EndDate = new DateTime(2011, 12, 7, 14, 0, 0, DateTimeKind.Local);
            activity.ActivityName = "Mount Haleakala";
            activity.Latitude = 20.709722;
            activity.Longitude = -156.253333;

            activity.ActivityId = _myloStore.AddActivity(_userId, activity, start, end, loc);

            person.Name = "Rebecca Short";
            person.PartyKind = "Person";
            person.PartyId = _myloStore.AddParty(_userId, person);
            long paId5 = _myloStore.AddPartyToActivityByIds(_userId, person, activity);

            // Setup the event called "Florence Vacation"
            gpsl.LatLongToAddressLookup(43.777417, 11.251117, out street, out city, out state, out zip, out country);
            loc.Street = street;
            loc.City = city;
            loc.State = state;
            loc.Zip = zip;
            loc.Country = country;

            start.Year = 2012;
            start.Month = 04;
            start.DayNumber = 21;
            start.Day = "Saturday";
            start.Hour = 12;
            start.AltKey = new DateTime(2012, 4, 21, 12, 0, 0, DateTimeKind.Local);

            end.Year = 2012;
            end.Month = 4;
            end.DayNumber = 25;
            end.Day = "Wednesday";
            end.Hour = 14;
            end.AltKey = new DateTime(2012, 4, 25, 14, 0, 0, DateTimeKind.Local);

            activity.ActivityKind = "Calendar";
            activity.Source = "Outlook";
            activity.SourceId = "0006";
            activity.StartDate = new DateTime(2012, 4, 21, 12, 0, 0, DateTimeKind.Local);
            activity.EndDate = new DateTime(2012, 4, 25, 14, 0, 0, DateTimeKind.Local);
            activity.ActivityName = "Florence Vacation";
            activity.Latitude = 43.777417;
            activity.Longitude = 11.251117;

            activity.ActivityId = _myloStore.AddActivity(_userId, activity, start, end, loc);

            person.Name = "Rebecca Short";
            person.PartyKind = "Person";
            person.PartyId = _myloStore.AddParty(_userId, person);
            long paId6 = _myloStore.AddPartyToActivityByIds(_userId, person, activity);

            // Setup the event called "Italy Vacation"
            //gpsl.LatLongToAddressLookup(43.777417, 11.251117, out street, out city, out state, out zip, out country);
            loc.Country = "Italy";

            start.Year = 2012;
            start.Month = 04;
            start.DayNumber = 21;
            start.Day = "Saturday";
            start.Hour = 12;
            start.AltKey = new DateTime(2012, 4, 21, 12, 0, 0, DateTimeKind.Local);

            end.Year = 2012;
            end.Month = 4;
            end.DayNumber = 28;
            end.Day = "Saturday";
            end.Hour = 18;
            end.AltKey = new DateTime(2012, 4, 28, 18, 0, 0, DateTimeKind.Local);

            activity.ActivityKind = "Calendar";
            activity.Source = "Outlook";
            activity.SourceId = "0007";
            activity.StartDate = new DateTime(2012, 4, 21, 12, 0, 0, DateTimeKind.Local);
            activity.EndDate = new DateTime(2012, 4, 28, 18, 0, 0, DateTimeKind.Local);
            activity.ActivityName = "Italy Vacation";
            activity.Latitude = 0;
            activity.Longitude = 0;

            activity.ActivityId = _myloStore.AddActivity(_userId, activity, start, end, loc);

            person.Name = "Rebecca Short";
            person.PartyKind = "Person";
            person.PartyId = _myloStore.AddParty(_userId, person);
            long paId7 = _myloStore.AddPartyToActivityByIds(_userId, person, activity);

            // Setup the event called "Walla Walla Wine Tasting"
            //gpsl.LatLongToAddressLookup(43.777417, 11.251117, out street, out city, out state, out zip, out country);
            loc.Country = "United States";

            start.Year = 2012;
            start.Month = 08;
            start.DayNumber = 24;
            start.Day = "Friday";
            start.Hour = 10;
            start.AltKey = new DateTime(2012, 8, 24, 10, 0, 0, DateTimeKind.Local);

            end.Year = 2012;
            end.Month = 8;
            end.DayNumber = 26;
            end.Day = "Sunday";
            end.Hour = 18;
            end.AltKey = new DateTime(2012, 8, 26, 18, 0, 0, DateTimeKind.Local);

            activity.ActivityKind = "Calendar";
            activity.Source = "Outlook";
            activity.SourceId = "0008";
            activity.StartDate = new DateTime(2012, 8, 24, 10, 0, 0, DateTimeKind.Local);
            activity.EndDate = new DateTime(2012, 8, 26, 18, 0, 0, DateTimeKind.Local);
            activity.ActivityName = "Walla Wall Wine Tasting Weekend";
            activity.Latitude = 0;
            activity.Longitude = 0;

            activity.ActivityId = _myloStore.AddActivity(_userId, activity, start, end, loc);

            person.Name = "Rebecca Short";
            person.PartyKind = "Person";
            person.PartyId = _myloStore.AddParty(_userId, person);
            long paId8 = _myloStore.AddPartyToActivityByIds(_userId, person, activity);
        }