public void SaveMedicalPrescription(MedicalPrescriptionInfo medicalPrescriptionInfo) { Data.MedicalPrescription medicalPrescription = ConvertToDb(medicalPrescriptionInfo); _context.MedicalPrescriptions.Add(medicalPrescription); _context.SaveChanges(); }
public MedicalPrescriptionInfo ConvertToFacade(Data.MedicalPrescription medicalPrescription) { return(new MedicalPrescriptionInfo { Id = medicalPrescription.Id, PrescriptionPath = medicalPrescription.PrescriptionPath, FileName = medicalPrescription.FileName, UploadDate = medicalPrescription.UploadDate, MedicalCheckoutId = medicalPrescription.MedicalCheckoutId }); }
public void DeleteMedicalPrescription(int id) { Data.MedicalPrescription medicalPrescription = _context.MedicalPrescriptions.Find(id); if (medicalPrescription != null) { _context.MedicalPrescriptions.Remove(medicalPrescription); _context.SaveChanges(); } else { throw new ArgumentNullException(); } }
public void UpdateMedicalPrescription(MedicalPrescriptionInfo medicalPrescriptionInfo) { Data.MedicalPrescription medicalPrescription = _context.MedicalPrescriptions.Find(medicalPrescriptionInfo.Id); if (medicalPrescription != null) { //Not implemented yet //medicalAllowance.Category = medicalAllowanceInfo.Category; //medicalAllowance.Amount = medicalAllowanceInfo.Amount; _context.SaveChanges(); } else { throw new ArgumentNullException(); } }