Beispiel #1
0
        private void Dashboard_changeProgress(string mssg)
        {
            Label       l    = mw.Controls.Find("label4", true)[0] as Label;
            ProgressBar pbar = mw.Controls.Find("progressBar1", true)[0] as ProgressBar;

            dgp.updateProgress(file_loaded, richTextBox1.TextLength > 0 ? 1 : 0);
            l.Text     = dgp.completedSteps().ToString() + " /";
            pbar.Value = dgp.completedSteps();
            l.Refresh();
        }
Beispiel #2
0
        private void Button1_Click_1(object sender, EventArgs e)
        {
            LoadingSpinner ls = new LoadingSpinner(this, AppMessages.messages["data_save"]);

            try
            {
                ls.show();
                ExcelReader excelReader = new ExcelReader();
                excelReader.saveExcelFromDataGridView(
                    new DataGridView[2] {
                    dataGridView1, dataGridView2
                },
                    new int[2] {
                    1, 2
                },
                    new string[2] {
                    "Sales Forecast", "Cost Of Sales"
                }
                    );

                TableGenerator tbl = new TableGenerator();
                tbl.GenerateMultipleTable(new DataGridView[2] {
                    dataGridView1, dataGridView2
                }, "sales_forecast_table.rtf", new string[2] {
                    "Sales Forecast", "Cost Of Sales"
                });
                ChartGenerator cgr = new ChartGenerator();
                cgr.generateBarChart(dataGridView1, "generate.png", "Forecast Sales");
                cgr.ImageToRtf("sales_forecast_table.rtf", "generate.png");
                cgr.generateBarChart(dataGridView2, "generate1.png", "Cost of Sales");
                cgr.ImageToRtf("sales_forecast_table.rtf", "generate1.png");
                Label       l    = mw.Controls.Find("label4", true)[0] as Label;
                ProgressBar pbar = mw.Controls.Find("progressBar1", true)[0] as ProgressBar;
                dgp.updateProgress("sales_forecast_table.rtf", dataGridView1.Rows.Count > 0 && dataGridView2.Rows.Count > 0 ? 1 : 0);
                l.Text     = dgp.completedSteps().ToString() + " /";
                pbar.Value = dgp.completedSteps();
                l.Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception: " + ex.Message);
            }
            finally
            {
                ls.hide();
            }
        }
Beispiel #3
0
 private void Button1_Click(object sender, EventArgs e)
 {
     if (validateData())
     {
         LoadingSpinner ls = new LoadingSpinner(this, AppMessages.messages["data_save"]);
         try
         {
             ls.show();
             ExcelReader excelReader = new ExcelReader();
             excelReader.saveExcelFromDataGridView(
                 new DataGridView[1] {
                 dataGridView1
             },
                 new int[1] {
                 1
             },
                 new string[1] {
                 "Market Analysis"
             }
                 );
             TableGenerator tbl = new TableGenerator();
             tbl.Generate(dataGridView1, "market_analysis.rtf");
             ChartGenerator cgen = new ChartGenerator();
             cgen.generatePieChart(dataGridView1, "generated.png", "Market Analysis");
             cgen.ImageToRtf("market_analysis.rtf", "generated.png");
             Label       l    = mw.Controls.Find("label4", true)[0] as Label;
             ProgressBar pbar = mw.Controls.Find("progressBar1", true)[0] as ProgressBar;
             dgp.updateProgress("market_analysis.rtf", dataGridView1.Rows.Count > 0 ? 1 : 0);
             l.Text     = dgp.completedSteps().ToString() + " /";
             pbar.Value = dgp.completedSteps();
             l.Refresh();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Exception: " + ex.Message);
         }
         finally
         {
             ls.hide();
         }
     }
     else
     {
         MessageBox.Show("Percentage cannot exceed 100 !");
     }
 }
 private void SaveBt_Click(object sender, EventArgs e)
 {
     try
     {
         this.richTextBox1.SaveFile(ProjectConfig.projectPath + "\\" + "financial_statement.rtf");
         Label       l    = mw.Controls.Find("label4", true)[0] as Label;
         ProgressBar pbar = mw.Controls.Find("progressBar1", true)[0] as ProgressBar;
         dgp.updateProgress("financial_statement.rtf", richTextBox1.TextLength == 0 ? 0 : 1);
         l.Text     = dgp.completedSteps().ToString() + " /";
         pbar.Value = dgp.completedSteps();
         l.Refresh();
         MessageBox.Show("Saved successfully !");
     }
     catch (Exception ex)
     {
         MessageBox.Show("Exception: " + ex.Message);
     }
 }
Beispiel #5
0
        public MainWindow()
        {
            InitializeComponent();
            ToolStripManager.Renderer = new Office2007Renderer.Office2007Renderer();
            toolBar.Renderer          = new Office2007Renderer.Office2007Renderer();
            this.home.TopLevel        = false;
            panel1.Controls.Clear();
            panel1.Controls.Add(this.home);
            this.home.parentForm = this;
            this.home.Show();
            AppUtilities.mainForm = this;
            project_name          = ProjectConfig.projectSettings["Title"].ToString().ToUpper();
            label1.Text           = project_name.ToUpper();
            currency.Text         = ProjectConfig.projectSettings.ContainsKey("Currency") ? ProjectConfig.projectSettings["Currency"].ToString() : "N.A.";
            setTreeNodes();
            DocumentProgressor dpg = new DocumentProgressor();

            label4.Text          = dpg.completedSteps().ToString() + " /";
            label5.Text          = dpg.totalSteps().ToString() + " tasks completed";
            progressBar1.Maximum = dpg.totalSteps();
            progressBar1.Value   = dpg.completedSteps();
            currencyHandler();
            if (dashboard == null)
            {
                activateEditMenus(0);
            }
            meeting_count = DatabaseReader.getMeetingCount();
            button1.Text  = meeting_count == 1 ? meeting_count + " Meeting Today" : meeting_count + " Meetings Today";
            if (meeting_count > 0)
            {
                button1.ImageIndex = 1;
                button1.Enabled    = true;
            }
            else
            {
                button1.ImageIndex = 0;
                button1.Enabled    = false;
            }
        }