Beispiel #1
0
        protected result_files AddResultFile(string filePath, result_sources source)
        {
            string hash = GetFileHash(filePath);

            var file = new result_files()
            {
                md5 = hash,
                name = filePath,
                received_on = DateTime.Now,
                result_source_id = source.id
            };
            return fileRepo.AddResultFile(file);
        }
Beispiel #2
0
        public result_sources AddSource(string name, string description)
        {
            var source = (from src in entities.result_sources
                          where src.name == name
                          select src).FirstOrDefault();
            if (source == null)
            {
                source = new result_sources()
                {
                    name = name,
                    description = description,
                };
                entities.result_sources.Add(source);
                entities.SaveChanges();
            }

            return source;
        }