示例#1
0
        public void SaveMedicalPrescription(MedicalPrescriptionInfo medicalPrescriptionInfo)
        {
            Data.MedicalPrescription medicalPrescription = ConvertToDb(medicalPrescriptionInfo);

            _context.MedicalPrescriptions.Add(medicalPrescription);
            _context.SaveChanges();
        }
示例#2
0
 public MedicalPrescriptionInfo ConvertToFacade(Data.MedicalPrescription medicalPrescription)
 {
     return(new MedicalPrescriptionInfo
     {
         Id = medicalPrescription.Id,
         PrescriptionPath = medicalPrescription.PrescriptionPath,
         FileName = medicalPrescription.FileName,
         UploadDate = medicalPrescription.UploadDate,
         MedicalCheckoutId = medicalPrescription.MedicalCheckoutId
     });
 }
示例#3
0
        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();
            }
        }
示例#4
0
        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();
            }
        }