Ejemplo n.º 1
0
        public CtrlAddAppt(FormStaff form, MySqlConnection conn, string userID)
        {
            InitializeComponent();

            this.conn        = conn;
            this.userID      = userID;
            this.patientList = new List <string> [6];
            this.doctorList  = new List <string> [5];
            this.form        = form;

            for (int count = 0; count < patientList.GetLength(0); count++)
            {
                patientList[count] = new List <string>();
            }

            for (int count = 0; count < doctorList.GetLength(0); count++)
            {
                doctorList[count] = new List <string>();
            }

            datSchedule.MinDate = DateTime.Now.AddDays(4);
            tmAppointment.Value.AddSeconds(tmAppointment.Value.Second);
            this.CtrlAddAppointment_Load(null, null);
            this.Dock = DockStyle.Top;

            dgvPatient.CellDoubleClick += new DataGridViewCellEventHandler(dgvPatient_CellDoubleClick);
            dgvDoctor.CellDoubleClick  += new DataGridViewCellEventHandler(dgvDoctor_CellDoubleClick);
        }
Ejemplo n.º 2
0
        public FormAdvancedSearch(FormStaff formStaff,
                                  CtrlAddAppt addAppt,
                                  MySqlConnection conn,
                                  int search,
                                  string userID)
        {
            InitializeComponent();

            this.formStaff = formStaff;
            this.windows   = WindowList.Staff;
            this.addAppt   = addAppt;
            this.controls  = ControlsList.Add_Appt;
            this.search    = search;


            if (search == 1)
            {
                this.pnlSearchPat.Visible = true;
                this.pnlSearchDoc.Visible = false;
            }
            else
            {
                this.pnlSearchPat.Visible = false;
                this.pnlSearchDoc.Visible = true;
            }

            this.pnlPatDoc.Visible = false;

            this.conn   = conn;
            this.userID = userID;

            this.UpdateHeader();
        }
Ejemplo n.º 3
0
        private void btnFrontDesk_Click(object sender, EventArgs e)
        {
            FormStaff formStaff = new FormStaff(conn, userID, firstName, lastName, userType);

            formStaff.Show();
            this.Close();
        }
Ejemplo n.º 4
0
        public CtrlCheckAppt(FormStaff form, MySqlConnection conn, string userID)
        {
            InitializeComponent();

            this.conn   = conn;
            this.userID = userID;
            this.form   = form;

            this.appointmentList = new List <string> [13];
            for (int count = 0; count < appointmentList.GetLength(0); count++)
            {
                appointmentList[count] = new List <string>();
            }

            this.btnReset_Click(null, null);
        }
Ejemplo n.º 5
0
        public CtrlPat(FormStaff form, MySqlConnection conn, string userID)
        {
            InitializeComponent();

            this.conn        = conn;
            this.form        = form;
            this.userID      = userID;
            this.patientList = new List <string> [6];

            for (int count = 0; count < patientList.GetLength(0); count++)
            {
                patientList[count] = new List <string>();
            }

            this.Dock = DockStyle.Top;

            FillDGV();
            dgvSearch.CellDoubleClick += new DataGridViewCellEventHandler(dgvSearch_CellDoubleClick);
        }
Ejemplo n.º 6
0
        public FormAdvancedSearch(CtrlDeletePatient delPatient,
                                  MySqlConnection conn,
                                  string userID)
        {
            InitializeComponent();

            this.formStaff  = formStaff;
            this.windows    = WindowList.Staff;
            this.delPatient = delPatient;
            this.controls   = ControlsList.Del_Pat;

            this.pnlSearchPat.Visible = true;
            this.pnlSearchDoc.Visible = false;
            this.pnlPatDoc.Visible    = false;

            this.conn   = conn;
            this.userID = userID;

            this.UpdateHeader();
        }
Ejemplo n.º 7
0
        public CtrlRegi(FormStaff form, MySqlConnection conn, string userID)
        {
            InitializeComponent();

            this.conn   = conn;
            this.userID = userID;

            this.UpdatePatientID();
            this.cboPatType.SelectedIndex = 0;

            this.form = form;

            this.pnlViewPatient.Controls.Clear();
            this.pnlViewPatient.Controls.Add(new CtrlPat(form, conn, userID));

            this.cboGender.SelectedIndex = 0;
            this.cboRegion.SelectedIndex = 0;
            dtpBirthday.MaxDate          = DateTime.Now.AddYears(-4);

            this.pnlToPrint.Location = new Point(-1000, -1000);
        } // Class Constructor
