/*
         * Metodo split_token separa los datos extraidos del archivo y lo estructura
         * mediante la clase input_data.
         */
        public Input_data split_token(String line)
        {
            /*
             * @params line, obtiene la linea actual del archivo capturando todo el contenido de esta.
             */
            Input_data _input_data = null;

            try
            {

                _input_data = new Input_data();

                String[] word = line.Split(',');

                _input_data.codigo = word[0];
                _input_data.verificacion = word[1];
                _input_data.n_medidor = word[2];
                _input_data.lectura_mes_cero = word[3];
                _input_data.enteros = word[4];
                _input_data.prom_consumo = word[5];
                _input_data.factor_error = word[6];

                return _input_data;

            }catch(Exception e)
            {

                MessageBox.Show("Error Controller_input_data.Split_token "+e.Message);

                return _input_data;

            }
        }
Beispiel #2
0
        private void listBox1_SelectedValueChanged(object sender, EventArgs e)
        {
            if (this.listBox1.DataSource != null)
            {

                this.listBox1.Visible = false;

                this.tCodeService.TextChanged -= new EventHandler(this.tCodeService_TextChanged);

                if (this.listBox1.SelectedIndex > 0)
                {

                    String selectedItem = this.listBox1.SelectedItem.ToString();

                    this.tCodeService.Text = selectedItem;

                    this.datos_externos = this.get_data(selectedItem);

                    this.tN_medidor.Text = datos_externos.n_medidor;
                }

                this.tCodeService.TextChanged += new EventHandler(this.tCodeService_TextChanged);
            }
        }