Example #1
0
 partial void UpdateAttorney(Attorney instance);
Example #2
0
 partial void DeleteAttorney(Attorney instance);
Example #3
0
 partial void InsertAttorney(Attorney instance);
Example #4
0
		private void detach_Attorneys(Attorney entity)
		{
			this.SendPropertyChanging();
			entity.Client = null;
		}
Example #5
0
		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();
 }