public Document OpenSharedDocument(int id, User user)
        {
            string path = dbCon.GetDocumentById(id);

            if (!path.Equals("") && !path.Equals(" ") && path != null)
            {
                if (!File.Exists(path))
                {
                    File.Create(path);
                }
                // Read the file, line by line, into an array.
                try
                {
                    string[] lines = File.ReadAllLines(path);

                    // Save the content of the file.
                    string content = "";
                    for (int i = 0; i < lines.Length; i++)
                    {
                        content += lines[i] + "\n";
                    }

                    // Create a new document object.
                    Document doc = new Document(user, id, content, path);

                    // Add document to the users list of documents
                    AddDocToList(user, doc);

                    // Return the document.
                    return(doc);
                }
                catch (IOException e)
                {
                    Console.WriteLine(e.StackTrace);
                }
            }
            //Document tmp = dbCon.GetDocumentById(id);

            return(null);
        }