Esempio n. 1
0
        private void matbtnSettings_Click(object sender, EventArgs e)
        {
            webcam.Stop();
            frmEntrance entrance = this;
            frmSetup    setup    = new frmSetup();

            entrance.Hide();
            setup.Show();
        }
Esempio n. 2
0
        private void materialFlatButton1_Click(object sender, EventArgs e)
        {
            string path = "Settings.txt";
            string scanner = "", cam = "", exit = "", gate = "", gateID = "";

            // Cam
            if (rdoEnableCam.Checked == true)
            {
                cam = "Y"; // Yes
            }
            else if (rdoDisableCam.Checked == true)
            {
                cam = "N"; // No
            }

            // Scanner
            if (rdoEnableScan.Checked == true)
            {
                scanner = "Y"; // Yes
            }
            else if (rdoDisableScan.Checked == true)
            {
                scanner = "N"; // No
            }

            // Gate
            if (rdoArea.Checked == true)
            {
                gate = "A"; // Area
            }
            else if (rdoGate.Checked == true)
            {
                gate = "M"; // Main Gate
            }

            // Gate ID
            gateID = cbxName.SelectedValue.ToString();


            if (rdoEntrance.Checked == false && rdoExit.Checked == false)
            {
                MessageBox.Show("Please select whether gate is a entrance or a exit");
            }
            else
            {
                // Exit
                if (rdoExit.Checked == true)
                {
                    exit = "Ex";      //Exit
                }
                else if (rdoEntrance.Checked == true)
                {
                    exit = "En";      // Entrance
                }
                // File format Gate Type, Gate ID, Cam, Scanner, Entrins Type
                System.IO.File.WriteAllText(path, gate + ',' + gateID + ',' + cam + ',' + scanner + ',' + exit);

                frmEntrance entrance = new frmEntrance();
                frmSetup    setup    = this;
                setup.Hide();
                entrance.Show();
            }
        }