public static PageContent CreatePrintPageContentOxyPlot(Size pageSize, BithermalCaloricTabVM caloricVM, int width, int height, string header) { var page = new FixedPage { Width = pageSize.Width, Height = pageSize.Height }; BitmapSource plotBmp30 = ImageUtility.ExportToBitmap(caloricVM.Calorigram30, width, height, OxyColors.Transparent, 96); StackPanel caloricPanel = new StackPanel(); System.Windows.Controls.Image img30 = new System.Windows.Controls.Image(); img30.Source = plotBmp30; caloricPanel.Children.Add(img30); BitmapSource plotBmp44 = ImageUtility.ExportToBitmap(caloricVM.Calorigram44, width, height, OxyColors.Transparent, 96); System.Windows.Controls.Image img44 = new System.Windows.Controls.Image(); img44.Source = plotBmp44; caloricPanel.Children.Add(img44); GroupBox grpBox = new GroupBox(); grpBox.Header = header; grpBox.Content = caloricPanel; page.Children.Add(grpBox); page.Measure(pageSize); page.Arrange(new Rect(new Point(), pageSize)); page.UpdateLayout(); var firstPageContent = new PageContent(); ((IAddChild)firstPageContent).AddChild(page); return(firstPageContent); }
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()) { BithermalCaloricTabVM bcViewModel = (BithermalCaloricTabVM)viewmodel; bcViewModel.IsCaloricTestConducted = Convert.ToBoolean(reader.GetString(isTestConductedCol.Index)); bcViewModel.IsAirTest = Convert.ToBoolean(reader.GetString(isAirTestCol.Index)); bcViewModel.IsWaterTest = Convert.ToBoolean(reader.GetString(isWaterTestCol.Index)); bcViewModel.NysStartMin30RtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysStartMin30RtEarCol.Index)); bcViewModel.NysStartSec30RtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysStartSec30RtEarCol.Index)); bcViewModel.NysEndMin30RtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysEndMin30RtEarCol.Index)); bcViewModel.NysEndSec30RtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysEndSec30RtEarCol.Index)); bcViewModel.NysStartMin30LtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysStartMin30LtEarCol.Index)); bcViewModel.NysStartSec30LtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysStartSec30LtEarCol.Index)); bcViewModel.NysEndMin30LtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysEndMin30LtEarCol.Index)); bcViewModel.NysEndSec30LtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysEndSec30LtEarCol.Index)); bcViewModel.NysStartMin44RtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysStartMin44RtEarCol.Index)); bcViewModel.NysStartSec44RtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysStartSec44RtEarCol.Index)); bcViewModel.NysEndMin44RtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysEndMin44RtEarCol.Index)); bcViewModel.NysEndSec44RtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysEndSec44RtEarCol.Index)); bcViewModel.NysStartMin44LtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysStartMin44LtEarCol.Index)); bcViewModel.NysStartSec44LtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysStartSec44LtEarCol.Index)); bcViewModel.NysEndMin44LtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysEndMin44LtEarCol.Index)); bcViewModel.NysEndSec44LtEar = NullDoubleHelper.ToNullableDouble(reader.GetString(nysEndSec44LtEarCol.Index)); bcViewModel.CanalParesis = NullDoubleHelper.ToNullableDouble(reader.GetString(canalParesisCol.Index)); bcViewModel.DirPrepond = NullDoubleHelper.ToNullableDouble(reader.GetString(dirPrepondCol.Index)); } }
private void GetViewModelPropertyValues(string accNumber, string examDate) { BithermalCaloricTabVM bcViewModel = (BithermalCaloricTabVM)viewmodel; accNumberCol.Value = accNumber; dateOfExamCol.Value = examDate; isTestConductedCol.Value = bcViewModel.IsCaloricTestConducted.ToString(CultureInfo.InvariantCulture); isAirTestCol.Value = bcViewModel.IsAirTest.ToString(CultureInfo.InvariantCulture); isWaterTestCol.Value = bcViewModel.IsWaterTest.ToString(CultureInfo.InvariantCulture); nysStartMin30RtEarCol.Value = bcViewModel.NysStartMin30RtEar.ToString(); nysStartSec30RtEarCol.Value = bcViewModel.NysStartSec30RtEar.ToString(); nysEndMin30RtEarCol.Value = bcViewModel.NysEndMin30RtEar.ToString(); nysEndSec30RtEarCol.Value = bcViewModel.NysEndSec30RtEar.ToString(); nysStartMin30LtEarCol.Value = bcViewModel.NysStartMin30LtEar.ToString(); nysStartSec30LtEarCol.Value = bcViewModel.NysStartSec30LtEar.ToString(); nysEndMin30LtEarCol.Value = bcViewModel.NysEndMin30LtEar.ToString(); nysEndSec30LtEarCol.Value = bcViewModel.NysEndSec30LtEar.ToString(); nysStartMin44RtEarCol.Value = bcViewModel.NysStartMin44RtEar.ToString(); nysStartSec44RtEarCol.Value = bcViewModel.NysStartSec44RtEar.ToString(); nysEndMin44RtEarCol.Value = bcViewModel.NysEndMin44RtEar.ToString(); nysEndSec44RtEarCol.Value = bcViewModel.NysEndSec44RtEar.ToString(); nysStartMin44LtEarCol.Value = bcViewModel.NysStartMin44LtEar.ToString(); nysStartSec44LtEarCol.Value = bcViewModel.NysStartSec44LtEar.ToString(); nysEndMin44LtEarCol.Value = bcViewModel.NysEndMin44LtEar.ToString(); nysEndSec44LtEarCol.Value = bcViewModel.NysEndSec44LtEar.ToString(); canalParesisCol.Value = bcViewModel.CanalParesis.ToString(); dirPrepondCol.Value = bcViewModel.DirPrepond.ToString(); }
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]; }