Beispiel #1
0
        private void fillCells(String nameQueryS, String cfQueryS)
        {
            int indexRow = 0;//just to know at which row we must write

            this.Patients.Rows.Clear();
            //for each patient, for each visit, write information
            for (int i = 0; i < ps.Count; i++)
            {
                Patient thisP    = ps[i];
                String  thisName = thisP.getName() + " " + thisP.getSurname();
                String  thisCf   = thisP.getCF();
                //MessageBox.Show("thisName: |" + thisName + "| vs |" + nameQueryS + "|" );
                if (cfQueryS.ToUpper() == thisCf.ToUpper() ||
                    strContains(nameQueryS.ToUpper(), thisName.ToUpper()) ||
                    strContains(thisName.ToUpper(), nameQueryS.ToUpper()) ||
                    (nameQueryS == "" && cfQueryS == ""))
                {
                    this.Patients.Rows.Add();//add a row
                    this.Patients.Rows[indexRow].Cells[1].Value = thisP.getId();
                    this.Patients.Rows[indexRow].Cells[2].Value = thisName;
                    this.Patients.Rows[indexRow].Cells[3].Value = thisCf;
                    indexRow++;
                }
            }
        }
Beispiel #2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //e.RowIndex
            int indexRow = e.RowIndex;
            //MessageBox.Show("Click; patient id: " + this.Patients.Rows[indexRow].Cells[3].Value);
            Patient thisPatientToSend = null;

            for (var i = 0; i < ps.Count; i++)
            {
                Patient check = ps[i];
                if (check.getCF() == this.Patients.Rows[indexRow].Cells[3].Value)
                {
                    thisPatientToSend = ps[i];
                }
            }
            AnalyzePatient ap = new AnalyzePatient(thisPatientToSend);

            ap.Show();
            this.Refresh();
        }