Exemple #1
0
 protected void Start_Click(object sender, EventArgs e)
 {
     if (Timer1.Enabled == true)
     {
         MsgBox2.Show("Demarrer", "deja demarrez", "", new EO.Web.MsgBoxButton("Ok"));
     }
     else
     {
         Timer1.Enabled = true;
         Start.Enabled  = false;
         Stop.Enabled   = true;
     }
 }
Exemple #2
0
        protected void Delay_Click(object sender, EventArgs e)
        {
            int h;
            int m;
            int s;

            if (String.IsNullOrEmpty(Hours.Text) && String.IsNullOrEmpty(Minutes.Text) && String.IsNullOrEmpty(Secondes.Text))
            {
                MsgBox2.Show("Temp Invalide", "", "", new EO.Web.MsgBoxButton("Ok"));
            }
            else
            {
                Timer1.Enabled = false;
                try
                {
                    h = Int32.Parse(Hours.Text);
                }
                catch (Exception ex) { h = 0; }
                try
                {
                    m = Int32.Parse(Minutes.Text);
                }
                catch (Exception ex) { m = 0; }
                try
                {
                    s = Int32.Parse(Secondes.Text);
                }
                catch (Exception ex) { s = 0; }
                if (h == 0 && m == 0 && s == 0)
                {
                    MsgBox2.Show("Temp Invalide", "", "", new EO.Web.MsgBoxButton("Ok"));
                }
                else
                {
                    int time = h * 3600000 + m * 60000 + s * 1000;
                    Timer1.Interval = time;
                    Timer1.Enabled  = true;
                }
            }
        }