public bool AddReg(AReg reg) { using (DataClassesTourGuideDataContext dc = new DataClassesTourGuideDataContext()) { Registration registration = new Registration(); registration.IsSentEmail = 0; registration.IsPaid = 0; registration.Attended = 0; registration.RegFirstName = reg.RegFirstName; registration.RegLastName = reg.RegLastName; registration.RegBirthday = reg.RegBirthday; registration.TourDate = reg.TourDate; registration.TourID = System.Guid.Parse(reg.TourID); registration.UserID = System.Guid.Parse(reg.UserID); registration.RegTime = DateTime.Now; registration.WillAttend = (byte)(reg.WillAttend?1:0); registration.RegID = System.Guid.NewGuid(); dc.Registrations.InsertOnSubmit(registration); dc.SubmitChanges(); return true; } }
partial void DeleteRegistration(Registration instance);
partial void UpdateRegistration(Registration instance);
partial void InsertRegistration(Registration instance);
private void detach_Registrations(Registration entity) { this.SendPropertyChanging(); entity.Event = null; }
private void attach_Registrations(Registration entity) { this.SendPropertyChanging(); entity.User = this; }