Esempio n. 1
0
 public async Task <IActionResult> Create([Bind("PrescriptionID,PrescriptionPatientID,PrescriptionName,PrescriptionPatientTrackingNumber,PrescriptionRefillQuantity,PrescriptionRefillRemaining,PrescriptionPillQuantity,PrescriptionPillQuantityRemaining,PrescriptionPillDose,PrescriptionExpireDate,PrescriptionEntryDate,PrescriptionNextRefillEnableDate,PrescriptionActive")] Prescription prescription)
 {
     if (ModelState.IsValid)
     {
         //_context.Add(prescription);
         Processing.AddPrescription(Processing.ReturnPatientIdFromEmail(User.Identity.Name), prescription.PrescriptionName, prescription.PrescriptionRefillQuantity, prescription.PrescriptionPillQuantity, prescription.PrescriptionPillDose, prescription.PrescriptionExpireDate);
         //await _context.SaveChangesAsync();
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["PrescriptionPatientID"] = new SelectList(_context.Patients, "PatientID", "PatientEmail", prescription.PrescriptionPatientID);
     return(View(prescription));
 }