Ejemplo n.º 1
0
        private async void Button_ReadTab_Click(object sender, EventArgs e)
        {
            dialogPath = OpenDialogGetPathFile();

            exelManager = new ExcelManaging();

            processValue    = 0;
            processValueMax = 0;

            var progress = new Progress <int>(percent => { progressBar1.Value = percent; label1.Text = (percent + "%"); });

            await Task.Run(() => { ReadDataFromFileProcess(progress); PreparePropertiesAsync(criteria, taskElectreIII.TabelaMatrix, 1, 0); taskElectreIII.CreateDataTableAsync(1, 0); });

            //await ReadDataFromFileProcess(progress);

            /*            criteria = taskElectreIII.tabelaMatrix.GetLength(1);
             *          alternatives = taskElectreIII.tabelaMatrix.GetLength(0);*/
            //  await Task.Run( () => PreparePropertiesAsync(criteria, taskElectreIII.tabelaMatrix, 1, 0));
            // await PreparePropertiesAsync(criteria, taskElectreIII.TabelaMatrix, 1, 0);

            //await Task.Run(() => taskElectreIII.CreateDataTableAsync(1, 0));

            Task <DataTable> taskReadMatrixToDataTable = new Task <DataTable>(() => taskElectreIII.CreateDataTableAsync(1, 0));

            // await Task.Run(() => CreateTab());
            taskReadMatrixToDataTable.Start();

            dataGridView_Matrix.DataSource = await taskReadMatrixToDataTable;
            EstablishDataSourceAndBasicSettings();

            label1.Text = "\u2713";

            progressBar1.Value = 0;
        }
Ejemplo n.º 2
0
        private async void Button_SaveTab_Click(object sender, EventArgs e)
        {
            dialogPath  = OpenDialogGetPathDirectory();
            exelManager = new ExcelManaging();

            processValueMax = taskElectreIII.TabelaMatrix.GetLength(0) * taskElectreIII.TabelaMatrix.GetLength(1);

            var progress = new Progress <int>(percent => { progressBar1.Value = percent; label1.Text = (percent + "%"); });

            await Task.Run(() => SaveTableToFileProcess(progress));

            label1.Text = "\u2713";

            progressBar1.Value = 0;

            SavingSuccessfulEvent();
        }
Ejemplo n.º 3
0
        private async void Button_SaveData_Click(object sender, EventArgs e)
        {
            dialogPath  = OpenDialogGetPathDirectory();
            exelManager = new ExcelManaging();

            try {
                processValue    = 0;
                processValueMax = 12;

                var progress = new Progress <int>(percent => { progressBar1.Value = percent; label1.Text = (percent + "%"); });

                await Task.Run(() => SaveDataToFileProcess(progress));

                label1.Text = "\u2713";

                progressBar1.Value = 0;

                SavingSuccessfulEvent();
            }
            catch (Exception ex) {
                SavingFailedEvent();
                Console.WriteLine(ex);
            }
        }