Exemplo n.º 1
0
 public ActionResult CreateReferral(int Id, FormCollection collection)
 {
     try
     {
         Service.CreateReferral(Id, collection);
         return(RedirectToAction("Edit", "Doctor", new { id = Id }));
     }
     catch
     {
         Doctor ToDoctor;
         ToDoctor = Service.FindById(Id);
         List <DoctorReferralVM> MyEnumerable = new List <DoctorReferralVM>();
         DoctorReferralVM        ReferralData;
         ReferralData             = new DoctorReferralVM();
         ReferralData.DoctorModel = ToDoctor;
         ReferralData.ReasonModel = ReasonRepository.GetAll();
         MyEnumerable.Add(ReferralData);
         return(View(MyEnumerable));
     }
 }