Ejemplo n.º 1
0
        public locationForm()
        {
            InitializeComponent();
            this.ControlBox = false;
            patient = PimsMain.Program.currentPatient;
            user = PimsMain.Program.currentUser;

            floorBox.Text = patient.directory.location.floor;
            unitBox.Text = patient.directory.location.unit;
            bedBox.Text = patient.directory.location.bedNum;
            roomBox.Text = patient.directory.location.roomNum;

            foreach (Control ctrl in this.Controls)
            {
                if(ctrl is TextBox && ctrl.Name != "searchBox")
                {
                    ((TextBox)ctrl).ReadOnly = true;
                    ((TextBox)ctrl).BackColor = SystemColors.Control;
                }
            }
            if(!(user is PIMSController.OfficeStaff))
            {
                fileToolStripMenuItem1.Enabled = false;
            }
        }
Ejemplo n.º 2
0
        public billingGrid(bool summary)
        {
            InitializeComponent();
            this.ControlBox = false;
            patient = PimsMain.Program.currentPatient;
            user = PimsMain.Program.currentUser;
            int costSum = 0;
            int insPaidSum = 0;
            int paidSum = 0;
            int owedSum = 0;

            if (!(user is PIMSController.OfficeStaff))
            {
                fileToolStripMenuItem.Enabled = false;
            }

            foreach (PIMSController.BillingLineItem item in patient.billing.items)
            {
                int owed = item.cost - item.insPaid - item.paid;
                owedSum += owed;
                costSum += item.cost;
                insPaidSum += item.insPaid;
                paidSum += item.paid;

            }
            DGV.Rows.Add("Totals", null,
                          Math.Round(((float)costSum / 100.0), 2),
                          Math.Round(((float)insPaidSum / 100.0), 2),
                          Math.Round(((float)paidSum / 100.0), 2),
                          Math.Round(((float)owedSum / 100.0), 2));

        }
Ejemplo n.º 3
0
        public insuranceForm()
        {
            InitializeComponent();
            this.ControlBox = false;
            patient = PimsMain.Program.currentPatient;
            user = PimsMain.Program.currentUser;
            button1.Hide();
            foreach(Control ctrl in this.Controls)
            {
               if (ctrl is TextBox && ctrl.Name != "textBox1")
               {
                  ((TextBox)ctrl).ReadOnly = true;
                  ((TextBox)ctrl).BackColor = SystemColors.Control;
               }
            }
            ProviderBox.Text = patient.billing.insurance.provider;
            binBox.Text = patient.billing.insurance.bin;
            pcnBox.Text = patient.billing.insurance.pcn;
            groupBox.Text = patient.billing.insurance.groupNum;
            idBox.Text = patient.billing.insurance.id;

            if(!(user is PIMSController.OfficeStaff))
            {
                fileToolStripMenuItem1.Enabled = false;
            }

        }
