Exemplo n.º 1
0
        private void SaveFileCsv()
        {
            string dir      = Path.GetDirectoryName(sdgExcel.FileName);
            string fileName = Path.GetFileName(sdgExcel.FileName);

            ProcessFile wf = new ProcessFile(fileName, dir, _listDeviceData);

            wf.SetDeviceInfo(txtIPAddress.Text, lblProductName.Text, lblFimOld.Text, lblFimNew.Text);
            if (!wf.WriteDeviceInfo())
            {
                MessageBox.Show(wf.ErrorMessage);
            }
        }
Exemplo n.º 2
0
        private void MnuFileOpen_Click(object sender, EventArgs e)
        {
            ofdFiles             = new OpenFileDialog();
            ofdFiles.Filter      = FILTERS_CSV;
            ofdFiles.FilterIndex = 2;
            if (ofdFiles.ShowDialog() == DialogResult.OK)
            {
                string filePath = ofdFiles.FileName;
                if (Path.GetExtension(filePath).ToLower().Equals(".csv"))
                {
                    ProcessFile pf = new ProcessFile(ofdFiles.FileName, ofdFiles.FileName, _listDeviceData);
                    if (pf.LoadDeviceData())
                    {
                        txtIPAddress.Text   = pf.IPAddress;
                        lblProductName.Text = pf.DeviceName;
                        lblFimOld.Text      = pf.OrigFIM;
                        lblFimNew.Text      = pf.NewFIM;

                        _listDeviceData = pf.ListDeviceSettings;
                        BindDataGrid();
                    }
                }
            }
        }