public PrescriptionViewModel(Prescription p)
        {
            IBL bl = new BLImplement();

            this.Id        = p.Id;
            this.medicine  = bl.getMedicine(p.medicine).Name;
            this.StartDate = p.StartDate;
            this.EndDate   = p.EndDate;
            this.Doctor    = bl.getDoctor(p.Doctor).Name;
            this.Patient   = bl.getPatient(p.Patient).Name;
            this.Cause     = p.Cause;
        }
 public ActionResult DeleteConfirmed(string id)
 {
     try
     {
         IBL    bl     = new BLImplement();
         Doctor doctor = bl.getDoctor(id);
         bl.deleteDoctor(doctor);
         ViewBag.Message = String.Format("The doctor {0} is successfully deledted", doctor.Name);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ViewBag.Message = String.Format(ex.Message);
         return(RedirectToAction("Delete"));
     }
 }
        // GET: Doctors/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IBL    bl     = new BLImplement();
            Doctor doctor = bl.getDoctor(id);

            if (doctor == null)
            {
                return(HttpNotFound());
            }
            DoctorViewModel dvm = new DoctorViewModel(doctor);

            return(View(dvm));
        }
        public ActionResult prescriptionIssuance(string id, string doctor)
        {
            IBL bl = new BLImplement();
            var d  = bl.getDoctor(doctor);

            if (doctor == null)
            {
                ViewBag.Message = String.Format("please enter again");
                return(RedirectToAction("DoctorEntrance", "Home"));
            }

            var pfpm = new PrescriptionForPatientModel();

            pfpm.prescription.Patient = id;
            pfpm.prescription.Doctor  = doctor;
            pfpm.patient = id;
            pfpm.doctor  = doctor;
            return(View(pfpm));
        }