Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            GBshotcounter += Convert.ToInt32(lprTBX.Text);
            if (GBshotcounter < GBmaxShot)
            {
                if (shotCount(lprTBX.Text) == true)
                {
                    TimerStart();
                    button1.Enabled = true;
                    timeend.Text    = DateTime.Now.ToString();
                    stopwatch1.Start();

                    totalLBL.Text = GBshotcounter.ToString();
                    updAll();
                    clearAll();
                }
                else
                {
                    MessageBox.Show("Sila Enter Nombor");
                }
            }
            else if (GBshotcounter >= GBmaxShot)
            {
                CleaningBox clean = new CleaningBox();
                clean.Show();
                clean.alarm();
                GBmaxShot = 0;
            }
        }
Ejemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            TimeSpan start    = TimeSpan.Zero;
            TimeSpan add      = new TimeSpan(0, 0, 1);
            TimeSpan combined = start.Add(TimeSpan.FromSeconds(1));


            label21.Text = stopwatch1.Elapsed.ToString();


            if (stopwatch1.ElapsedMilliseconds < (1000 * 60 * 60 * 8))
            {
            }
            else
            {
                timer1.Stop();
                stopwatch1.Stop();
                TimerStop();
                CleaningBox clean = new CleaningBox();
                clean.Show();
                clean.alarm();


                //if (clean.buttonclicked == true)
                //{
                //    clean.stopSound();
                //}

                stopwatch1.Reset();
                eightHour = true;
            }
            //MessageBox.Show("The form will now be closed.", "Time Elapsed");
            //this.Close();
        }
Ejemplo n.º 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            lotcount += 1;

            if (lotcount == 12)
            {
                CleaningBox clean = new CleaningBox();
                lotcount = 0;
                stopwatch1.Reset();
                clean.Show();
                clean.alarm();

                //if (clean.buttonclicked == true)
                //{
                //    clean.stopSound();
                //}
            }
            updAll();
            clearAll();
        }
Ejemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (shotCount(lprTBX.Text) == true)
            {
                TBshotcounter += Convert.ToInt32(lprTBX.Text) / 4;
                GBshotcounter += Convert.ToInt32(lprTBX.Text);

                //GBshotcounter = TBshotcounter;
                if (GBshotcounter < GBmaxShot && TBshotcounter < TBmaxShot)
                {
                    TimerStart();
                    button1.Enabled = true;
                    timeend.Text    = DateTime.Now.ToString();
                    stopwatch1.Start();

                    GBtotalLBL.Text = GBshotcounter.ToString();

                    //if (GBshotcounter != 0)
                    //{
                    //    TBshotcounter += TBshotcounter + (GBshotcounter / 4);
                    //}
                    //else
                    //    GBshotcounter = 0;
                    tbtotalLBL.Text = TBshotcounter.ToString();
                    //tbtotalLBL.Text = tabpress.ToString();
                    updAll();
                    clearAll();
                }
                else if (GBshotcounter >= GBmaxShot || TBshotcounter >= TBmaxShot)
                {
                    GBtotalLBL.Text = GBshotcounter.ToString();
                    //int tabpress2 = 0;
                    //if (GBshotcounter != 0)
                    //{
                    //    TBshotcounter += GBshotcounter / 4;
                    //}
                    //else
                    //    GBshotcounter = 0;
                    tbtotalLBL.Text = TBshotcounter.ToString();

                    CleaningBox clean = new CleaningBox();
                    clean.Show();
                    clean.alarm();

                    if (GBshotcounter >= GBmaxShot)
                    {
                        GBshotcounter = 0;
                    }
                    if (TBshotcounter >= TBmaxShot)
                    {
                        TBshotcounter = 0;
                    }


                    button1.Enabled = true;
                    updAll();
                    clearAll();
                }
            }
            else
            {
                MessageBox.Show("Sila Enter Nombor");
            }
        }