Example #1
0
        /// <summary>
        /// opretter en ny journal, sender denne videre til dataAcces og lukker dette vindue, for at vise dagbogsvinduet
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gemB_Click(object sender, RoutedEventArgs e)
        {
            newJournal = new Journal();
            newJournal.GeneralComment = generelTB.Text;
            newJournal.PainScale      = painS.Value;
            if (_journalWindow.journalCB.Text == "Knæ" || (string)_journalWindow.journalCB.SelectedItem == "Albue")
            {
                newJournal.BendAngle = Convert.ToDouble(vinkelTB.Text);
            }
            else
            {
                newJournal.BendAngle = 0;
            }
            newJournal.Medicine    = medicinTB.Text;
            newJournal.JournalDate = DateTime.Now;
            newJournal.JournalType = _journalWindow.journalCB.Text;
            newJournal.Patient     = _patient;
            _updateJournalControl.SaveNewJournalData(newJournal);
            this.Close();
            _journalWindow.Show();
            var list = _patient.Journals.OrderBy(x => x.JournalDate.Date).ToList();

            _journalWindow.JournalinfoTB.Text = "";
            foreach (var item in list)
            {
                if ((string)_journalWindow.journalCB.SelectedItem == item.JournalType)
                {
                    if ((string)_journalWindow.journalCB.SelectedItem == "Knæ" || (string)_journalWindow.journalCB.SelectedItem == "Albue")
                    {
                        //JournalinfoTB skal have textwrapping tror jeg, ellers bliver det grimt
                        _journalWindow.JournalinfoTB.Text += "Dato: " + Convert.ToString(item.JournalDate)
                                                             + "\r\n" + "Generelt: " +
                                                             Convert.ToString(item.GeneralComment) + "\r\n"
                                                             + "Vinkel: " + Convert.ToString(item.BendAngle)
                                                             + "\r\n" + "Smerte: " +
                                                             Convert.ToString(item.PainScale)
                                                             + "\r\n" + "Medicin: " +
                                                             Convert.ToString(item.Medicine)
                                                             + "\r\n";
                    }
                    else
                    {
                        _journalWindow.JournalinfoTB.Text += "\r\nDato: " + Convert.ToString(item.JournalDate)
                                                             + "\r\n" + "Generelt: " +
                                                             Convert.ToString(item.GeneralComment)
                                                             + "\r\n" + "Smerte: " +
                                                             Convert.ToString(item.PainScale)
                                                             + "\r\n" + "Medicin: " +
                                                             Convert.ToString(item.Medicine)
                                                             + "\r\n";
                    }
                }
            }
        }
Example #2
0
 private void gemB_Click(object sender, RoutedEventArgs e)
 {
     newJournal = new Journal(_journalWindow.journalCB.Text, painS.Value, Convert.ToDouble(vinkelTB.Text), medicinTB.Text
                              , generelTB.Text);
     _updateJournalControl.SaveNewJournalData(newJournal);
 }
 public void SaveJournal_SaveNewJournalDateIsCalled_RecievesOne()
 {
     uut.SaveNewJournalData(_journal);
     _saveDatabase.Received(1).SaveJournal(_journal);
 }