Example #1
0
        private int readGroup(string[] lines, List <ERES> list)
        {
            int group_start = find_line(lines, "\"GROUP\",\"ERES\"");

            if (group_start == NOT_FOUND)
            {
                return(-1);
            }

            string[] header = lines[group_start + 1].QuoteSplit();
            string[] units  = lines[group_start + 2].QuoteSplit();
            string[] type   = lines[group_start + 3].QuoteSplit();

            addUNITS(units);
            addTYPES(type);

            for (int i = group_start + 4; i < lines.Count(); i++)
            {
                string line = lines[i];
                if (line.Length == 0)
                {
                    return(i);
                }
                string[] values = line.QuoteSplit();
                ERES     e      = new ERES {
                    ge_source  = "ge_ags",
                    ge_otherId = data.Id.ToString()
                };
                setValues(header, values, e);
                list.Add(e);
            }
            return(0);
        }
Example #2
0
 public int CopyTo(ERES item)
 {
     try {
         item.PointID = Field_ID;
         if (Sample_Depth_Avg != null)
         {
             item.Depth = Sample_Depth_Avg.Value;
         }
         if (Sample_Depth_Avg != null)
         {
             item.Depth = Sample_Depth_Avg.Value;
         }
         if (SampleCode != null)
         {
             item.SAMP_ID = SampleCode;
         }
         if (Sampled_Date_Time != null)
         {
             item.ERES_DTIM = Sampled_Date_Time;
         }
         if (Sampled_Date_Time != null)
         {
             item.ERES_LDTM = Sampled_Date_Time;
         }
         return(1);
     }
     catch (Exception e) {
         return(-1);
     }
 }
Example #3
0
        private SPEC newSPEC(ERES p)
        {
            SPEC spec = new SPEC {
                gINTProjectID = p.gINTProjectID,
                PointID       = p.PointID,
                SAMP_Depth    = p.SAMP_Depth,
                SAMP_ID       = p.SAMP_ID,
                SAMP_TYPE     = p.SAMP_TYPE,
                SAMP_REF      = p.SAMP_REF,
                SPEC_DESC     = p.SPEC_DESC,
                SPEC_REF      = p.SPEC_REF
            };

            return(spec);
        }
        private List <ABBR> getABBR(List <ERES> list)
        {
            //Abbreviations ERES_CODE
            string[] eres_codes = list.Select(m => m.ItemKey).Distinct().ToArray();

            List <ERES> eres_codesList = new List <ERES>();

            foreach (string s in eres_codes)
            {
                ERES first = list.Where(el => el.ItemKey == s).First();
                eres_codesList.Add(first);
            }

            List <ABBR> abbr = new List <ABBR>();

            foreach (ERES eres in eres_codesList)
            {
                ABBR ab = new ABBR();
                ab.ABBR_HDNG = "ERES_CODE";
                ab.ABBR_CODE = eres.ItemKey;
                ab.ABBR_DESC = eres.ERES_NAME;
                abbr.Add(ab);
            }

            // Abbreviations ERES_MATX
            string[] eres_matx = list.Select(m => m.ERES_MATX).Distinct().ToArray();
            foreach (string s in eres_matx)
            {
                ABBR ab = new ABBR();
                ab.ABBR_HDNG = "ERES_MATX";
                ab.ABBR_CODE = s;
                ab.ABBR_DESC = "";
                abbr.Add(ab);
            }

            return(abbr);
        }
