/// <summary> /// Adds a new Donor to the Donors collection /// </summary> /// <param name="Donor">Instance of Donor object to add to collection.</param> /// <returns>Donor_ID of the newly added Donor</returns> public int AddDonor(Donor Donor) { if (Donor == null) { throw new ArgumentNullException("Donor"); } dc.Donors.InsertOnSubmit(Donor); dc.SubmitChanges(); return Donor.Donor_ID; }
partial void DeleteDonor(Donor instance);
partial void UpdateDonor(Donor instance);
partial void InsertDonor(Donor instance);
private void detach_Donors(Donor entity) { this.SendPropertyChanging(); entity.DonorType = null; }
private void attach_Donors(Donor entity) { this.SendPropertyChanging(); entity.DonorType = this; }
private void attach_Donors(Donor entity) { this.SendPropertyChanging(); entity.Procurer = this; }
private void detach_Contacts(Donor entity) { this.SendPropertyChanging(); entity.GeoLocation = null; }
private void SetupEditViewData(Donor donor) { ViewData["GeoLocation_ID"] = GetGeoLocationsSelectList(donor.GeoLocation_ID); ViewData["Procurer_ID"] = GetProcurerSelectList(donor.Procurer_ID); ViewData["Donates"] = GetDonatesSelectList(donor.Donates); }
static bool DonorIsNotClosed(Donor x) { return x.Closed == null || x.Closed == false; }
/// <summary> /// Saves changes to the Donor object passed /// </summary> /// <param name="donor"></param> /// <returns>True if save was successful, false if it was not.</returns> public bool SaveDonor(Donor donor) { if (donor == null) throw new ArgumentNullException("donor"); var lOld = GetDonor(donor.Donor_ID); lOld = donor; dc.SubmitChanges(); // TODO: Compare object properties here return true; }
/// <summary> /// Deletes the donor /// </summary> /// <param name="donor">Donor to delete</param> /// <returns>True if deletion was successful</returns> public bool DeleteDonor(Donor donor) { if (donor == null) return false; dc.Donors.DeleteOnSubmit(donor); dc.SubmitChanges(); return true; }