Example #1
0
        private void panelClose_Click(object sender, EventArgs e)
        {
            //It is fairly safe to not have a password, because the program will close completely in remote mode,
            //and in simple mode, the patient is usually supervised.
            if (PrefC.GetString(PrefName.TerminalClosePassword) == "")
            {
                if (!IsSimpleMode)
                {
                    TerminalActives.DeleteAllForComputer(Environment.MachineName);
                }
                Close();
                return;
            }
            InputBox input = new InputBox("Password");

            input.ShowDialog();
            if (input.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (input.textResult.Text != PrefC.GetString(PrefName.TerminalClosePassword))
            {
                MsgBox.Show(this, "Invalid password.");
                return;
            }
            if (!IsSimpleMode)
            {
                TerminalActives.DeleteAllForComputer(Environment.MachineName);
            }
            Close();
        }
		private void butDelete_Click(object sender,EventArgs e) {
			if(gridMain.GetSelectedIndex()==-1) {
				MsgBox.Show(this,"Please select a terminal first.");
				return;
			}
			if(!MsgBox.Show(this,MsgBoxButtons.OKCancel,"A terminal row should not be deleted unless it is showing erroneously and there really is no terminal running on the computer shown.  Continue anyway?")) {
				return;
			}
			//string computerName=
			TerminalActives.DeleteAllForComputer(TerminalList[gridMain.GetSelectedIndex()].ComputerName);
			FillGrid();
		}
Example #3
0
 private void FormTerminal_Load(object sender, EventArgs e)
 {
     this.Size               = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size;
     this.Location           = new Point(0, 0);
     labelConnection.Visible = false;
     if (IsSimpleMode)
     {
         timer1.Enabled      = false;
         textWelcome.Visible = false;
     }
     else
     {
         //tell the database that a terminal is newly active on this computer.
         TerminalActives.DeleteAllForComputer(Environment.MachineName);
         TerminalActive terminal = new TerminalActive();
         terminal.ComputerName = Environment.MachineName;
         TerminalActives.Insert(terminal);
         UnloadPatient();
         //do not load a patient
     }
 }