private CollarParameterFile UploadParameterFile(ProjectInvestigator owner, LookupCollarParameterFileFormat format, string filename)
        {
            LoadAndHashFile(filename);
            if (_fileContents == null)
            {
                return(null);
            }
            if (AbortBecauseDuplicate())
            {
                return(null);
            }

            var file = new CollarParameterFile
            {
                FileName = System.IO.Path.GetFileName(filename),
                LookupCollarParameterFileFormat = format,
                ProjectInvestigator             = owner,
                LookupFileStatus = (LookupFileStatus)StatusComboBox.SelectedItem,
                Contents         = _fileContents
            };

            Database.CollarParameterFiles.InsertOnSubmit(file);
            if (SubmitChanges())
            {
                return(file);
            }
            return(null);
        }
        private CollarParameterFile UploadParameterFile(ProjectInvestigator owner, LookupCollarParameterFileFormat format, string filename)
        {
            LoadAndHashFile(filename);
            if (_fileContents == null)
                return null;
            if (AbortBecauseDuplicate())
                return null;

            var file = new CollarParameterFile
            {
                FileName = System.IO.Path.GetFileName(filename),
                LookupCollarParameterFileFormat = format,
                ProjectInvestigator = owner,
                LookupFileStatus = (LookupFileStatus)StatusComboBox.SelectedItem,
                Contents = _fileContents
            };
            Database.CollarParameterFiles.InsertOnSubmit(file);
            if (SubmitChanges())
                return file;
            return null;
        }