Beispiel #1
0
 private void checkPull2()
 {
     txtLocationPull2.Text  = this.pull2Location;
     chkEnablePull2.Checked = this.pull2Enabled;
     if (String.IsNullOrEmpty(this.pull2Location) == false && this.pull2Enabled)
     {
         gammuPull2 = new GMonit(pull2Location, GMonit.PULL2INDEX);
         if (!gammuPull2.checkTableExists())
         {
             chkEnablePull2.Checked = false;
             this.pull2Enabled      = false;
             DialogResult dr = MessageBox.Show("System Cannot detected table, want to create new?",
                                               "Table not found", MessageBoxButtons.YesNo);
             switch (dr)
             {
             case DialogResult.Yes:
                 gammuPull2.createTableLog();
                 break;
             }
         }
         else
         {
             gammuPull2.detectProcess();
             timerMonitPull2.Start();
             fillPull2DataList();
         }
     }
 }
Beispiel #2
0
        private void btnLocationPull2_Click(object sender, EventArgs e)
        {
            var filepath = String.Empty;

            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.InitialDirectory = "c:\\";
                openFileDialog.Filter           = "Exe Files (.exe)|*.exe|All Files (*.*)|*.*";
                openFileDialog.RestoreDirectory = true;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    filepath = openFileDialog.FileName;
                    txtLocationPull2.Text = filepath;
                    Helper.Setingan.set("pull2Location", filepath);
                    this.gammuPull2 = new GMonit(filepath, GMonit.PULL2INDEX);
                }
            }
        }
Beispiel #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            timerJam.Start();
            picStatusPull1.Image = GammuMonitoring.Properties.Resources.power;
            picStatusPull2.Image = GammuMonitoring.Properties.Resources.power;
            bool firstStart = Boolean.Parse(ConfigurationManager.AppSettings.Get("firstload"));

            if (firstStart)
            {
                gammuPull1 = new GMonit("", GMonit.PULL1INDEX);
                gammuPull1.createTableLog();
                gammuPull2 = new GMonit("", GMonit.PULL2INDEX);
                gammuPull2.createTableLog();
                Helper.Setingan.set("firstload", "true");
            }
            else
            {
                checkPull1();
                checkPull2();
            }
        }
Beispiel #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            var filepath = String.Empty;

            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.InitialDirectory = "c:\\";
                openFileDialog.Filter           = "Exe Files (.exe)|*.exe|All Files (*.*)|*.*";
                openFileDialog.RestoreDirectory = true;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    filepath      = openFileDialog.FileName;
                    textBox1.Text = filepath;
                    Helper.Setingan.set("pull1Location", filepath);
                    this.gammuPull1 = new GMonit(filepath, GMonit.PULL1INDEX);
                    if (timerMonitPull1.Enabled == false)
                    {
                        timerMonitPull1.Start();
                    }
                }
            }
        }