コード例 #1
0
        public void InsertRating(int locationID, int rating, string review)
        {
            using (var entities = new sunday_driveEntities())
            {
                Rating newRating = new Rating();
                newRating.LocationID = locationID;
                newRating.Rating1 = rating;
                newRating.Text = review;

                entities.Ratings.AddObject(newRating);

                entities.SaveChanges();
            }
        }
コード例 #2
0
        public void InsertLocation(int businessID, string street1, string street2, string municipality, string county, string state, string postalcode, string country, string phone)
        {
            using (var entities = new sunday_driveEntities())
            {
                Location newLocation = new Location()
                {
                    BusinessID = businessID,
                    StreetLine1 = street1,
                    StreetLine2 = street2,
                    Municipality = municipality,
                    County = county,
                    State = state,
                    PostalCode = postalcode,
                    Country = country,
                    Phone = phone
                };

                SetGPSCoords(ref newLocation);

                entities.Locations.AddObject(newLocation);

                entities.SaveChanges();
            }
        }