private int calculateSurveyId(String date, String type, patientFull.Survey.Sensors sensors) { int dateHash; int typeHash; int sensorsHash; try { dateHash = date.GetHashCode(); } catch { dateHash = 0; } try { typeHash = type.GetHashCode(); } catch { typeHash = 0; } try { sensorsHash = sensors.GetHashCode(); } catch { sensorsHash = 0; } return(dateHash + typeHash + sensorsHash); }
public void createSurvey(String date, String type, patientFull.Survey.Sensors sensors) { patientFull.Survey newSurvey; newSurvey.id = calculateSurveyId(date, type, sensors); newSurvey.date = date; newSurvey.type = type; newSurvey.sensors = sensors; _patient.surveys.Add(newSurvey); }
public void changeSurvey(int id, String date, String type, patientFull.Survey.Sensors sensors) { patientFull.Survey surveyToChange; surveyToChange.id = id; surveyToChange.date = date; surveyToChange.type = type; surveyToChange.sensors = sensors; try { _patient.surveys[searchSurveyForIndex(id)] = surveyToChange; } catch { Console.WriteLine("MedRegistratorPatientServiceError: indexError"); } }
private void calculate_checkBoxValue(patientFull.Survey.Sensors data) { _checkBoxCounter.setNullValue(); if (data.sensor1 == true) { _checkBoxCounter.changeValueCheckBox(1); } if (data.sensor2 == true) { _checkBoxCounter.changeValueCheckBox(2); } if (data.sensor3 == true) { _checkBoxCounter.changeValueCheckBox(3); } if (data.sensor4 == true) { _checkBoxCounter.changeValueCheckBox(4); } if (data.sensor5 == true) { _checkBoxCounter.changeValueCheckBox(5); } }