public int countDocuments(string pNewsPaper, string pDocType, string pSection, string pSearchTag, DateTime pFrom, DateTime pTo) { Document _document = new Document(); if (pDocType == "raw") { pDocType = ".doc .docx .txt .rtf"; } else if (pDocType == "ALL") { pDocType = ""; } int _tagCount = 0; string _strTags = ""; if (pSearchTag != "") { string[] _artags = GlobalFunctions.addSlashes(pSearchTag).Split(' '); IList<string> _tags = GlobalFunctions.removeRedundancy(_artags); _tagCount = _tags.Count; foreach (string _str in _tags) { _strTags = _strTags + "'" + _str + "',"; } _strTags = _strTags.Substring(0, _strTags.Length - 1); } return _document.count(_strTags, pNewsPaper, prepareDoctype(pDocType), pSection, _tagCount, pFrom, pTo); }
public FileManager() { loDocument = new Document(); loDocAuthor = new DocAuthor(); loDocEditor = new DocEditor(); loDocTag = new DocTag(); loImage = new ImageBO(); loImageTag = new ImageTag(); }
public bool deleteDocument(string pDocumentId) { Document _oDocument = new Document(pDocumentId); string _path = _oDocument.DocumentId + _oDocument.Doctype; bool _del = _oDocument.delete(); if (_del) { try { File.Move(GlobalVariables.goFileServer + @"\" + _path, GlobalVariables.goRecycleBin + @"\" + _path); } catch { } } return _del; }
public bool saveDocument(Document pDocument) { MySqlTransaction _trans = GlobalVariables.goMySqlConnection.BeginTransaction(); try { pDocument.update(ref _trans); _trans.Commit(); } catch (Exception ex) { _trans.Rollback(); throw ex; } finally { _trans.Dispose(); } return true; }
public Document getDocument(string pDocumentId) { Document _doc = new Document(pDocumentId); return _doc; }