private string GetHash(BusinessDocument doc) { return doc.HashString().ToLower(); }
public void Undelete(BusinessDocument doc) { if (doc.GetType() != m_SupportedType) { throw new DocumentNotSupportedException(); } DocumentIndexValue value1 = (DocumentIndexValue) m_IndexList[GetHash(doc)]; if (value1 == null) { throw new DocumentNotInContainerException(); } if (value1.State != DocumentState.Deleted) { throw new DocumentInvalidStateException(); } value1.State = value1.PrevState; doc.SetDocumentState(value1.State); }
public int Insert(BusinessDocument doc) { return Add(doc, DocumentState.Inserted); }
public DocumentState GetState(BusinessDocument doc) { DocumentIndexValue value1 = (DocumentIndexValue) m_IndexList[GetHash(doc)]; if (value1 == null) { return DocumentState.Unknown; } return value1.State; }
public int Add(BusinessDocument doc, DocumentState iniState) { if (doc.GetType() != m_SupportedType) { throw new DocumentNotSupportedException(); } DocumentIndexValue value1 = (DocumentIndexValue) m_IndexList[GetHash(doc)]; if (value1 != null) { if (value1.State == DocumentState.Deleted) { throw new DocumentInvalidStateException(); } throw new ContainerPKViolationException(); } int num1 = m_AllContainer.Add(doc); m_IndexList.Add(GetHash(doc), new DocumentIndexValue(num1, iniState, DocumentState.Unknown)); doc.SetDocumentState(iniState); return num1; }
public int Add(BusinessDocument doc) { return Add(doc, DocumentState.Unchanged); }