private long? savePlots(PlotDO curPlot, long? stratumCN, bool first)
        {
            PlotDO fsPlot;

             fsPlot = fsDAL.ReadSingleRow<PlotDO>("Plot", "Where CuttingUnit_CN = ? and Stratum_CN = ? and PlotNumber = ?", curPlot.CuttingUnit_CN, thisStrCN, curPlot.PlotNumber);

             if (fsPlot == null)
             {
            // check if plot already exists (stratumCN, plot number and unit code)
            fsPlot = new PlotDO(fsDAL);

            fsPlot.Stratum_CN = thisStrCN;
            fsPlot.CuttingUnit_CN = curPlot.CuttingUnit_CN;
            fsPlot.PlotNumber = curPlot.PlotNumber;
            fsPlot.IsEmpty = curPlot.IsEmpty;
            fsPlot.Slope = curPlot.Slope;
            fsPlot.Aspect = curPlot.Aspect;
            fsPlot.Remarks = curPlot.Remarks;
            fsPlot.XCoordinate = curPlot.XCoordinate;
            fsPlot.YCoordinate = curPlot.YCoordinate;
            fsPlot.ZCoordinate = curPlot.ZCoordinate;
            fsPlot.MetaData = curPlot.MetaData;
            fsPlot.Blob = curPlot.Blob;
            //fsPlot.CreatedBy = curPlot.CreatedBy;
            //fsPlot.CreatedDate = curPlot.CreatedDate;

            fsPlot.Save();
             }
            //         else
            //         {
            //            fsPlot = fsDAL.ReadSingleRow<PlotDO>("Plot", "Where CuttingUnit_CN = ? and Stratum_CN = ? and PlotNumber = ?", curPlot.CuttingUnit_CN, thisStrCN, curPlot.PlotNumber);
            //
            //         }
             return (fsPlot.Plot_CN);
        }
        private long? savePlots(PlotDO curPlot, long? stratumCN, bool first)
        {
            PlotDO fsPlot;
             if (first)
             {
            fsPlot = new PlotDO(fsDAL);

            fsPlot.Stratum_CN = stratumCN;
            fsPlot.CuttingUnit_CN = curPlot.CuttingUnit_CN;
            fsPlot.PlotNumber = curPlot.PlotNumber;
            fsPlot.IsEmpty = curPlot.IsEmpty;
            fsPlot.Slope = curPlot.Slope;
            fsPlot.Aspect = curPlot.Aspect;
            fsPlot.Remarks = curPlot.Remarks;
            fsPlot.XCoordinate = curPlot.XCoordinate;
            fsPlot.YCoordinate = curPlot.YCoordinate;
            fsPlot.ZCoordinate = curPlot.ZCoordinate;
            fsPlot.MetaData = curPlot.MetaData;
            fsPlot.Blob = curPlot.Blob;
            fsPlot.CreatedBy = curPlot.CreatedBy;
            fsPlot.CreatedDate = curPlot.CreatedDate;

            fsPlot.Save();
             }
             else
             {
            fsPlot = fsDAL.ReadSingleRow<PlotDO>("Plot", "Where CuttingUnit_CN = ? and Stratum_CN = ? and PlotNumber = ?", curPlot.CuttingUnit_CN, stratumCN, curPlot.PlotNumber);

             }
             return (fsPlot.Plot_CN);
        }