Ejemplo n.º 1
0
        private void ButtonGetExcel_Click(object sender, EventArgs e)
        {
            MainForm.ProcessFlag.SetFlag(true, "Obtener Archivo Excel");

            ProcessImportRelation = new BusinessLogic.ProcessImportRelation(BusinessLogic);
            ProcessImportRelation.UpdateProgress += UpdateProgress1;

            for (int i = 0; i < CheckedListProgress.Items.Count; i++)
            {
                CheckedListProgress.SetItemChecked(i, false);
            }

            bool ExcelObtained = ProcessImportRelation.GetExcel();

            if (ExcelObtained)
            {
                CheckedListProgress.SetItemChecked(0, true);
                TextboxPath.Text = ProcessImportRelation.ExcelRoot;
                ProcessImportRelation.CreateFolders();
                CheckedListProgress.SetItemChecked(1, true);
                CheckedListProgress.SetItemChecked(2, true);
                CheckedListProgress.SetItemChecked(3, true);
                CheckedListProgress.SetItemChecked(4, true);

                ButtonLoadExcel.Enabled = true;
            }

            MainForm.ProcessFlag.DropFlag();
        }
Ejemplo n.º 2
0
        private void VerifyCheckedList()
        {
            bool allChecked = true;

            for (int i = 0; i < CheckedListProgress.Items.Count; i++)
            {
                if (!CheckedListProgress.GetItemChecked(i))
                {
                    allChecked = false;
                }
            }

            if (allChecked)
            {
                ButtonUpdateConfig.Enabled = true;
            }
        }
Ejemplo n.º 3
0
        private void Reset()
        {
            //Setea todo a su estado predeterminado
            ProgressBarLoadExcel.Value = 0;
            ProgressBarUpdate.Value    = 0;
            TextboxPath.Text           = "";
            for (int i = 0; i < CheckedListProgress.Items.Count; i++)
            {
                CheckedListProgress.SetItemChecked(i, false);
            }

            ButtonLoadExcel.Enabled    = false;
            ButtonUpdateConfig.Enabled = false;

            ProcessImportRelation.Dispose();
            ProcessImportRelation = null;

            MainForm.ProcessFlag.DropFlag();
        }
Ejemplo n.º 4
0
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (ProcessImportRelation.LoadExcelFlag)
            {
                MessageBox.Show("Excel Cargado Exitosamente.");
                CheckedListProgress.SetItemChecked(5, true);

                ButtonGetExcel.Enabled     = false;
                ButtonUpdateConfig.Enabled = true;
                MainForm.ProcessFlag.DropFlag();
            }
            else
            {
                if (BusinessLogic.ExceptionFlag.ExceptionObtained)
                {
                    MainForm.ExceptionFlag = BusinessLogic.ExceptionFlag;
                    MainForm.LookExceptionFlag();
                    MainForm.ExceptionFlag.Dropflag();
                    BusinessLogic.ExceptionFlag.Dropflag();
                }
                Reset();
            }
        }