Ejemplo n.º 1
0
 private void addPatientTestResult(object sender, RoutedEventArgs e)
 {
     if (NameOfWindow == "Urina Test")
     {
         InsertUrinaTestResultWindow urinaWindow = new InsertUrinaTestResultWindow();
         urinaWindow.Show();
     }
     if (NameOfWindow == "General Blood Test")
     {
         InsertGeneralBloodWindow generalBloodWindow = new InsertGeneralBloodWindow();
         generalBloodWindow.Show();
     }
     if (NameOfWindow == "Carbohydrate Metabolism Test")
     {
         InsertCarbohydrateMetabolismWindow carbohydrateWindow = new InsertCarbohydrateMetabolismWindow();
         carbohydrateWindow.Show();
     }
     if (NameOfWindow == "Protein Metabolism Test")
     {
         InsertProteinMetabolismWindow proteinWindow = new InsertProteinMetabolismWindow();
         proteinWindow.Show();
     }
     if (NameOfWindow == "Vitamins Test")
     {
         InsertVitaminsWindow vitaminsWindow = new InsertVitaminsWindow();
         vitaminsWindow.Show();
     }
 }
Ejemplo n.º 2
0
        private void addUrinaTestResult(object sender, RoutedEventArgs e)
        {
            try
            {
                ITestResultRepository testResultRepository = new TestResultRepository(ConfigurationManager.ConnectionStrings["ConnectionPatientResults"].ConnectionString);
                var parameters = new[]
                {
                    new SqlParameter(StoredProcedureParameters.Id, PatientRepository.PatientId),
                    new SqlParameter(StoredProcedureParameters.NameOfTest, "Urina Test"),
                    new SqlParameter(StoredProcedureParameters.SpDateOfResult, Calendar.ToString()),
                    new SqlParameter(StoredProcedureParameters.PhValue, Convert.ToDouble(txtPhValue.Text)),
                    new SqlParameter(StoredProcedureParameters.Protein, Convert.ToDouble(txtProteint.Text)),
                    new SqlParameter(StoredProcedureParameters.Sugar, Convert.ToDouble(txtSugar.Text)),
                    new SqlParameter(StoredProcedureParameters.Nitrite, Convert.ToDouble(txtNitrine.Text)),
                    new SqlParameter(StoredProcedureParameters.Ketone, Convert.ToDouble(txtKetone.Text)),
                    new SqlParameter(StoredProcedureParameters.Bilirubin, Convert.ToDouble(txtBilirubin.Text)),
                    new SqlParameter(StoredProcedureParameters.Urobilinogen, Convert.ToDouble(txtUrobilinogen.Text)),
                    new SqlParameter(StoredProcedureParameters.RedBloodCells, Convert.ToDouble(txtRedBloodCells.Text)),
                    new SqlParameter(StoredProcedureParameters.WhiteBloodCells, Convert.ToDouble(txtWhiteBloodCells.Text)),
                };

                testResultRepository.InsertUrinaTestResultInfo(CommandType.StoredProcedure,
                                                               StoredProcedureNames.SpInsertUrinaTestResultInfo, parameters);
                txtPhValue.Text         = string.Empty;
                txtProteint.Text        = string.Empty;
                txtSugar.Text           = string.Empty;
                txtNitrine.Text         = string.Empty;
                txtKetone.Text          = string.Empty;
                txtBilirubin.Text       = string.Empty;
                txtUrobilinogen.Text    = string.Empty;
                txtRedBloodCells.Text   = string.Empty;
                txtWhiteBloodCells.Text = string.Empty;
                InsertUrinaTestResultWindow urinaWindow = new InsertUrinaTestResultWindow();
                MessageBox.Show("Thank you, urina test result was succsesfully added");
                urinaWindow.Visibility = Visibility.Hidden;
            }
            catch (IOException ex)
            {
                MessageBox.Show(ex.Message);
            }

            catch (NullReferenceException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }