Beispiel #1
0
        public bool insertHydrologicalData(int idDocument, int rowNumber, string reader)
        {
            try
            {
                string[] aux = null;
                aux = reader.Split(';').Where(x => !String.IsNullOrEmpty(x)).ToArray();
                hydrologicalData data = new hydrologicalData();

                var aux1 = aux[0].Split(' ');  //SEPARO LA FECHA DE LA HORA
                var aux2 = aux1[0].Split('/'); //SEPARO MES/DIA/AÑO EN LA FECHA PARA LUEGO CONVERTIR A DIA/MES/AÑO
                var auxF = aux2[1] + "/" + aux2[0] + "/" + aux2[2] + " " + aux1[1];

                data.dateData = Convert.ToDateTime(auxF);

                //DateTime dt = DateTime.ParseExact(aux[0].ToString(), "MM/dd/yyyy h:mm", CultureInfo.InvariantCulture);
                //data.dateData = Convert.ToDateTime(s);

                data.h_cm_         = Convert.ToDouble(aux[1]);
                data.flow_Q_l_s_   = Convert.ToDouble(aux[2]);
                data.idEnteredData = idDocument;
                db.hydrologicalDatas.Add(data);
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Beispiel #2
0
        public bool insertHydrologicalData(int idDocument, int rowNumber, string reader)
        {
            try
            {
                string[] aux = null;
                aux = reader.Split(';').Where(x => !String.IsNullOrEmpty(x)).ToArray();
                hydrologicalData data = new hydrologicalData();

                return(true);
            }
            catch
            {
                return(false);
            }
        }