コード例 #1
0
        private void fillSurveysDataGridView(patientFull data)
        {
            surveysDataGridView.Columns.Add("column0", "ID");
            surveysDataGridView.Columns.Add("column1", "Survey");
            surveysDataGridView.Columns.Add("column2", "Date");
            int arrayLength = data.surveys.Count <patientFull.Survey>();

            DataGridViewRow[] rows = new DataGridViewRow[arrayLength];
            for (int j = 0; j < arrayLength; j++)
            {
                DataGridViewRow row = new DataGridViewRow();
                rows[j] = row;
                row.CreateCells(surveysDataGridView);
            }
            int i = 0;

            foreach (patientFull.Survey element in data.surveys)
            {
                rows[i].Cells[0].Value = element.id.ToString();
                rows[i].Cells[1].Value = element.type;
                rows[i].Cells[2].Value = element.date;
                i++;
            }
            foreach (DataGridViewRow row in rows)
            {
                surveysDataGridView.Rows.Add(row);
            }
        }
コード例 #2
0
 public void fillViewInformation(patientFull data)
 {
     surnameTextBox.Text    = data.surname;
     nameTextBox.Text       = data.name;
     middlenameTextBox.Text = data.middlename;
     fillSurveysDataGridView(data);
 }
コード例 #3
0
 public MedRegistratorPatientService(int id)
 {
     _repository = repository;
     _patient    = copyPatient(_repository.getPatientFullDatabase(id));
     _newPatient = false;
     _succesfullPatientInfoSaving = false;
 }
コード例 #4
0
 public MedRegistratorPatientService()
 {
     _repository                  = repository;
     _patient                     = new patientFull();
     _patient.surveys             = new List <patientFull.Survey>();
     _newPatient                  = true;
     _succesfullPatientInfoSaving = false;
 }
コード例 #5
0
        private patientFull copyPatient(patientFull toCopy)
        {
            patientFull toReturn = new patientFull();

            toReturn.id         = toCopy.id;
            toReturn.surname    = toCopy.surname;
            toReturn.name       = toCopy.name;
            toReturn.middlename = toCopy.middlename;
            toReturn.surveys    = new List <patientFull.Survey>();
            foreach (var element in toCopy.surveys)
            {
                toReturn.surveys.Add(element);
            }
            return(toReturn);
        }
コード例 #6
0
 //Function that adds new informarion to database
 public void add(patientFull data)
 {
     database.Add(data);
 }
コード例 #7
0
 public DoctorPatientService(int id)
 {
     _repository = repository;
     _patient    = copyPatient(_repository.getPatientFullDatabase(id));
 }