private void detach_AttendeesCodeCampYear(AttendeesCodeCampYear entity)
		{
			this.SendPropertyChanging();
			entity.CodeCampYear = null;
		}
 partial void DeleteAttendeesCodeCampYear(AttendeesCodeCampYear instance);
 partial void UpdateAttendeesCodeCampYear(AttendeesCodeCampYear instance);
 partial void InsertAttendeesCodeCampYear(AttendeesCodeCampYear instance);
		private void attach_AttendeesCodeCampYear(AttendeesCodeCampYear entity)
		{
			this.SendPropertyChanging();
			entity.Attendees = this;
		}
        //  public override void Insert(LoadResult result)
        //  {
        //     base.Insert(result);
        //     if (result.Cargos != null && result.Cargos.Count > 0)
        //     {
        //        foreach (CargoResult c in result.Cargos)
        //        {
        //            c.LoadId = result.Id;
        //            CargoManager.I.Insert(c);
        //         }
        //      }
        //  }
        //
        //  public override void Update(LoadResult result)
        //  {
        //      base.Update(result);
        //      if (result.Cargos != null && result.Cargos.Count > 0)
        //      {
        //          CargoManager.I.Update(result.Cargos);
        //      }
        //  }
        public void Upsert(AttendeesCodeCampYearResult result)
        {
            var meta = new CodeCampDataContext();

            var attendeesCodeCampYear = (from data in meta.AttendeesCodeCampYear
                                         where data.CodeCampYearId == result.CodeCampYearId && data.AttendeesId == result.AttendeesId
                                         select data).SingleOrDefault();

            if (attendeesCodeCampYear != null)
            {
                attendeesCodeCampYear.AttendSaturday = result.AttendSaturday;
                attendeesCodeCampYear.AttendSunday = result.AttendSunday;
            }
            else
            {
                attendeesCodeCampYear = new AttendeesCodeCampYear()
                {
                    AttendeesId = result.AttendeesId,
                    CodeCampYearId = result.CodeCampYearId,
                    AttendSaturday = result.AttendSaturday,
                    AttendSunday = result.AttendSunday
                };
                meta.AttendeesCodeCampYear.InsertOnSubmit(attendeesCodeCampYear);
            }
            meta.SubmitChanges();
        }