예제 #1
0
파일: Program.cs 프로젝트: OSRS/Oncor_Base
        static void Main(string[] args)
        {
            string     fil = "B:\\Data\\test.zip";
            FileStream s   = File.Open(fil, FileMode.OpenOrCreate, FileAccess.ReadWrite);

            CsvDb tmp = CsvDb.Create(s);

            CreateTable(tmp, "mytab1");
            CreateTable(tmp, "my tabs\\my tab2.off");
            tmp.Flush();
            tmp.Dispose();
        }
예제 #2
0
        private Guid CreateCsvFile(Dictionary <CompoundIdentity, Tuple <int, Site> > siteDict, Dictionary <CompoundIdentity, Tuple <int, SamplingEvent> > eventDict,
                                   Dictionary <CompoundIdentity, Tuple <int, WaterQualityDeployment> > deploymentDict, List <Tuple <int, WaterQualityMeasurement> > measurementList,
                                   Dictionary <CompoundIdentity, Organization> orgDict, Dictionary <CompoundIdentity, FieldTrip> fieldTripDict,
                                   Dictionary <CompoundIdentity, FieldActivity> fieldActivityDict, Dictionary <CompoundIdentity, Project> projectDict)
        {
            IFileStoreProvider provider = FileStoreManager.Instance.GetProvider();

            //Setting up temp file
            FilestoreFile deployFile = provider.MakeTemp(DateTime.UtcNow.AddHours(4));
            CsvDb         csv        = CsvDb.Create(deployFile);

            CreateSampleEventCsv(csv, eventDict, orgDict, fieldTripDict, fieldActivityDict, projectDict);
            CreateMeasurementsCsv(csv, siteDict, eventDict, deploymentDict, measurementList);
            CreateSitesCsv(csv, siteDict);

            csv.Flush();
            csv.Dispose();
            deployFile.Close();
            return(deployFile.FileId);
        }