public void CreateResultEntry(long patientPk, string originalFileName, string generatedFileName) { using (var db = new NdEdModel()) { db.Results.Add(new Result() { GeneratedFileName = generatedFileName, OriginalFileName = originalFileName, PatientPK = patientPk }); db.SaveChanges(); } }
public string GetTherapistIdOfPatient(long patientPk) { using (var db = new NdEdModel()) { var patient = db.Patients.FirstOrDefault(x => x.PK == patientPk); if (patient == null) { return(null); } return(patient.TherapistId); } }
public FileInfoDto GetFileInfo(long filePk) { using (var db = new NdEdModel()) { var result = db.Results.FirstOrDefault(x => x.PK == filePk); if (result == null) { return(null); } return(new FileInfoDto() { GeneratedFileName = result.GeneratedFileName, OriginalFileName = result.OriginalFileName, TherapistId = result.Patient.TherapistId }); } }