Ejemplo n.º 1
0
        private async void btnImport_Click(object sender, System.EventArgs e)
        {
            string filePath;

            using (var openFileDialog1 = new OpenFileDialog())
            {
                var result = openFileDialog1.ShowDialog();
                if (result != DialogResult.OK)
                {
                    return;
                }
                filePath = openFileDialog1.FileName;
            }

            var importType = _importTypes.ElementAt(listImportTypes.SelectedIndex).Key;

            using (var form = new ImportRunning(Controller, importType, filePath))
            {
                form.ShowDialog();
                if (!form.Success)
                {
                    Close();
                    return;
                }
            }

            Success = true;
            Close();
        }
Ejemplo n.º 2
0
        private async void btnImport_Click(object sender, System.EventArgs e)
        {
            string filePath;
            using (var openFileDialog1 = new OpenFileDialog())
            {
                var result = openFileDialog1.ShowDialog();
                if (result != DialogResult.OK)
                    return;
                filePath = openFileDialog1.FileName;
            }

            var importType = _importTypes.ElementAt(listImportTypes.SelectedIndex).Key;

            using (var form = new ImportRunning(Controller, importType, filePath))
            {
                form.ShowDialog();
                if (!form.Success)
                {
                    Close();
                    return;
                }
            }
            
            Success = true;
            Close();
        }