示例#1
0
        //------------------------------------CHANGING ENTRIES-------------------------------------------------
        //==============DOCUMENT HISTORY==============
        public static void CreateDocumentHistrory(int id, string filePath)
        {
            string userName = System.Environment.UserName;

            byte[]          file     = File.ReadAllBytes(filePath);
            string          fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);
            DocumentHistory entry;

            entry = new DocumentHistory(id, file, DateTime.Now, userName, fileName);

            databaseContext.DocumentHistories.Add(entry);
            databaseContext.SaveChanges();
            databaseContext = new PointDocumentationEntities();
        }