示例#1
0
        public void RateOrganizerAndHangout(RateOrganizerHangoutViewModel model)
        {
            OrganizerRating orgRating = new OrganizerRating
            {
                OrganizerId = model.UserId,
                AttendeeId = model.AttendeeId,
                Rating = model.OrganizerRating,
                HangoutId = model.Id
            };

            //HangoutRating hangoutRating = new HangoutRating
            //{
            //    AttendeeId = model.AttendeeId,
            //    HangoutId = model.Id,
            //    Rating = model.HangoutRating
            //};

            OrganizerRatings_db.OrganizerRatings.InsertOnSubmit(orgRating);
            //HangoutRatings_db.HangoutRatings.InsertOnSubmit(hangoutRating);

            try
            {
                OrganizerRatings_db.SubmitChanges();
                //HangoutRatings_db.SubmitChanges();

            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                // Make some adjustments.
                // ...
                // Try again.
                OrganizerRatings_db.SubmitChanges();
                //HangoutRatings_db.SubmitChanges();

            }
        }
 partial void UpdateOrganizerRating(OrganizerRating instance);
 partial void DeleteOrganizerRating(OrganizerRating instance);
 partial void InsertOrganizerRating(OrganizerRating instance);