private void butLoad_Click(object sender, EventArgs e) { if (gridMain.GetSelectedIndex() == -1) { MsgBox.Show(this, "Please select a terminal first."); return; } TerminalActive terminal = TerminalList[gridMain.GetSelectedIndex()].Copy(); if (terminal.PatNum != 0) { if (!MsgBox.Show(this, true, "A patient is currently using the terminal. If you continue, they will lose the information that is on their screen. Continue anyway?")) { return; } } long patNum = FormOpenDental.CurPatNum; terminal.PatNum = patNum; TerminalActives.Update(terminal); FillGrid(); /* * else { * //just load up a terminal on this computer in a modal window. The terminal window itself will handle clearing it from the db when done. * TerminalActives.DeleteAllForComputer(Environment.MachineName); * TerminalActive terminal=new TerminalActive(); * terminal.ComputerName=Environment.MachineName; * terminal.PatNum=FormOpenDental.CurPatNum; * TerminalActives.Insert(terminal); * //Still need to start the modal window * }*/ }
private void butDone_Click(object sender, EventArgs e) { if (IsSimpleMode) { labelForms.Visible = false; listForms.Visible = false; butDone.Visible = false; Sheets.ClearFromTerminal(PatNum); PatNum = 0; labelThankYou.Visible = true; } else { Sheets.ClearFromTerminal(PatNum); UnloadPatient(); //tell the database about it so that the terminal manager can see TerminalActive terminal = TerminalActives.GetTerminal(Environment.MachineName); if (terminal == null) { return; } terminal.PatNum = 0; TerminalActives.Update(terminal); } }
private void menuItemMedical_Click(object sender, EventArgs e) { if (gridMain.GetSelectedIndex() == -1) { MsgBox.Show(this, "Please select a terminal first."); return; } TerminalActive terminal = TerminalList[gridMain.GetSelectedIndex()].Copy(); if (terminal.TerminalStatus == TerminalStatusEnum.Standby) { MsgBox.Show(this, "Please load a patient onto this terminal first."); return; } //See if the selected patient already has diseases attached Disease[] DiseaseList = Diseases.Refresh(terminal.PatNum); if (DiseaseList.Length > 0) { MsgBox.Show(this, "This patient already has diseases attached. This function is only intended for new patients. Patient cannot be loaded."); return; } //See if the selected patient already has questions attached /*if(Questions.PatHasQuest(terminal.PatNum)) { * MsgBox.Show(this,"This patient already has questions attached. This function is only intended for new patients. Patient cannot be loaded."); * return; * }*/ if (!MsgBox.Show(this, true, "A patient is currently using the terminal. If you continue, they will lose the information that is on their screen. Continue anyway?")) { return; } terminal.TerminalStatus = TerminalStatusEnum.Medical; TerminalActives.Update(terminal); FillGrid(); }
private void butUpdatePatient_Click(object sender, EventArgs e) { if (gridMain.GetSelectedIndex() == -1) { MsgBox.Show(this, "Please select a terminal first."); return; } TerminalActive terminal = TerminalList[gridMain.GetSelectedIndex()].Copy(); if (terminal.TerminalStatus != TerminalStatusEnum.Standby) { if (!MsgBox.Show(this, true, "A patient is currently using the terminal. If you continue, they will lose the information that is on their screen. Continue anyway?")) { return; } } if (FormOpenDental.CurPatNum == 0) { MsgBox.Show(this, "Please select a patient in the main window first."); return; } //FormPatientSelect FormP=new FormPatientSelect(); //FormP.ShowDialog(); //if(FormP.DialogResult!=DialogResult.OK) { // return; //} //int patNum= terminal.PatNum = FormOpenDental.CurPatNum; terminal.TerminalStatus = TerminalStatusEnum.UpdateOnly; TerminalActives.Update(terminal); FillGrid(); }
private void butClear_Click(object sender,EventArgs e) { if(gridMain.GetSelectedIndex()==-1) { MsgBox.Show(this,"Please select a terminal first."); return; } TerminalActive terminal=TerminalList[gridMain.GetSelectedIndex()].Copy(); if(terminal.PatNum==0) { return; } if(!MsgBox.Show(this,true,"A patient is currently using the terminal. If you continue, they will lose the information that is on their screen. Continue anyway?")) { return; } terminal.PatNum=0; TerminalActives.Update(terminal); FillGrid(); }
/*private void menuItemQuestions_Click(object sender,EventArgs e) { * if(gridMain.GetSelectedIndex()==-1) { * MsgBox.Show(this,"Please select a terminal first."); * return; * } * TerminalActive terminal=TerminalList[gridMain.GetSelectedIndex()].Copy(); * if(terminal.TerminalStatus==TerminalStatusEnum.Standby) { * MsgBox.Show(this,"Please load a patient onto this terminal first."); * return; * } * //See if the selected patient already has questions attached * if(Questions.PatHasQuest(terminal.PatNum)) { * MsgBox.Show(this,"This patient already has questions attached. This function is only intended for new patients. Patient cannot be loaded."); * return; * } * if(!MsgBox.Show(this,true,"A patient is currently using the terminal. If you continue, they will lose the information that is on their screen. Continue anyway?")) { * return; * } * terminal.TerminalStatus=TerminalStatusEnum.Questions; * terminal.Update(); * FillGrid(); * }*/ private void menuItemUpdateOnly_Click(object sender, EventArgs e) { if (gridMain.GetSelectedIndex() == -1) { MsgBox.Show(this, "Please select a terminal first."); return; } TerminalActive terminal = TerminalList[gridMain.GetSelectedIndex()].Copy(); if (terminal.TerminalStatus == TerminalStatusEnum.Standby) { MsgBox.Show(this, "Please load a patient onto this terminal first."); return; } if (!MsgBox.Show(this, true, "A patient is currently using the terminal. If you continue, they will lose the information that is on their screen. Continue anyway?")) { return; } terminal.TerminalStatus = TerminalStatusEnum.UpdateOnly; TerminalActives.Update(terminal); FillGrid(); }