public OrderLabTestContentDialog()
 {
     this.InitializeComponent();
     this.vm          = new LabTestViewModel();
     this.DataContext = this.vm;
     this.allTests_ListView.DataContext = this;
 }
 public OrderLabTestContentDialog(Patient patient)
 {
     this.InitializeComponent();
     this.vm          = new LabTestViewModel();
     this.DataContext = this.vm;
     this.allTests_ListView.DataContext = this;
     LabTestViewModel.PatientId         = Convert.ToString(patient.Id);
     this.patientId_TextBox.Text        = LabTestViewModel.PatientId;
     this.patientName_TextBlock.Text    = patient.FullName;
 }
예제 #3
0
        private async void orderLabTest_Button_Click(object sender, RoutedEventArgs e)
        {
            var vm = new LabTestViewModel();
            await vm.LoadAllLabTestss();

            var oltcd = new OrderLabTestContentDialog(this.Patient)
            {
                AllTest = vm.AllTests
            };
            await oltcd.ShowAsync();
        }
예제 #4
0
        public IActionResult AddNewTest(LabTestViewModel input)
        {
            try
            {
                var model = _mapper.Map <LabTestModel>(input);

                _labTestData.AddNewTest(model);

                return(Ok("Created"));
            }
            catch (Exception ex)
            {
                _apiErrorHandler.CreateError(ex.Source, ex.StackTrace, ex.Message);
            }

            return(StatusCode(500));
        }
예제 #5
0
        public IActionResult UpdateTest(string id, LabTestViewModel labTestInput)
        {
            try
            {
                var model = _mapper.Map <LabTestModel>(labTestInput);
                model.Id = id;

                _labTestData.UpdateTest(model);

                return(Ok());
            }
            catch (Exception ex)
            {
                _apiErrorHandler.CreateError(ex.Source, ex.StackTrace, ex.Message);
            }

            return(StatusCode(500));
        }