private void SaveDocument(object obj, BASEBean.eDataState dataState)
{
if (obj is Document)
{
Document document = obj as Document;
if (cmbDocumentType.SelectedItem != null)
{
var type = (DocumentType) cmbDocumentType.SelectedItem;
if (type != null)
{
document.ContentType = type.contentType;
if (type.typeId != null) document.DocumentType = (dbDocument.DocumentType) type.typeId;
}
}
((Document) obj).DataState = dataState;
PersistanceController.Save((Document)obj);
}
}