Example #1
0
        private void getDocument()
        {
            _doc = _da.GetDocsById(new List <string> {
                _docId
            }).FirstOrDefault();
            if (_doc == null)
            {
                MessageBox.Show("Document could not be found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }

            docContent_rtb.Text = GetFileContent();
        }
Example #2
0
        /** the main searching function -- call from UI **/
        public List <Document> Search(string query)
        {
            Stack <List <string> > result = new Stack <List <string> >();

            result = ParseQuery(query);
            List <string> docs = new List <string>();

            if (result.Count() > 0)
            {
                foreach (string doc in result.Pop())
                {
                    if (!docs.Contains(doc))
                    {
                        docs.Add(doc);
                    }
                }
            }
            var retDocs = da.GetDocsById(docs);

            GetDescriptionForDocs(ref retDocs);
            return(retDocs);
        }