Exemplo n.º 1
0
        public override void OpenRecordFromDatabase(string accNumber, string examDate)
        {
            TuningForkTestsVM tfViewModel = (TuningForkTestsVM)viewmodel;

            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())
            {
                tfViewModel.IsTestConducted = Convert.ToBoolean(reader.GetString(isTestConductedCol.Index));
                tfViewModel.Wbr512RtEar     = (TuningForkTypes.Weber)Enum.Parse(typeof(TuningForkTypes.Weber), reader.GetString(wbr512RtEarCol.Index));
                tfViewModel.Wbr512LtEar     = (TuningForkTypes.Weber)Enum.Parse(typeof(TuningForkTypes.Weber), reader.GetString(wbr512LtEarCol.Index));
                tfViewModel.Rn256RtEar      = (TuningForkTypes.Rinne)Enum.Parse(typeof(TuningForkTypes.Rinne), reader.GetString(rn256RtEarCol.Index));
                tfViewModel.Rn256LtEar      = (TuningForkTypes.Rinne)Enum.Parse(typeof(TuningForkTypes.Rinne), reader.GetString(rn256LtEarCol.Index));
                tfViewModel.Rn512RtEar      = (TuningForkTypes.Rinne)Enum.Parse(typeof(TuningForkTypes.Rinne), reader.GetString(rn512RtEarCol.Index));
                tfViewModel.Rn512LtEar      = (TuningForkTypes.Rinne)Enum.Parse(typeof(TuningForkTypes.Rinne), reader.GetString(rn512LtEarCol.Index));
                tfViewModel.Rn1024RtEar     = (TuningForkTypes.Rinne)Enum.Parse(typeof(TuningForkTypes.Rinne), reader.GetString(rn1024RtEarCol.Index));
                tfViewModel.Rn1024LtEar     = (TuningForkTypes.Rinne)Enum.Parse(typeof(TuningForkTypes.Rinne), reader.GetString(rn1024LtEarCol.Index));
                tfViewModel.SwbRtEar        = (TuningForkTypes.Schwabach)Enum.Parse(typeof(TuningForkTypes.Schwabach), reader.GetString(swbRtEarCol.Index));
                tfViewModel.SwbLtEar        = (TuningForkTypes.Schwabach)Enum.Parse(typeof(TuningForkTypes.Schwabach), reader.GetString(swbLtEarCol.Index));
                tfViewModel.AbcRtEar        = (TuningForkTypes.AbsBoneCond)Enum.Parse(typeof(TuningForkTypes.AbsBoneCond), reader.GetString(abcRtEarCol.Index));
                tfViewModel.AbcLtEar        = (TuningForkTypes.AbsBoneCond)Enum.Parse(typeof(TuningForkTypes.AbsBoneCond), reader.GetString(abcLtEarCol.Index));
                tfViewModel.StgRtEar        = (TuningForkTypes.Stenger)Enum.Parse(typeof(TuningForkTypes.Stenger), reader.GetString(stgRtEarCol.Index));
                tfViewModel.StgLtEar        = (TuningForkTypes.Stenger)Enum.Parse(typeof(TuningForkTypes.Stenger), reader.GetString(stgLtEarCol.Index));
                tfViewModel.TlRtEar         = (TuningForkTypes.Teal)Enum.Parse(typeof(TuningForkTypes.Teal), reader.GetString(tlRtEarCol.Index));
                tfViewModel.TlLtEar         = (TuningForkTypes.Teal)Enum.Parse(typeof(TuningForkTypes.Teal), reader.GetString(tlLtEarCol.Index));
                tfViewModel.GlRtEar         = (TuningForkTypes.Gelle)Enum.Parse(typeof(TuningForkTypes.Gelle), reader.GetString(glRtEarCol.Index));
                tfViewModel.GlLtEar         = (TuningForkTypes.Gelle)Enum.Parse(typeof(TuningForkTypes.Gelle), reader.GetString(glLtEarCol.Index));
            }
        }
Exemplo n.º 2
0
        private void GetViewModelPropertyValues(string accNumber, string examDate)
        {
            TuningForkTestsVM tfViewModel = (TuningForkTestsVM)viewmodel;

            accNumberCol.Value       = accNumber;
            dateOfExamCol.Value      = examDate;
            isTestConductedCol.Value = tfViewModel.IsTestConducted.ToString(CultureInfo.InvariantCulture);
            wbr512RtEarCol.Value     = tfViewModel.Wbr512RtEar.ToString();
            wbr512LtEarCol.Value     = tfViewModel.Wbr512LtEar.ToString();
            rn256RtEarCol.Value      = tfViewModel.Rn256RtEar.ToString();
            rn256LtEarCol.Value      = tfViewModel.Rn256LtEar.ToString();
            rn512RtEarCol.Value      = tfViewModel.Rn512RtEar.ToString();
            rn512LtEarCol.Value      = tfViewModel.Rn512LtEar.ToString();
            rn1024RtEarCol.Value     = tfViewModel.Rn1024RtEar.ToString();
            rn1024LtEarCol.Value     = tfViewModel.Rn1024LtEar.ToString();
            swbRtEarCol.Value        = tfViewModel.SwbRtEar.ToString();
            swbLtEarCol.Value        = tfViewModel.SwbLtEar.ToString();
            abcRtEarCol.Value        = tfViewModel.AbcRtEar.ToString();
            abcLtEarCol.Value        = tfViewModel.AbcLtEar.ToString();
            stgRtEarCol.Value        = tfViewModel.StgRtEar.ToString();
            stgLtEarCol.Value        = tfViewModel.StgLtEar.ToString();
            tlRtEarCol.Value         = tfViewModel.TlRtEar.ToString();
            tlLtEarCol.Value         = tfViewModel.TlLtEar.ToString();
            glRtEarCol.Value         = tfViewModel.GlRtEar.ToString();
            glLtEarCol.Value         = tfViewModel.GlLtEar.ToString();
        }
Exemplo n.º 3
0
        public PureToneTabVM()
        {
            ACMskTabVM      = new AirCondMskVM();
            ACUmskTabVM     = new AirCondUmskVM();
            BCMskTabVM      = new BoneCondMskVM();
            BCUmskTabVM     = new BoneCondUmskVM();
            ACAidedTabVM    = new AirCondAidVM();
            LoudnessTabVM   = new LoudDiscomLvlVM();
            SoundFieldTabVM = new SoundFieldVM();

            ptamTabDict = new SortedDictionary <int, PureToneAMTabVM>();
            ptamTabDict[ACMskTabIndex]      = ACMskTabVM;
            ptamTabDict[ACUmskTabIndex]     = ACUmskTabVM;
            ptamTabDict[BCMskTabIndex]      = BCMskTabVM;
            ptamTabDict[BCUmskTabIndex]     = BCUmskTabVM;
            ptamTabDict[ACAidedTabIndex]    = ACAidedTabVM;
            ptamTabDict[LoudnessTabIndex]   = LoudnessTabVM;
            ptamTabDict[SoundFieldTabIndex] = SoundFieldTabVM;
            PureToneAMTabs = new ObservableCollection <PureToneAMTabVM>(ptamTabDict.Values);
            AblbTabVM      = new AblbTabVM();
            SisiTabVM      = new SisiTabVM();
            ToneDecayTabVM = new ToneDecayTabVM();
            StengerTabVM   = new StengerTabVM();
            TuningForkVM   = new TuningForkTestsVM();

            DateOfExam = DateTime.Now;
            IsPureToneTestConducted = false;
            IsSpecialTestConducted  = false;
        }