partial void DeletetblDocument(tblDocument instance);
 partial void UpdatetblDocument(tblDocument instance);
 partial void InserttblDocument(tblDocument instance);
		private void detach_tblDocuments(tblDocument entity)
		{
			this.SendPropertyChanging();
			entity.tlbDocumentType = null;
		}
		private void attach_tblDocuments(tblDocument entity)
		{
			this.SendPropertyChanging();
			entity.tblVisit = this;
		}
 public void SaveDocument(Document document)
 {
     var d = new tblDocument();
     using (_db)
     {
         d = _db.tblDocuments.SingleOrDefault(x => x.Id == document.DocumentId);
         d.ChartId = document.ChartId;
         d.Description = document.Description;
         d.DocumentDate = document.DocumentDate;
         d.LastUpdated = DateTime.Now;
         d.Name = document.Name;
         d.VisitId = document.Visit.VisitId;
         d.TypeId = document.DocumentType.TypeId;
         d.ServerPath = document.ServerPath;
         _db.SubmitChanges();
     }
 }