public MainViewModel() { tabVMDict = new SortedDictionary <int, TabVM>(); tabVMDict[PatientTabIndex] = new PatientTabVM(); tabVMDict[PureToneTabIndex] = new PureToneTabVM(); tabVMDict[SpeechTabIndex] = new SpeechTabVM(); tabVMDict[ImpedanceTabIndex] = new ImpedanceTabVM(); tabVMDict[BithermalCaloricTabIndex] = new BithermalCaloricTabVM(); TabVMs = new ObservableCollection <TabVM>(tabVMDict.Values); Patient = (PatientTabVM)tabVMDict[PatientTabIndex]; }
public override void OpenRecordFromDatabase(string accNumber, string examDate) { string query = "SELECT * FROM " + dbTable + " WHERE AccNumber = '" + accNumber + "' AND DateOfExam = '" + examDate + "'"; SQLiteCommand readCmd = new SQLiteCommand(query, DatabaseInfo.SqliteCon); SQLiteDataReader reader = readCmd.ExecuteReader(); if (reader.Read()) { ImpedanceTabVM impViewModel = (ImpedanceTabVM)viewmodel; impViewModel.IsImpedanceTestConducted = Convert.ToBoolean(reader.GetString(isTestConductedCol.Index)); impViewModel.RtEarComplianceNeg400daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(compNeg400RtEarCol.Index)); impViewModel.LtEarComplianceNeg400daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(compNeg400LtEarCol.Index)); impViewModel.RtEarComplianceNeg300daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(compNeg300RtEarCol.Index)); impViewModel.LtEarComplianceNeg300daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(compNeg300LtEarCol.Index)); impViewModel.RtEarComplianceNeg200daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(compNeg200RtEarCol.Index)); impViewModel.LtEarComplianceNeg200daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(compNeg200LtEarCol.Index)); impViewModel.RtEarComplianceNeg100daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(compNeg100RtEarCol.Index)); impViewModel.LtEarComplianceNeg100daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(compNeg100LtEarCol.Index)); impViewModel.RtEarCompliance0daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp0RtEarCol.Index)); impViewModel.LtEarCompliance0daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp0LtEarCol.Index)); impViewModel.RtEarCompliance100daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp100RtEarCol.Index)); impViewModel.LtEarCompliance100daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp100LtEarCol.Index)); impViewModel.RtEarCompliance200daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp200RtEarCol.Index)); impViewModel.LtEarCompliance200daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp200LtEarCol.Index)); impViewModel.RtEarCompliance300daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp300RtEarCol.Index)); impViewModel.LtEarCompliance300daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp300LtEarCol.Index)); impViewModel.RtEarCompliance400daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp400RtEarCol.Index)); impViewModel.LtEarCompliance400daPa = NullDoubleHelper.ToNullableDouble(reader.GetString(comp400LtEarCol.Index)); impViewModel.RtEarPeakPressure = NullDoubleHelper.ToNullableDouble(reader.GetString(peakPresRtEarCol.Index)); impViewModel.LtEarPeakPressure = NullDoubleHelper.ToNullableDouble(reader.GetString(peakPresLtEarCol.Index)); impViewModel.RtEarCanalVolume = NullDoubleHelper.ToNullableDouble(reader.GetString(earCnlVolRtEarCol.Index)); impViewModel.LtEarCanalVolume = NullDoubleHelper.ToNullableDouble(reader.GetString(earCnlVolLtEarCol.Index)); impViewModel.RtEarCurveType = (ImpedanceTabVM.TympanogramType)Enum.Parse(typeof(ImpedanceTabVM.TympanogramType), reader.GetString(curveRtEarCol.Index)); impViewModel.LtEarCurveType = (ImpedanceTabVM.TympanogramType)Enum.Parse(typeof(ImpedanceTabVM.TympanogramType), reader.GetString(curveLtEarCol.Index)); impViewModel.RtEarAcousticReflex500Hz = (ImpedanceTabVM.AcousticReflexType)Enum.Parse(typeof(ImpedanceTabVM.AcousticReflexType), reader.GetString(acRf500RtEarCol.Index)); impViewModel.LtEarAcousticReflex500Hz = (ImpedanceTabVM.AcousticReflexType)Enum.Parse(typeof(ImpedanceTabVM.AcousticReflexType), reader.GetString(acRf500LtEarCol.Index)); impViewModel.RtEarAcousticReflex1000Hz = (ImpedanceTabVM.AcousticReflexType)Enum.Parse(typeof(ImpedanceTabVM.AcousticReflexType), reader.GetString(acRf1000RtEarCol.Index)); impViewModel.LtEarAcousticReflex1000Hz = (ImpedanceTabVM.AcousticReflexType)Enum.Parse(typeof(ImpedanceTabVM.AcousticReflexType), reader.GetString(acRf1000LtEarCol.Index)); impViewModel.RtEarAcousticReflex2000Hz = (ImpedanceTabVM.AcousticReflexType)Enum.Parse(typeof(ImpedanceTabVM.AcousticReflexType), reader.GetString(acRf2000RtEarCol.Index)); impViewModel.LtEarAcousticReflex2000Hz = (ImpedanceTabVM.AcousticReflexType)Enum.Parse(typeof(ImpedanceTabVM.AcousticReflexType), reader.GetString(acRf2000LtEarCol.Index)); impViewModel.RtEarAcousticReflex4000Hz = (ImpedanceTabVM.AcousticReflexType)Enum.Parse(typeof(ImpedanceTabVM.AcousticReflexType), reader.GetString(acRf4000RtEarCol.Index)); impViewModel.LtEarAcousticReflex4000Hz = (ImpedanceTabVM.AcousticReflexType)Enum.Parse(typeof(ImpedanceTabVM.AcousticReflexType), reader.GetString(acRf4000LtEarCol.Index)); } }
private void GetViewModelPropertyValues(string accNumber, string examDate) { ImpedanceTabVM impViewModel = (ImpedanceTabVM)viewmodel; accNumberCol.Value = accNumber; dateOfExamCol.Value = examDate; isTestConductedCol.Value = impViewModel.IsImpedanceTestConducted.ToString(CultureInfo.InvariantCulture); compNeg400RtEarCol.Value = impViewModel.RtEarComplianceNeg400daPa.ToString(); compNeg400LtEarCol.Value = impViewModel.LtEarComplianceNeg400daPa.ToString(); compNeg300RtEarCol.Value = impViewModel.RtEarComplianceNeg300daPa.ToString(); compNeg300LtEarCol.Value = impViewModel.LtEarComplianceNeg300daPa.ToString(); compNeg200RtEarCol.Value = impViewModel.RtEarComplianceNeg200daPa.ToString(); compNeg200LtEarCol.Value = impViewModel.LtEarComplianceNeg200daPa.ToString(); compNeg100RtEarCol.Value = impViewModel.RtEarComplianceNeg100daPa.ToString(); compNeg100LtEarCol.Value = impViewModel.LtEarComplianceNeg100daPa.ToString(); comp0RtEarCol.Value = impViewModel.RtEarCompliance0daPa.ToString(); comp0LtEarCol.Value = impViewModel.LtEarCompliance0daPa.ToString(); comp100RtEarCol.Value = impViewModel.RtEarCompliance100daPa.ToString(); comp100LtEarCol.Value = impViewModel.LtEarCompliance100daPa.ToString(); comp200RtEarCol.Value = impViewModel.RtEarCompliance200daPa.ToString(); comp200LtEarCol.Value = impViewModel.LtEarCompliance200daPa.ToString(); comp300RtEarCol.Value = impViewModel.RtEarCompliance300daPa.ToString(); comp300LtEarCol.Value = impViewModel.LtEarCompliance300daPa.ToString(); comp400RtEarCol.Value = impViewModel.RtEarCompliance400daPa.ToString(); comp400LtEarCol.Value = impViewModel.LtEarCompliance400daPa.ToString(); peakPresRtEarCol.Value = impViewModel.RtEarPeakPressure.ToString(); peakPresLtEarCol.Value = impViewModel.LtEarPeakPressure.ToString(); earCnlVolRtEarCol.Value = impViewModel.RtEarCanalVolume.ToString(); earCnlVolLtEarCol.Value = impViewModel.LtEarCanalVolume.ToString(); curveRtEarCol.Value = impViewModel.RtEarCurveType.ToString(); curveLtEarCol.Value = impViewModel.LtEarCurveType.ToString(); acRf500RtEarCol.Value = impViewModel.RtEarAcousticReflex500Hz.ToString(); acRf500LtEarCol.Value = impViewModel.LtEarAcousticReflex500Hz.ToString(); acRf1000RtEarCol.Value = impViewModel.RtEarAcousticReflex1000Hz.ToString(); acRf1000LtEarCol.Value = impViewModel.LtEarAcousticReflex1000Hz.ToString(); acRf2000RtEarCol.Value = impViewModel.RtEarAcousticReflex2000Hz.ToString(); acRf2000LtEarCol.Value = impViewModel.LtEarAcousticReflex2000Hz.ToString(); acRf4000RtEarCol.Value = impViewModel.RtEarAcousticReflex4000Hz.ToString(); acRf4000LtEarCol.Value = impViewModel.LtEarAcousticReflex4000Hz.ToString(); }