Ejemplo n.º 8
0
        public FormAdvancedSearch(FormStaff formStaff,
                                  CtrlLogs logs,
                                  MySqlConnection conn,
                                  string userID)
        {
            InitializeComponent();

            this.formStaff = formStaff;
            this.windows   = WindowList.Staff;
            this.logs      = logs;
            this.controls  = ControlsList.Logs;

            this.pnlSearchPat.Visible = true;
            this.pnlSearchDoc.Visible = false;
            this.pnlPatDoc.Visible    = false;

            this.conn   = conn;
            this.userID = userID;

            this.UpdateHeader();
        }
Ejemplo n.º 9
0
        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);
            }
        }
Ejemplo n.º 10
0
        } // Action[Click]: btnClear

        private void btnLogIn_Click(object sender, EventArgs e)
        {
            bool isValid = true;

            if (textUsername.Text.Trim().Equals(""))
            {
                MetroMessageBox.Show(this, "Please enter a valid username!");
                isValid = false;
            }
            else if (textPassword.Text.Trim().Equals(""))
            {
                MetroMessageBox.Show(this, "Please enter a valid password!");
                isValid = false;
            }

            if (isValid)
            {
                string sql = "SELECT strLastName, strFirstName, strStaffID, strPositionCode " +
                             "FROM tblStaff " +
                             "WHERE strUserName = @userName AND strPassword = @password AND boolIsActive;";

                try
                {
                    int resultCount = 0;

                    MySqlCommand cmd = new MySqlCommand(sql, conn);

                    /* Prepare statements */
                    cmd.Parameters.AddWithValue("@userName", textUsername.Text.Trim());
                    cmd.Parameters.AddWithValue("@password", textPassword.Text.Trim());
                    cmd.Prepare();

                    reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        firstName    = reader.GetString("strFirstName");
                        lastName     = reader.GetString("strLastName");
                        userID       = reader.GetString("strStaffID");
                        userPosition = reader.GetString("strPositionCode");

                        resultCount++;
                    }

                    reader.Close();

                    if (resultCount == 1)
                    {
                        sql = "SELECT strPositionDescription " +
                              "FROM tblPositionDetails " +
                              "WHERE strPositionCode = @posCode;";

                        cmd = new MySqlCommand(sql, conn);

                        /* Prepare statements */
                        cmd.Parameters.AddWithValue("@posCode", userPosition);
                        cmd.Prepare();

                        reader = cmd.ExecuteReader();

                        while (reader.Read())
                        {
                            userType = reader.GetString("strPositionDescription");
                        }

                        reader.Close();

                        if (userPosition.Equals("FRONTDESK") || userPosition.Equals("DOCT") || userPosition.Equals("ADMIN"))
                        {
                            string loginID = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() +
                                             DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + "";

                            sql = "INSERT INTO tblLogIn(strLogInCode, strStaffID, dtmDateTimeLogged, strDoctStatus) ";

                            if (userPosition.Equals("DOCT"))
                            {
                                sql += "VALUES(@loginID, @userID, NOW(), 'ON');";
                            }
                            else
                            {
                                sql += "VALUES(@loginID, @userID, NOW(), 'OFF');";
                            }

                            cmd             = new MySqlCommand();
                            cmd.Connection  = conn;
                            cmd.CommandText = sql;

                            /* Prepare statements */
                            cmd.Parameters.AddWithValue("@loginID", loginID);
                            cmd.Parameters.AddWithValue("@userID", userID);
                            cmd.Prepare();

                            /* Update time in and time out */
                            cmd.ExecuteNonQuery();

                            if (userPosition.Equals("FRONTDESK"))
                            {
                                FormStaff formStaff = new FormStaff(conn, userID, firstName, lastName, userType);
                                formStaff.Show();
                                this.Close();
                            }
                            else if (userPosition.Equals("DOCT"))
                            {
                                FormDoctor formDoctor = new FormDoctor(conn, userID, firstName, lastName, userType);
                                formDoctor.Show();
                                this.Close();
                            }
                            else
                            {
                                FormSelection formSelect = new FormSelection(conn, userID, firstName, lastName, userType);
                                formSelect.Show();
                                this.Close();
                            }
                        }
                        else
                        {
                            Integrity.ShowInvalidTypeDialog();
                        }
                    }
                    else if (resultCount >= 2)
                    {
                        Integrity.ShowDuplicateDialog();
                    }
                    else
                    {
                        MetroMessageBox.Show(this,
                                             "Invalid Username / Password!",
                                             "Access Denied",
                                             MessageBoxButtons.OK,
                                             MessageBoxIcon.Error);
                    }
                }
                catch (MySqlException me)
                {
                    Integrity.GetExceptionDetails(me);
                }
            }
        } // Action[Click]: btnLogIn