private void AddObservation()
        {
            ServiceObservation.ServiceObservationClient client = new ServiceObservation.ServiceObservationClient();
            ServiceObservation.Observation obs = new ServiceObservation.Observation();
            obs.BloodPressure = BloodPressure;
            obs.Comment       = Comment;
            obs.Prescription  = Prescriptions.ToArray();
            obs.Weight        = Weight;
            obs.Pictures      = ConverttobyteArray().ToArray();
            obs.Date          = Date;

            try
            {
                client.AddObservation(Patient.Id, obs);

                View.MainWindow     mainwindow       = (View.MainWindow)Application.Current.MainWindow;
                View.NewObservation view             = new colle_tMedecine.View.NewObservation();
                ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
                view.DataContext = vm;
                mainwindow.contentcontrol.Content = view;
            }
            catch
            {
                View.MainWindow     mainwindow       = (View.MainWindow)Application.Current.MainWindow;
                View.NewObservation view             = new colle_tMedecine.View.NewObservation();
                ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
                view.DataContext = vm;
                mainwindow.contentcontrol.Content = view;
            }
        }
Пример #2
0
        private void AddObs()
        {
            View.MainWindow      mainwindow   = (View.MainWindow)Application.Current.MainWindow;
            ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;

            View.NewObservation view             = new colle_tMedecine.View.NewObservation();
            ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
            view.DataContext = vm;

            mainwindowVM.navigate((UserControl)mainwindow.contentcontrol.Content, view);
        }
        private void AddObservation()
        {
            ServiceObservation.ServiceObservationClient client = new ServiceObservation.ServiceObservationClient();
            ServiceObservation.Observation obs = new ServiceObservation.Observation();
            obs.BloodPressure = BloodPressure;
            obs.Comment = Comment;
            obs.Prescription = Prescriptions.ToArray();
            obs.Weight = Weight;
            obs.Pictures = ConverttobyteArray().ToArray();
            obs.Date = Date;

            try
            {
                client.AddObservation(Patient.Id, obs);

                View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;
                View.NewObservation view = new colle_tMedecine.View.NewObservation();
                ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
                view.DataContext = vm;
                mainwindow.contentcontrol.Content = view;
            }
            catch
            {
                View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;
                View.NewObservation view = new colle_tMedecine.View.NewObservation();
                ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
                view.DataContext = vm;
                mainwindow.contentcontrol.Content = view;
            }
        }
        private void AddObs()
        {
            View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;
            ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;

            View.NewObservation view = new colle_tMedecine.View.NewObservation();
            ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
            view.DataContext = vm;

            mainwindowVM.navigate((UserControl)mainwindow.contentcontrol.Content, view);
        }