Пример #1
0
 private void toolStripButton_add_Click(object sender, EventArgs e)
 {
     Form f = pointer_MainForm.getRespectiveForm(toolStripComboBox_listOfActions.SelectedItem);
     Model_Automator model = new Model_Automator(toolStripComboBox_listOfActions.SelectedItem.ToString());
     this.dataGridView1.DataSource = null;
     Model_Automator.list.Add(model);
     this.dataGridView1.DataSource = Model_Automator.list;
     ((Form_Automatable)f).Show_withAutomationSettings(model);
     if (this.Text.LastIndexOf('*') == -1) this.Text += '*';
 }
        public void Show_withAutomationSettings(Model_Automator automationModel)
        {
            this.automationModel = automationModel;
            this.Text = this.Text + " [Automation Setting]";
            this.button_cancel.Enabled = false;
            this.ControlBox = false;
            Reflector.AssignButtonEvent(button_start, new EventHandler(Form_ConfirmSettings)).Text = "OK";

            if (automationModel.Param1 != null && automationModel.Param2 != null &&
                automationModel.Param3 != null && automationModel.Param4 != null && automationModel.Param5 != null)
            {
                textBox_stockPath.Text = automationModel.Param1;
                textBox_indexPath.Text = automationModel.Param2;
                textBox_tbillPath.Text = automationModel.Param3;
                textBox_outputPath.Text = automationModel.Param4;
                textBox_logPath.Text = automationModel.Param5;
            }
            this.Show();
        }
Пример #3
0
        public void Show_withAutomationSettings(Model_Automator automationModel)
        {
            this.automationModel = automationModel;
            this.Text = this.Text + " [Automation Setting]";
            this.button_cancel.Enabled = false;
            this.ControlBox = false;
            Reflector.AssignButtonEvent(button_start, new EventHandler(Form_ConfirmSettings)).Text = "OK";

            if (automationModel.Param1 != null && automationModel.Param2 != null &&
                automationModel.Param3 != null && automationModel.Param4 != null &&
                automationModel.Param5 != null)
            {
                if (automationModel.Param1.Equals("0"))
                {
                    textBox_stockCode.Enabled = false;
                    checkBox_getAll.Enabled = false;
                    checkBox_getGem.Enabled = false;
                }

                if (automationModel.Param1.Equals("-1"))
                {
                    textBox_stockCode.Enabled = false;
                    checkBox_getAll.Checked = true;
                    checkBox_getGem.Checked = false;
                }

                if (automationModel.Param1.Equals("-2"))
                {
                    textBox_stockCode.Enabled = false;
                    checkBox_getAll.Checked = false;
                    checkBox_getGem.Checked = true;
                }

                if (automationModel.Param1.Equals("-3"))
                {
                    textBox_stockCode.Enabled = false;
                    checkBox_getAll.Checked = true;
                    checkBox_getGem.Checked = true;
                }

                textBox_stockCode.Text = automationModel.Param1;

                try
                {
                    monthCalendar_startDate.SelectionStart =
                        new DateTime(int.Parse(automationModel.Param2.Substring(0, 4)),
                            int.Parse(automationModel.Param2.Substring(4, 2)),
                            int.Parse(automationModel.Param2.Substring(6, 2)));
                }
                catch (Exception ex)
                {
                    LogHelper.GetLogger(typeof(MainForm)).FullLog(ex.ToString(), "IGNORE");
                    monthCalendar_startDate.SelectionStart = new DateTime(2003, 1, 1);
                }

                try
                {
                    monthCalendar_endDate.SelectionStart =
                        new DateTime(int.Parse(automationModel.Param3.Substring(0, 4)),
                            int.Parse(automationModel.Param3.Substring(4, 2)),
                            int.Parse(automationModel.Param3.Substring(6, 2)));
                }
                catch (Exception ex)
                {
                    LogHelper.GetLogger(typeof(MainForm)).FullLog(ex.ToString(), "IGNORE");
                    monthCalendar_endDate.SelectionStart = DateTime.Now;
                }

                textBox_outPath.Text = automationModel.Param4;
                textBox_logPath.Text = automationModel.Param5;
            }
            this.Show();
        }
        public void Show_withAutomationSettings(Model_Automator automationModel)
        {
            this.automationModel = automationModel;
            this.Text = this.Text + " [Automation Setting]";
            this.button_cancel.Enabled = false;
            this.ControlBox = false;
            Reflector.AssignButtonEvent(button_start, new EventHandler(Form_ConfirmSettings)).Text = "OK";

            if (automationModel.Param1 != null && automationModel.Param2 != null &&
                automationModel.Param2 != null && automationModel.Param4 != null && automationModel.Param5 != null)
            {
                try
                {
                    trackBar_noctbd.Value = int.Parse((automationModel.Param1));
                }
                catch (Exception ex)
                {
                    LogHelper.GetLogger(typeof(MainForm)).FullLog(ex.ToString(), "IGNORE");
                }

                textBox_noctbd.Text = automationModel.Param1;
                textBox_stockPath.Text = automationModel.Param2;
                textBox_genusPath.Text = automationModel.Param3;
                textBox_logPath.Text = automationModel.Param4;
                textBox_refPeriod.Text = automationModel.Param5;
            }
            this.Show();
        }
