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); } }
public void fillViewInformation(patientFull data) { surnameTextBox.Text = data.surname; nameTextBox.Text = data.name; middlenameTextBox.Text = data.middlename; fillSurveysDataGridView(data); }
public MedRegistratorPatientService(int id) { _repository = repository; _patient = copyPatient(_repository.getPatientFullDatabase(id)); _newPatient = false; _succesfullPatientInfoSaving = false; }
public MedRegistratorPatientService() { _repository = repository; _patient = new patientFull(); _patient.surveys = new List <patientFull.Survey>(); _newPatient = true; _succesfullPatientInfoSaving = false; }
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); }
//Function that adds new informarion to database public void add(patientFull data) { database.Add(data); }
public DoctorPatientService(int id) { _repository = repository; _patient = copyPatient(_repository.getPatientFullDatabase(id)); }