public int CheckErrors()
        {
            string          outputFileName;
            CPbusinessLayer bslyr = new CPbusinessLayer();

            bslyr.DAL      = DAL;
            bslyr.fileName = fileName;
            //  check for errors from FScruiser before running edit checks
            //  generate an error report
            //  June 2013
            List <ErrorLogDO> fscList = bslyr.getErrorMessages("E", "FScruiser");

            if (fscList.Count > 0)
            {
                ErrorReport eRpt = new ErrorReport();
                eRpt.fileName       = fileName;
                eRpt.bslyr.fileName = bslyr.fileName;
                eRpt.bslyr.DAL      = DAL;
                outputFileName      = eRpt.PrintFScruiserErrors(fscList);
                string outputMessage = "ERRORS FROM FSCRUISER FOUND!\nCorrect data and rerun\nOutput file is:" + outputFileName;
                MessageBox.Show(outputMessage, "ERRORS", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                //  request made to open error report in preview -- May 2015


                PrintPreview pp = new PrintPreview();
                pp.fileName = outputFileName;
                pp.setupDialog();
                pp.ShowDialog();
                Environment.Exit(0);
            }   //  endif report needed

            //  clear out error log table for just CruiseProcessing before performing checks
            bslyr.DeleteErrorMessages();


            int errors = TableEditChecks();

            if (errors == -1)
            {
                //  no measured trees detected in the cruise.  critical errpor stops the program.
                return(-1);
            }   //  endif
            errors = MethodChecks();
            if (errors == -1)
            {
                //  empty stratum detected and user wants to quit
                return(-1);
            }   //  endif
            //  just check the ErrorLog table for entries
            List <ErrorLogDO> errList = bslyr.getErrorMessages("E", "CruiseProcessing");

            if (errList.Count > 0)
            {
                ErrorReport er = new ErrorReport();
                er.fileName       = fileName;
                er.bslyr.fileName = fileName;
                er.bslyr.DAL      = bslyr.DAL;
                outputFileName    = er.PrintErrorReport(errList);
                string outputMessage = "ERRORS FOUND!\nCorrect data and rerun\nOutput file is:" + outputFileName;
                MessageBox.Show(outputMessage, "ERRORS", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                //  request made to open error report in preview -- May 2015
                PrintPreview pp = new PrintPreview();
                pp.fileName = outputFileName;
                pp.setupDialog();
                pp.ShowDialog();
                Environment.Exit(0);
            }   //  endif report needed
            return(0);
        }