Пример #5
0
        public void Show_withAutomationSettings(Model_Automator automationModel)
        {
            this.automationModel = automationModel;
            this.Text = this.Text + " [Automation Setting]";
            this.button_cancel.Enabled = false;
            this.ControlBox = false;
            Reflector.AssignButtonEvent(button_ok, new EventHandler(Form_ConfirmSettings)).Text = "OK";

            if (automationModel.Param1 != null && automationModel.Param2 != null &&
                automationModel.Param2 != null && automationModel.Param4 != null &&
                automationModel.Param5 != null && automationModel.Param6 != null)
            {
                try
                {
                    radioButton_subset.Checked = (int.Parse(automationModel.Param2) != 0);
                    radioButton_univSet.Checked = (int.Parse(automationModel.Param2) == 0);
                    // radioButton_minStocksInCluster.Checked = (int.Parse(automationModel.Param3) != 0);
                    // radioButton_significantCluster.Checked = (int.Parse(automationModel.Param3) == 0);
                }
                catch (Exception ex)
                {
                    LogHelper.GetLogger(typeof(MainForm)).FullLog(ex.ToString(), "IGNORE");
                }

                textBox_stockPath.Text = automationModel.Param1;
                textBox_clusterPath.Text = automationModel.Param4;
                textBox_minStocksInCluster.Text = automationModel.Param5;
                textBox_logPath.Text = automationModel.Param6;
            }
            this.Show();
        }
Пример #6
0
 private void toolStripButton_subset_Click(object sender, EventArgs e)
 {
     Form f = pointer_MainForm.getRespectiveForm("SUBSET-START");
     Model_Automator model = new Model_Automator("SUBSET-START");
     this.dataGridView1.DataSource = null;
     Model_Automator.list.Add(model);
     this.dataGridView1.DataSource = Model_Automator.list;
     ((Form_Automatable)f).Show_withAutomationSettings(model);
     if (this.Text.LastIndexOf('*') == -1) this.Text += '*';
 }
        public void Show_withAutomationSettings(Model_Automator automationModel)
        {
            this.automationModel = automationModel;
            this.Text = this.Text + " [Automation Setting]";
            this.button_cancel.Enabled = false;
            this.ControlBox = false;
            Reflector.AssignButtonEvent(button_start, new EventHandler(Form_ConfirmSettings)).Text = "OK";

            if (automationModel.Param1 != null && automationModel.Param2 != null && 
                automationModel.Param2 != null && automationModel.Param4 != null)
            {
                if (automationModel.Param1.Equals("-1"))
                {
                    radioButton_weekly.Select();
                }
                else if(automationModel.Param1.Equals("-2"))
                {
                    radioButton_mthly.Select();
                }
                else if (automationModel.Param1.Equals("-3"))
                {
                    radioButton_yrly.Select();
                }
                else
                {
                    radioButton_custom.Select();
                }

                textBox_noDays.Text = automationModel.Param1;
                textBox_stockInput.Text = automationModel.Param2;
                textBox_stockOutput.Text = automationModel.Param3;
                textBox_log.Text = automationModel.Param4;
            }
            this.Show();
        }
Пример #8
0
 public void Show_withAutomationSettings(Model_Automator automationModel)
 {
     // not a must to implement
 }
        public void Show_withAutomationSettings(Model_Automator automationModel)
        {
            this.automationModel = automationModel;
            this.Text = this.Text + " [Automation Setting]";
            this.button_cancel.Enabled = false;
            this.ControlBox = false;
            Reflector.AssignButtonEvent(button_start, new EventHandler(Form_ConfirmSettings)).Text = "OK";

            if (automationModel.Param1 != null && automationModel.Param2 != null && automationModel.Param3 != null)
            {
                if (automationModel.Param1.Equals("0"))
                {
                    radioButton_index.Select();
                    textBox_stockCode.Enabled = false;
                }
                else
                {
                    radioButton_stock.Select();
                    textBox_stockCode.Enabled = true;
                }

                textBox_stockCode.Text = automationModel.Param1;
                textBox_path.Text = automationModel.Param2;
                textBox_log.Text = automationModel.Param3;
            }
            this.Show();
        }