partial void UpdateAttorney(Attorney instance);
partial void DeleteAttorney(Attorney instance);
partial void InsertAttorney(Attorney instance);
private void detach_Attorneys(Attorney entity) { this.SendPropertyChanging(); entity.Client = null; }
private void attach_Attorneys(Attorney entity) { this.SendPropertyChanging(); entity.Client = this; }
public void SaveAttorney(Attorney attorney) { // if its a new client, insert it if (attorney.AttorneyID == 0) { _db.Attorneys.InsertOnSubmit(attorney); } else if (_db.Attorneys.GetOriginalEntityState(attorney) == null) { // we are updating an existing attorney, but it's not attached // to the data context, so attach it and detect changes _db.Attorneys.Attach(attorney); _db.Attorneys.Context.Refresh(RefreshMode.KeepCurrentValues, attorney); } _db.SubmitChanges(); }
public void DeleteAttorney(Attorney attorney) { _db.Attorneys.DeleteOnSubmit(attorney); _db.Attorneys.Context.SubmitChanges(); }