public FormStaff(MySqlConnection conn, string userID, string firstName, string lastName, string userType) { InitializeComponent(); this.conn = conn; this.userID = userID; this.firstName = firstName; this.lastName = lastName; this.userType = userType; formQueue = new FormQueue(conn); formQueue.Show(); formQueue.WindowState = FormWindowState.Minimized; this.ctrlLogs = new CtrlLogs(this, formQueue, conn, userID); this.ctrlRegi = new CtrlRegi(this, conn, userID); this.ctrlCheck = new CtrlCheckAppt(this, conn, userID); this.ctrlAdd = new CtrlAddAppt(this, conn, userID); pnlControl.SuspendLayout(); pnlControl.Controls.Clear(); pnlControl.Controls.Add(ctrlLogs); pnlControl.ResumeLayout(); lblLastName.Text = lastName; lblFirstName.Text = firstName; lblUserID.Text = userID; lblUserType.Text = userType; sysTimer.Interval = 100; sysTimer.Tick += new EventHandler(UpdateSystemTime); sysTimer.Enabled = true; lblAction.Text = "LOG PATIENT"; pnlControl.HorizontalScroll.Enabled = false; pnlControl.HorizontalScroll.Visible = false; } // Class Constructor()
public CtrlLogs(FormStaff formStaff, FormQueue formQueue, MySqlConnection conn, string userID) { InitializeComponent(); this.conn = conn; this.userID = userID; this.formStaff = formStaff; this.formQueue = formQueue; this.patientList = new List <string> [6]; for (int count = 0; count < patientList.GetLength(0); count++) { patientList[count] = new List <string>(); } try { captureDevice = new FilterInfoCollection(FilterCategory.VideoInputDevice); foreach (FilterInfo device in captureDevice) { cboCapture.Items.Add(device.Name); } cboCapture.SelectedIndex = 0; finalFrame = new VideoCaptureDevice(); } catch (Exception ex) { Integrity.GetExceptionDetails(ex); } try { dgvSearch.Rows.Clear(); this.ClearPatientList(); string sql = "SELECT strPatientID, strIDNumber, strPatientLastName, strPatientFirstName, strGender, strPatientContactNumber " + "FROM tblPatient " + "WHERE boolIsActive;"; MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader reader = cmd.ExecuteReader(); int resultCount = 0; while (reader.Read()) { patientList[0].Add(reader.GetString("strPatientID")); patientList[1].Add(reader.GetString("strIDNumber")); patientList[2].Add(reader.GetString("strPatientLastName")); patientList[3].Add(reader.GetString("strPatientFirstName")); patientList[4].Add(reader.GetString("strGender")); patientList[5].Add(reader.GetString("strPatientContactNumber")); dgvSearch.Rows.Add(reader.GetString("strPatientLastName"), reader.GetString("strPatientFirstName"), reader.GetString("strGender"), reader.GetString("strPatientContactNumber")); resultCount++; } reader.Close(); } catch (MySqlException me) { Integrity.GetExceptionDetails(me); } }