/************************************************************************
        ** Code panel Threshold
        ************************************************************************/
        private void linkthreshold_Click(object sender, System.EventArgs e)
        {
            try
            {
                Database myDatabase = new Database();
                lbNode.Enabled = true;
                lbGeneral.Enabled = true;
                linkthreshold.Enabled = false;
                linksetup.Enabled = true;

                pnGeneral.Visible = false;
                pnNode.Visible = false;
                pnthreshold.Visible = true;
                pnsetup.Visible = false;

                panel2.Visible = true;
                panel2.Controls.Add(pnthreshold);
                pnthreshold.Location = new Point(0, 0);
                txtTemThresh.Text = myDatabase.getTempMax().ToString();
                txtHumiThresh.Text = myDatabase.getHumiMax().ToString();
                txtPhoneThresh.Text = myDatabase.getPhoneNumber().ToString();
                cbSmokeThresh.SelectedIndex = -1;
                cbSelectVan.Items.Clear();
                XmlNodeList van = (myDatabase.xml).GetElementsByTagName("val");
                foreach (XmlNode idVan in van)
                {
                    string str = idVan.Attributes["id"].Value;
                    cbSelectVan.Items.Add("Van "+str);
                }
                cbSelectVan.SelectedIndex = 0;
                txtTemThresh.Text = myDatabase.getTempVan(1).ToString();
                txtHumiThresh.Text = myDatabase.getHumiVan(1).ToString();
            }
            catch { }
        }
 private void btCancelThreshold_Click(object sender, System.EventArgs e)
 {
     try
     {
         Database myDatabase = new Database();
         txtTemThresh.Text = myDatabase.getTempMax().ToString();
         txtHumiThresh.Text = myDatabase.getHumiMax().ToString();
         txtPhoneThresh.Text = myDatabase.getPhoneNumber().ToString();
         cbSmokeThresh.SelectedIndex = -1;
     }
     catch { }
 }