/// <summary> /// [Português] /// Botões que contem as ações do menu principal. /// <para></para> /// [English] /// Buttons that contains the actions of the main menu. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolMenuPrincipal_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { switch (e.ClickedItem.Name) { case "btnCadastraPaciente": FrmCadPatient frmCadPaciente = new FrmCadPatient(); frmCadPaciente.ShowDialog(); break; case "btnRelatorio": try { if (PatientController.Instance.PacientList().Count != 0) { FrmReportAll frmReportAll = new FrmReportAll(PatientController.Instance.PacientList()); frmReportAll.ShowDialog(); } else { throw new Exception("Para gerar um relatório é necessário cadastrar um paciente."); } } catch (Exception erro) { Bitmap img = new Bitmap(Gestum.Properties.Resources.exclamation); ShowMessage("Erro Inesperado!", erro.Message, img); } break; default: break; } }
/// <summary> /// [Português] /// Método que exibe o form FrmCadPaciente. /// <para></para> /// [English] /// Method that displays the form FrmCadPaciente. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCadastraPaciente_Click(object sender, EventArgs e) { FrmCadPatient frmCadPaciente = new FrmCadPatient(); frmCadPaciente.ShowDialog(); }
/// <summary> /// [Português] /// Evento quando se clica na células de Editar ou de Avaliação, abre suas respectivos Forms. /// <para></para> /// [English] /// Event when you click the Edit or cell Assessment, opens its respective Forms. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void grdPrincipal_CellContentClick(object sender, DataGridViewCellEventArgs e) { Patient patient = null; try { switch (grdPrincipal.Columns[e.ColumnIndex].Name) { case "Avaliacao": int linha = grdPrincipal.CurrentRow.Index; string name = grdPrincipal[0, linha].Value.ToString(); string address = grdPrincipal[2, linha].Value.ToString(); patient = PatientController.Instance.SearchPatientByNameAddress(name, address); new FrmCapturePic(patient).ShowDialog(); break; case "Editar": patient = PatientReturn(); FrmCadPatient frmCadPacient = new FrmCadPatient(patient); frmCadPacient.ShowDialog(); break; case "Relatorio": patient = PatientReturn(); FrmReport frmRelatorio = new FrmReport(patient); frmRelatorio.ShowDialog(); break; default: break; } } catch (Exception erro) { Bitmap img = new Bitmap(Gestum.Properties.Resources.exclamation); ShowMessage("Ocorreu um erro!", "A base de dados está vazia. " + erro.Message, img); } }