Ejemplo n.º 4
0
        public patientForm()
        {
            InitializeComponent();
            this.ControlBox = false;
            curUser = PimsMain.Program.currentUser;
            patient = PimsMain.Program.currentPatient;

            if (curUser is PIMSController.Doctor ||
                curUser is PIMSController.MedStaff)
            {
                editToolStripMenuItem.Enabled = false;
                treatmentToolStripMenuItem.Enabled = true;
                billingToolStripMenuItem.Enabled = true;
                button1.Visible = false;
            }
            else if(curUser is PIMSController.OfficeStaff)
            {
                editToolStripMenuItem.Enabled = true;
                treatmentToolStripMenuItem.Enabled = false;
                billingToolStripMenuItem.Enabled = true;
            }
            else
            {
                // Shouldn't ever happen, but just in case
                MessageBox.Show("Invalid User! Closing Program",
                     "Invalid User", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }

            // currentPatient = patient;
           // currentPatient = PimsMain.Program.currentPatient;
            foreach(Control ctrl in this.Controls)
            {
                if (ctrl is TextBox && ctrl != queryBar)
                {
                    ((TextBox)ctrl).ReadOnly = true;
                    ((TextBox)ctrl).BackColor = SystemColors.Control;
                }
            }

            this.lastNameTextBox.Text = patient.directory.lName;
            this.firstNameTextBox.Text = patient.directory.fName;
            this.middleNameTextBox.Text = patient.directory.mName;
            this.dobTextBox.Text = patient.directory.DOB.ToString(@"MM\/dd\/yyyy");
            if (patient.directory.gender)
                this.genderTextBox.Text = "M";
            else
                this.genderTextBox.Text = "F";
            this.addressTextBox.Text = patient.directory.strAddress;
            this.cityTextBox.Text = patient.directory.city;
            this.stateTextBox.Text = patient.directory.state;
            this.zipTextBox.Text = patient.directory.zip;
            this.primaryPhoneTextBox.Text = patient.directory.phoneNum1;
            this.secondaryPhoneTextBox.Text = patient.directory.phoneNum2;
            this.contactName1TextBox.Text = patient.directory.emerContact1.name;
            this.contactPhone1TextBox.Text = patient.directory.emerContact1.phoneNum;
            this.contactName2TextBox.Text = patient.directory.emerContact2.name;
            this.contactPhone2TextBox.Text = patient.directory.emerContact2.phoneNum;
        }
Ejemplo n.º 5
0
        public AddProcedureForm()
        {
            InitializeComponent();
            this.ControlBox = false;

            patient = PimsMain.Program.currentPatient;
            user = PimsMain.Program.currentUser;

        }
Ejemplo n.º 6
0
        public patientForm(bool isNew)
       {
            InitializeComponent();
            this.ControlBox = false;
            curUser = PimsMain.Program.currentUser;
            patient = new PIMSController.Patient();
            PimsMain.Program.currentPatient = patient;


        }
Ejemplo n.º 7
0
        public prescriptionGrid()
        {
            InitializeComponent();
            this.ControlBox = false;

            user = PimsMain.Program.currentUser;
            patient = PimsMain.Program.currentPatient;

            foreach(PIMSController.PrescDrug drug in patient.treatment.prescriptions.prescriptions)
            {
                DGV.Rows.Add(drug.id, drug.name, drug.ndc, drug.cost, drug.dateFilled.ToString(@"MM\/dd\/yyyy"));
            }
        }
Ejemplo n.º 8
0
 // Will add the rows to the resultsDataGridView
 private void addRows(PIMSController.Patient myPatient)
 {
     resultsDataGridView.Rows.Add(null,
                                  myPatient.directory.patientID,
                                  myPatient.directory.lName,
                                  myPatient.directory.fName,
                                  myPatient.directory.mName,
                                  myPatient.directory.DOB.ToString(@"MM\/dd\/yyyy"),
                                  myPatient.directory.gender ? "M" : "F",
                                  myPatient.directory.location.roomNum,
                                  myPatient.directory.location.bedNum,
                                  myPatient.directory.location.unit,
                                  Convert.ToBoolean(myPatient.directory.location.bedNum) ? "Y" : "N");
 }
Ejemplo n.º 9
0
        public SchedProcForm()
        {
            InitializeComponent();
            this.ControlBox = false;

            patient = PimsMain.Program.currentPatient;
            user = PimsMain.Program.currentUser;

            foreach (PIMSController.MedProcedure proc in patient.treatment.procedures)
            {
                dataGridView1.Rows.Add(proc.what, proc.when.ToString("f"),
                                       proc.who, proc.where);

            }
        }
Ejemplo n.º 10
0
        private void button2_Click(object sender, EventArgs e)
        {
            string currentID = "";
            int    count     = 0;

            // make sure just 1 is selected since it wont take radio buttons
            foreach (DataGridViewRow row in volDGV.Rows)
            {
                if (row.Cells[0].Value != null && row.Cells[0].Value.Equals("true"))
                {
                    count++;
                    currentID = row.Cells[1].Value.ToString();
                }
            }
            if (count == 0)
            {
                MessageBox.Show("Please select a patient.",
                                "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (count != 1)
            {
                MessageBox.Show("Please select only one patient.",
                                "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                foreach (PIMSController.Patient myPatient in patients)
                {
                    if (currentID != null && myPatient.directory.patientID == currentID)
                    {
                        selectedPatient = myPatient;
                    }
                }
                if (selectedPatient != null)
                {
                    PimsMain.Program.currentPatient = selectedPatient;
                    visitorsGrid visitors = new visitorsGrid();
                    visitors.Visible = true;
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Selection Error, Please try again.",
                                    "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 11
0
        public nurseNotes()
        {
            InitializeComponent();
            this.ControlBox = false;

            user = PimsMain.Program.currentUser;
            patient = PimsMain.Program.currentPatient;

            updateStatDisplay();
            allergiesTextBox.Text = patient.treatment.medStaffNotes.allergies;
            notesTextBox.Text = patient.treatment.medStaffNotes.nurseNotes;

            if(user is PIMSController.MedStaff)
            {
                foreach (Control ctrl in this.Controls)
                {
                    if (ctrl is TextBox && ctrl != searchBox)
                    {
                        ((TextBox)ctrl).ReadOnly = false;
                        ((TextBox)ctrl).BackColor = SystemColors.Window;
                    }
                    if(ctrl is Button)
                    {
                        ((Button)ctrl).Visible = false;
                    }
                }
            }
            else
            {
                foreach (Control ctrl in this.Controls)
                {
                    if (ctrl is TextBox && ctrl != searchBox)
                    {
                        ((TextBox)ctrl).ReadOnly = true;
                        ((TextBox)ctrl).BackColor = SystemColors.Control;
                        button2.Enabled = false;
                        updateAllergiesButton.Enabled = false;
                        updateNurseNotesButton.Enabled = false;
                        button2.Visible = false;
                        updateNurseNotesButton.Visible = false;
                        updateAllergiesButton.Visible = false;
                    }
                }
            }
        }
Ejemplo n.º 12
0
        public nurseNotes()
        {
            InitializeComponent();
            this.ControlBox = false;

            user    = PimsMain.Program.currentUser;
            patient = PimsMain.Program.currentPatient;

            updateStatDisplay();
            allergiesTextBox.Text = patient.treatment.medStaffNotes.allergies;
            notesTextBox.Text     = patient.treatment.medStaffNotes.nurseNotes;

            if (user is PIMSController.MedStaff)
            {
                foreach (Control ctrl in this.Controls)
                {
                    if (ctrl is TextBox && ctrl != searchBox)
                    {
                        ((TextBox)ctrl).ReadOnly  = false;
                        ((TextBox)ctrl).BackColor = SystemColors.Window;
                    }
                    if (ctrl is Button)
                    {
                        ((Button)ctrl).Visible = false;
                    }
                }
            }
            else
            {
                foreach (Control ctrl in this.Controls)
                {
                    if (ctrl is TextBox && ctrl != searchBox)
                    {
                        ((TextBox)ctrl).ReadOnly       = true;
                        ((TextBox)ctrl).BackColor      = SystemColors.Control;
                        button2.Enabled                = false;
                        updateAllergiesButton.Enabled  = false;
                        updateNurseNotesButton.Enabled = false;
                        button2.Visible                = false;
                        updateNurseNotesButton.Visible = false;
                        updateAllergiesButton.Visible  = false;
                    }
                }
            }
        }
Ejemplo n.º 13
0
        public doctorNotesForm()
        {
            InitializeComponent();
            this.ControlBox = false;

            user    = PimsMain.Program.currentUser;
            patient = PimsMain.Program.currentPatient;

            if (user is PIMSController.Doctor)
            {
                docNotesTextBox.ReadOnly = false;
            }
            else
            {
                docNotesTextBox.ReadOnly = true;
            }
            docNotesTextBox.Text = patient.treatment.docNotes;
        }
Ejemplo n.º 14
0
        public doctorNotesForm()
        {
            InitializeComponent();
            this.ControlBox = false;

            user    = PimsMain.Program.currentUser;
            patient = PimsMain.Program.currentPatient;

            if (user is PIMSController.Doctor)
            {
                docNotesTextBox.ReadOnly = false;
            }
            else
            {
                docNotesTextBox.ReadOnly = true;
            }
            docNotesTextBox.Text = patient.treatment.docNotes;
        }
Ejemplo n.º 15
0
        private void button1_Click(object sender, EventArgs e)
        {
            string currentID = "";
            int count = 0;
            // make sure just 1 is selected since it wont take radio buttons
            foreach (DataGridViewRow row in patientQueryDataGridView.Rows)
            {
                if (row.Cells[0].Value != null && row.Cells[0].Value.Equals("true"))
                {
                    count++;
                    currentID = row.Cells[1].Value.ToString();
                }
            }
            if (count == 0)
            {
                MessageBox.Show("Please select a patient.",
                    "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (count != 1)
            {
                MessageBox.Show("Please select only one patient.",
                    "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                foreach (PIMSController.Patient myPatient in patients)
                {
                    if(currentID != null && myPatient.directory.patientID == currentID)
                    {
                        selectedPatient = myPatient;
                    }
                }

                // open patient grid
                
                PimsMain.Program.currentPatient = PIMSController.SQLcommands.buildPatient(selectedPatient.directory.patientID);
                patientForm myPatientForm = new patientForm();
                myPatientForm.Visible = true;
                // hide this one
                this.Hide();

            }

        }
Ejemplo n.º 16
0
        private void button1_Click(object sender, EventArgs e)
        {
            string currentID = "";
            int    count     = 0;

            // make sure just 1 is selected since it wont take radio buttons
            foreach (DataGridViewRow row in patientQueryDataGridView.Rows)
            {
                if (row.Cells[0].Value != null && row.Cells[0].Value.Equals("true"))
                {
                    count++;
                    currentID = row.Cells[1].Value.ToString();
                }
            }
            if (count == 0)
            {
                MessageBox.Show("Please select a patient.",
                                "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (count != 1)
            {
                MessageBox.Show("Please select only one patient.",
                                "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                foreach (PIMSController.Patient myPatient in patients)
                {
                    if (currentID != null && myPatient.directory.patientID == currentID)
                    {
                        selectedPatient = myPatient;
                    }
                }

                // open patient grid

                PimsMain.Program.currentPatient = PIMSController.SQLcommands.buildPatient(selectedPatient.directory.patientID);
                patientForm myPatientForm = new patientForm();
                myPatientForm.Visible = true;
                // hide this one
                this.Hide();
            }
        }
Ejemplo n.º 17
0
        private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            string currentID = "";
            int    count     = 0;

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Cells[0].Value != null && row.Cells[0].Value.Equals("true"))
                {
                    count++;
                    currentID = row.Cells[1].Value.ToString();
                }
            }
            if (count == 0)
            {
                MessageBox.Show("Please select a patient.",
                                "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (count != 1)
            {
                MessageBox.Show("Please select only one patient.",
                                "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                foreach (PIMSController.Patient myPatient in patients)
                {
                    if (currentID != null && myPatient.directory.patientID == currentID)
                    {
                        selectedPatient = myPatient;
                    }
                }

                Program.currentPatient = PIMSController.SQLcommands.buildPatient(selectedPatient.directory.patientID);

                // Clear contents of Panel1
                Program.myForm.splitContainer1.Panel1.Controls.Clear();
                // Add VolunteerLeftSideButtons to Panel1
                Program.myForm.splitContainer1.Panel1.Controls.Add(new VolunteerLeftSideButtons());
            }
        }
Ejemplo n.º 18
0
        PIMSController.PrintInfo document = new PIMSController.PrintInfo(); //instantiate new printInfo object to print page
        public billingGrid()
        {
            InitializeComponent();
            this.ControlBox = false;
            patient         = PimsMain.Program.currentPatient;
            user            = PimsMain.Program.currentUser;
            int costSum    = 0;
            int insPaidSum = 0;
            int paidSum    = 0;
            int owedSum    = 0;

            Console.WriteLine("billing grid constructer!");
            if (!(user is PIMSController.OfficeStaff))
            {
                fileToolStripMenuItem.Enabled = false;
            }
            int i = 0;

            foreach (PIMSController.BillingLineItem item in patient.billing.items)
            {
                Console.WriteLine(i++);
                int owed = item.cost - item.insPaid - item.paid;
                owedSum    += owed;
                costSum    += item.cost;
                insPaidSum += item.insPaid;
                paidSum    += item.paid;
                DGV.Rows.Add(item.item,
                             item.dueDate.ToString(@"MM\/dd\/yyyy"),
                             Math.Round(((float)item.cost / 100.0), 2),
                             Math.Round(((float)item.insPaid / 100.0), 2),
                             Math.Round(((float)item.paid / 100.0), 2),
                             Math.Round(((float)owed / 100.0), 2));
            }
            DGV.Rows.Add("Totals", null,
                         Math.Round(((float)costSum / 100.0), 2),
                         Math.Round(((float)insPaidSum / 100.0), 2),
                         Math.Round(((float)paidSum / 100.0), 2),
                         Math.Round(((float)owedSum / 100.0), 2));
        }
Ejemplo n.º 19
0
        PIMSController.PrintInfo document = new PIMSController.PrintInfo(); //instantiate new printInfo object to print page
        public billingGrid()
        {
            InitializeComponent();
            this.ControlBox = false;
            patient = PimsMain.Program.currentPatient;
            user = PimsMain.Program.currentUser;
            int costSum = 0;
            int insPaidSum= 0;
            int paidSum = 0;
            int owedSum = 0;
            Console.WriteLine("billing grid constructer!");
            if(!(user is PIMSController.OfficeStaff))
            {
                fileToolStripMenuItem.Enabled = false;
            }
            int i = 0;
            foreach(PIMSController.BillingLineItem item in patient.billing.items)
            {
                Console.WriteLine(i++);
                int owed = item.cost - item.insPaid - item.paid;
                owedSum += owed;
                costSum += item.cost;
                insPaidSum += item.insPaid;
                paidSum += item.paid;
                DGV.Rows.Add(item.item, 
                             item.dueDate.ToString(@"MM\/dd\/yyyy"),
                             Math.Round(((float)item.cost/ 100.0),2),
                             Math.Round(((float)item.insPaid / 100.0),2),
                             Math.Round(((float)item.paid / 100.0),2),
                             Math.Round(((float)owed / 100.0),2));
                              
            }
            DGV.Rows.Add("Totals", null,
                          Math.Round(((float)costSum / 100.0), 2),
                          Math.Round(((float)insPaidSum / 100.0), 2),
                          Math.Round(((float)paidSum / 100.0), 2),
                          Math.Round(((float)owedSum / 100.0), 2));

        }
Ejemplo n.º 20
0
        private void button1_Click(object sender, EventArgs e)
        {
            PIMSController.Patient patient = PimsMain.Program.currentPatient;

            patient.directory.lName = lastNameTextBox.Text;
            patient.directory.fName = firstNameTextBox.Text;
            patient.directory.mName = middleNameTextBox.Text;
            patient.directory.DOB   = Convert.ToDateTime(dobTextBox.Text);
            if (patient.directory.gender)
            {
                this.genderTextBox.Text = "M";
            }
            else
            {
                this.genderTextBox.Text = "F";
            }
            if (genderTextBox.Text.ToUpper() == "M")
            {
                patient.directory.gender = true;
            }
            else if (genderTextBox.Text.ToUpper() == "F")
            {
                patient.directory.gender = false;
            }
            patient.directory.strAddress = addressTextBox.Text;
            patient.directory.city       = cityTextBox.Text;
            patient.directory.state      = stateTextBox.Text;
            patient.directory.zip        = zipTextBox.Text;
            patient.directory.phoneNum1  = primaryPhoneTextBox.Text;

            patient.directory.phoneNum2             = secondaryPhoneTextBox.Text;
            patient.directory.emerContact1.name     = contactName1TextBox.Text;
            patient.directory.emerContact1.phoneNum = contactPhone1TextBox.Text;
            patient.directory.emerContact2.name     = contactName2TextBox.Text;
            patient.directory.emerContact2.phoneNum = contactPhone2TextBox.Text;

            PIMSController.SQLcommands.updatePatient(patient);
        }
Ejemplo n.º 21
0
        public visitorsGrid()
        {
            InitializeComponent();
            this.ControlBox = false;
            patient = PimsMain.Program.currentPatient;
            user = PimsMain.Program.currentUser;

            foreach (PIMSController.Visitor visitor in patient.directory.visitors)
            {
                dgv.Rows.Add(null, visitor.name);
            }
            if (user is PIMSController.Volunteer)
            {
                treatmentToolStripMenuItem.Enabled = false;
                billingToolStripMenuItem.Enabled = false;
                directoryToolStripMenuItem.Enabled = false;
                button1.Visible = false;
                button2.Visible = false;
                nameBox.Visible = false;

            }
            else
            {
                volunteerGridToolStripMenuItem.Enabled = false;
            }
            if(user is PIMSController.OfficeStaff)
            {
                treatmentToolStripMenuItem.Enabled = false;
            }
            if(user is PIMSController.Doctor || user is PIMSController.MedStaff)
            {
                button1.Visible = false;
                button2.Visible = false;
                nameBox.Visible = false;
            }
        }
Ejemplo n.º 22
0
 public doctorsNotesGrid(PIMSController.Patient patient)
 {
     InitializeComponent();
 }
Ejemplo n.º 23
0
        // The cell was selected
        private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            string currentID = "";
            int count = 0;

            foreach (DataGridViewRow row in resultsDataGridView.Rows)
            {
                if (row.Cells[0].Value != null && row.Cells[0].Value.Equals("true"))
                {
                    count++;
                    currentID = row.Cells[1].Value.ToString();
                }
            }
            if (count == 0)
            {
                // Display error message
                MessageBox.Show("Please select a patient.",
                    "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (count != 1)
            {
                // Display error message
                MessageBox.Show("Please select only one patient.",
                    "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                foreach (PIMSController.Patient myPatient in patients)
                {
                    if (currentID != null && myPatient.directory.patientID == currentID)
                    {
                        selectedPatient = myPatient;
                    }
                }

                Program.currentPatient = PIMSController.SQLcommands.buildPatient(selectedPatient.directory.patientID);

                if (Program.currentUser is PIMSController.OfficeStaff)
                {
                    // Clear contents of Panel1
                    Program.myForm.splitContainer1.Panel1.Controls.Clear();
                    // Add LeftSideButtons to Panel2
                    Program.myForm.splitContainer1.Panel1.Controls.Add(Program.officeStaffLeftSideButton);

                    // Call the addGroupBoxText function in officeStaffLeftSideButton
                    Program.officeStaffLeftSideButton.addGroupBoxText();
                }
                else
                {
                    // Clear contents of Panel1
                    Program.myForm.splitContainer1.Panel1.Controls.Clear();
                    // Add LeftSideButtons to Panel2
                    Program.myForm.splitContainer1.Panel1.Controls.Add(Program.leftSideButton);

                    // Call the addGroupBoxText function in leftSideButton
                    Program.leftSideButton.addGroupBoxText();
                }
            }
        }
Ejemplo n.º 24
0
        public patientForm()
        {
            InitializeComponent();
            this.ControlBox = false;
            curUser         = PimsMain.Program.currentUser;
            patient         = PimsMain.Program.currentPatient;

            if (curUser is PIMSController.Doctor ||
                curUser is PIMSController.MedStaff)
            {
                editToolStripMenuItem.Enabled      = false;
                treatmentToolStripMenuItem.Enabled = true;
                billingToolStripMenuItem.Enabled   = true;
                button1.Visible = false;
            }
            else if (curUser is PIMSController.OfficeStaff)
            {
                editToolStripMenuItem.Enabled      = true;
                treatmentToolStripMenuItem.Enabled = false;
                billingToolStripMenuItem.Enabled   = true;
            }
            else
            {
                // Shouldn't ever happen, but just in case
                MessageBox.Show("Invalid User! Closing Program",
                                "Invalid User", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }

            // currentPatient = patient;
            // currentPatient = PimsMain.Program.currentPatient;
            foreach (Control ctrl in this.Controls)
            {
                if (ctrl is TextBox && ctrl != queryBar)
                {
                    ((TextBox)ctrl).ReadOnly  = true;
                    ((TextBox)ctrl).BackColor = SystemColors.Control;
                }
            }

            this.lastNameTextBox.Text   = patient.directory.lName;
            this.firstNameTextBox.Text  = patient.directory.fName;
            this.middleNameTextBox.Text = patient.directory.mName;
            this.dobTextBox.Text        = patient.directory.DOB.ToString(@"MM\/dd\/yyyy");
            if (patient.directory.gender)
            {
                this.genderTextBox.Text = "M";
            }
            else
            {
                this.genderTextBox.Text = "F";
            }
            this.addressTextBox.Text        = patient.directory.strAddress;
            this.cityTextBox.Text           = patient.directory.city;
            this.stateTextBox.Text          = patient.directory.state;
            this.zipTextBox.Text            = patient.directory.zip;
            this.primaryPhoneTextBox.Text   = patient.directory.phoneNum1;
            this.secondaryPhoneTextBox.Text = patient.directory.phoneNum2;
            this.contactName1TextBox.Text   = patient.directory.emerContact1.name;
            this.contactPhone1TextBox.Text  = patient.directory.emerContact1.phoneNum;
            this.contactName2TextBox.Text   = patient.directory.emerContact2.name;
            this.contactPhone2TextBox.Text  = patient.directory.emerContact2.phoneNum;
        }
Ejemplo n.º 25
0
 private void button2_Click(object sender, EventArgs e)
 {
     string currentID = "";
     int count = 0;
     // make sure just 1 is selected since it wont take radio buttons
     foreach (DataGridViewRow row in volDGV.Rows)
     {
         if (row.Cells[0].Value != null && row.Cells[0].Value.Equals("true"))
         {
             count++;
             currentID = row.Cells[1].Value.ToString();
         }
     }
     if (count == 0)
     {
         MessageBox.Show("Please select a patient.",
             "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if (count != 1)
     {
         MessageBox.Show("Please select only one patient.",
             "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         foreach (PIMSController.Patient myPatient in patients)
         {
             if (currentID != null && myPatient.directory.patientID == currentID)
             {
                 selectedPatient = myPatient;
             }
         }
         if (selectedPatient != null)
         {
             PimsMain.Program.currentPatient = selectedPatient;
             visitorsGrid visitors = new visitorsGrid();
             visitors.Visible = true;
             this.Hide();
         }
         else
         {
             MessageBox.Show("Selection Error, Please try again.",
             "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Ejemplo n.º 26
0
        private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            string currentID = "";
            int count = 0;

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Cells[0].Value != null && row.Cells[0].Value.Equals("true"))
                {
                    count++;
                    currentID = row.Cells[1].Value.ToString();
                }
            }
            if (count == 0)
            {
                MessageBox.Show("Please select a patient.",
                    "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (count != 1)
            {
                MessageBox.Show("Please select only one patient.",
                    "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                foreach (PIMSController.Patient myPatient in patients)
                {
                    if (currentID != null && myPatient.directory.patientID == currentID)
                    {
                        selectedPatient = myPatient;
                    }
                }

                Program.currentPatient = PIMSController.SQLcommands.buildPatient(selectedPatient.directory.patientID);

                // Clear contents of Panel1
                Program.myForm.splitContainer1.Panel1.Controls.Clear();
                // Add VolunteerLeftSideButtons to Panel1
                Program.myForm.splitContainer1.Panel1.Controls.Add(new VolunteerLeftSideButtons());
            }
        }