Esempio n. 1
0
        private static void CreateListOfPhonyPrey(PreyAvailabilityDET det, int numRows)
        {
            int count = 1;

            for (int index = 0; index < numRows; index++)
            {
                var dto = CreatePhonyPrey(count++);
                det.Prey.Add(dto);
            }
        }
Esempio n. 2
0
        private static void CreateListOfPhonySites(PreyAvailabilityDET det, int numRows)
        {
            int count = 1;

            for (int index = 0; index < numRows; index++)
            {
                var dto = PhonyLookup.CreatePhonySite(count++);
                det.Sites.Add(dto);
            }
        }
Esempio n. 3
0
        public static void WriteFile(string fName)
        {
            PreyAvailabilityDET det = new PreyAvailabilityDET();

            det.Id    = Guid.NewGuid();
            det.Owner = "Dr. Frank N. Furter, ESQ";
            ExcelPreyAvailabilityDET excel = new ExcelPreyAvailabilityDET(det);

            CreateListOfPhonySurveys(det, 6);
            CreateListOfPhonyPrey(det, 6);
            CreateListOfPhonySpecies(det, 6);
            CreateListOfPhonySites(det, 4);
            //CreateListOfPhonyLifeStages(det, 6);
            excel.Save(fName);
        }
Esempio n. 4
0
        public static void ReadFile(string fName)
        {
            Console.WriteLine("reading workbook named [{0}]", fName);
            PreyAvailabilityDET      det   = new PreyAvailabilityDET();
            ExcelPreyAvailabilityDET excel = new ExcelPreyAvailabilityDET(det);

            excel.Load(fName);
            ValidationIssues issues = det.ValidationIssues;

            if (issues.Count > 0)
            {
                foreach (ValidationIssue issue in issues)
                {
                    Console.WriteLine(issue.IssueMessage);
                }
                return;
            }
            Console.WriteLine("Custom property Name: {0}, Value: {1}", "oncorID", det.Id);
            Console.WriteLine("Custom property Name: {0}, Value: {1}", "oncorOwner", det.Owner);
            int count = 1;

            foreach (var dto in det.PreySurveys.Values)
            {
                Console.WriteLine("PreySurvey Row: {0}, Value: {1}", count++, dto);
            }
            count = 1;
            foreach (var dto in det.Prey.Values)
            {
                Console.WriteLine("Prey Row: {0}, Value: {1}", count++, dto);
            }
            count = 1;
            foreach (var dto in det.Sites.Values)
            {
                Console.WriteLine("Site Row: {0}, Value: {1}", count++, dto);
            }
            count = 1;
            foreach (var dto in det.Species.Values)
            {
                Console.WriteLine("Species Row: {0}, Value: {1}", count++, dto);
            }
            Console.WriteLine("Closing workbook named [{0}]", fName);
        }
Esempio n. 5
0
 public ExcelPreyAvailabilityDET(PreyAvailabilityDET det)
 {
     generalDet = det;
     myDet      = new ExcelBaseDet(det.Id, det.Owner);
 }