Example #5
0
        private int setValues(string[] header, string[] values, ERES p)
        {
            try {
                for (int i = 0; i < header.Count(); i++)
                {
                    if (header[i] == "LOCA_ID" && values[i] != "")
                    {
                        p.PointID = values[i];
                    }
                    if (header[i] == "SAMP_TOP" && values[i] != "")
                    {
                        p.SAMP_Depth = Convert.ToDouble(values[i]);
                    }
                    if (header[i] == "SAMP_REF" && values[i] != "")
                    {
                        p.SAMP_REF = values[i];
                    }
                    if (header[i] == "SAMP_TYPE" && values[i] != "")
                    {
                        p.SAMP_TYPE = values[i];
                    }
                    if (header[i] == "SAMP_ID" && values[i] != "")
                    {
                        p.SAMP_ID = values[i];
                    }
                    if (header[i] == "SPEC_DPTH" && values[i] != "")
                    {
                        p.Depth = Convert.ToDouble(values[i]);
                    }
                    if (header[i] == "SPEC_REF" && values[i] != "")
                    {
                        p.SPEC_REF = values[i];
                    }
                    if (header[i] == "ERES_CODE" && values[i] != "")
                    {
                        p.ItemKey = values[i];
                    }
                    if (header[i] == "ERES_METH" && values[i] != "")
                    {
                        p.ERES_METH = values[i];
                    }
                    if (header[i] == "Matrix-Run Type" && values[i] != "")
                    {
                        p.Matrix_Run_Type = values[i];
                    }
                    if (header[i] == "ERES_MATX" && values[i] != "")
                    {
                        p.ERES_MATX = values[i];
                    }
                    if (header[i] == "ERES_RTYP" && values[i] != "")
                    {
                        p.ERES_RTYP = values[i];
                    }
                    if (header[i] == "ERES_TESN" && values[i] != "")
                    {
                        p.ERES_TESN = values[i];
                    }
                    if (header[i] == "ERES_NAME" && values[i] != "")
                    {
                        p.ERES_NAME = values[i];
                    }
                    if (header[i] == "ERES_TNAM" && values[i] != "")
                    {
                        p.ERES_TNAM = values[i];
                    }
                    if (header[i] == "ERES_RVAL" && values[i] != "")
                    {
                        p.ERES_RVAL = Convert.ToDouble(values[i]);
                    }
                    if (header[i] == "ERES_RUNI" && values[i] != "")
                    {
                        p.ERES_RUNI = values[i];
                    }
                    if (header[i] == "ERES_RTXT" && values[i] != "")
                    {
                        p.ERES_RTXT = values[i];
                    }
                    if (header[i] == "ERES_RTCD" && values[i] != "")
                    {
                        p.ERES_RTCD = values[i];
                    }
                    if (header[i] == "ERES_RRES" && values[i] != "")
                    {
                        p.ERES_RRES = Convert.ToBoolean(values[i]);
                    }
                    if (header[i] == "ERES_DETF" && values[i] != "")
                    {
                        p.ERES_DETF = Convert.ToBoolean(values[i]);
                    }
                    if (header[i] == "ERES_ORG" && values[i] != "")
                    {
                        p.ERES_ORG = Convert.ToBoolean(values[i]);
                    }
                    if (header[i] == "ERES_IQLF" && values[i] != "")
                    {
                        p.ERES_IQLF = values[i];
                    }
                    if (header[i] == "ERES_LQLF" && values[i] != "")
                    {
                        p.ERES_LQLF = values[i];
                    }
                    if (header[i] == "ERES_RDLM" && values[i] != "")
                    {
                        p.ERES_RDLM = Convert.ToDouble(values[i]);
                    }
                    if (header[i] == "ERES_MDLM" && values[i] != "")
                    {
                        p.ERES_MDLM = Convert.ToDouble(values[i]);
                    }
                    if (header[i] == "ERES_QLM" && values[i] != "")
                    {
                        p.ERES_QLM = Convert.ToDouble(values[i]);
                    }
                    if (header[i] == "ERES_DUNI" && values[i] != "")
                    {
                        p.ERES_DUNI = values[i];
                    }
                    if (header[i] == "ERES_TPICP" && values[i] != "")
                    {
                        p.ERES_TPICP = Convert.ToInt16(values[i]);
                    }
                    if (header[i] == "ERES_TICT" && values[i] != "")
                    {
                        p.ERES_TICT = Convert.ToInt16(values[i]);
                    }
                    if (header[i] == "ERES_RDAT" && values[i] != "")
                    {
                        p.ERES_RDAT = Convert.ToDateTime(values[i]);
                    }
                    if (header[i] == "ERES_SGRP" && values[i] != "")
                    {
                        p.ERES_SGRP = values[i];
                    }
                    if (header[i] == "SPEC_DESC" && values[i] != "")
                    {
                        p.SPEC_DESC = values[i];
                    }
                    if (header[i] == "SPEC_PREP" && values[i] != "")
                    {
                        p.SPEC_PREP = values[i];
                    }
                    if (header[i] == "ERES_DTIM" && values[i] != "")
                    {
                        p.ERES_DTIM = Convert.ToDateTime(values[i]);
                    }
                    if (header[i] == "ERES_TEST" && values[i] != "")
                    {
                        p.ERES_TEST = values[i];
                    }
                    if (header[i] == "ERES_TORD" && values[i] != "")
                    {
                        p.ERES_TORD = values[i];
                    }
                    if (header[i] == "ERES_LOCN" && values[i] != "")
                    {
                        p.ERES_LOCN = values[i];
                    }
                    if (header[i] == "ERES_BAS" && values[i] != "")
                    {
                        p.ERES_BAS = values[i];
                    }
                    if (header[i] == "ERES_DIL" && values[i] != "")
                    {
                        p.ERES_DIL = Convert.ToInt16(values[i]);
                    }
                    if (header[i] == "ERES_LMTH" && values[i] != "")
                    {
                        p.ERES_LMTH = values[i];
                    }
                    if (header[i] == "ERES_LDTM" && values[i] != "")
                    {
                        p.ERES_LDTM = Convert.ToDateTime(values[i]);
                    }
                    if (header[i] == "ERES_IREF" && values[i] != "")
                    {
                        p.ERES_IREF = values[i];
                    }
                    if (header[i] == "ERES_SIZE" && values[i] != "")
                    {
                        p.ERES_SIZE = values[i];
                    }
                    if (header[i] == "ERES_PERP" && values[i] != "")
                    {
                        p.ERES_PERP = Convert.ToDouble(values[i]);
                    }
                    if (header[i] == "ERES_REM" && values[i] != "")
                    {
                        p.ERES_REM = values[i];
                    }
                    if (header[i] == "ERES_LAB" && values[i] != "")
                    {
                        p.ERES_LAB = values[i];
                    }
                    if (header[i] == "ERES_CRED" && values[i] != "")
                    {
                        p.ERES_CRED = values[i];
                    }
                    if (header[i] == "TEST_STAT" && values[i] != "")
                    {
                        p.TEST_STAT = values[i];
                    }
                    if (header[i] == "FILE_FSET")
                    {
                        p.FILE_FSET = values[i];
                    }
                }
            } catch {
                return(-1);
            }

            return(0);
        }