public static Dictionary<int, HospitalAccounting> calculateAccounting(SampleData[] samples) { Dictionary<int, HospitalAccounting> set = new Dictionary<int, HospitalAccounting>(); foreach (SampleData sample in samples) { Hospital hos = sample.Patient.Hospital; HospitalAccounting hosAcc; if (set.TryGetValue(hos.ID, out hosAcc) == false) { hosAcc = new HospitalAccounting(hos.ID, hos.Name); set.Add(hos.ID, hosAcc); } Patient pat = sample.Patient; PatientAccounting patAcc; if (hosAcc.dictionary.TryGetValue(pat.ID, out patAcc) == false) { patAcc = new PatientAccounting(pat.ID, pat.Firstname, pat.Lastname); hosAcc.dictionary.Add(pat.ID, patAcc); } DateTime date = sample.LastStateChange; if (sample.State == SampleStateEnum.Closed) { date = date.Subtract(new TimeSpan(2, 0, 0, 0)); //Subtract 2 Days if Sample already closed } patAcc.Items.Add(new SampleAccounting(sample.Analysis.Name, sample.Analysis.Cost, date)); sample.beginEdit(); sample.IsAccounted = true; sample.endEdit(); } return set; }
public void sendDiscardMail(String sendTo, SampleData sample) { String nachricht; MailAddress to = new MailAddress(sendTo, ""); MailMessage message = new MailMessage(discardMail, to); message.Subject = "Proben ID: " + sample.ID + " für Patient " + sample.Patient.Firstname + " " + sample.Patient.Lastname; nachricht = "Die Probe " + sample.ID + " wurde Verworfen, der Verantwortliche Mitarbeiter hat folgenden Kommentar verfasst:\n"; nachricht += sample.Comment; message.Body = nachricht; mailClient.Send(message); }
public void sendResultMail(String sendTo, SampleData sample) { MailAddress to = new MailAddress(sendTo, ""); MailMessage message = new MailMessage(resultMail, to); message.Subject = "Proben ID: " + sample.ID + " für Patient " + sample.Patient.Firstname + " " + sample.Patient.Lastname; message.Body = "Die Ergebnisse der Probe " + sample.ID + " koennen nun ueber unser System (https://pest.dyndns.info) abgerufen werden."; mailClient.Send(message); }
public SampleData getSample(string id) { SampleData result = null; DataRow row = dataset.Tables["Samples"].Rows.Find(id); if (row != null) result = new SampleData(row, this); return result; }