Name); [ CurrentDoctor ]=currentDoctor; model=new GetRequestsModel
{=. Organization.Requests.Select (request= gt; request.Patient) .ToList ()
.Select (x= gt; new SelectListItem
{= x.Id.ToString (),=string.Format ( {0} {1} raquo ;, x.LastName, x.FirstName)
})
}; View (model);
}
[HttpPost]
[Authorize]
[ValidateAntiForgeryToken] ActionResult GetRequests (GetRequestsModel model, string command)
{(command == Open patient info )
{selectedPatient=PublicClass.UnitOfWork.PatientRepository
.ItemsWithInclude (u= gt; u.Address, u= gt; u.Address.Province, u= gt; u.MedicalCard,= gt; u.MedicalCard.OrganizationCreator, u= gt; u.MedicalCard.DoctorCreator )
.SingleOrDefault (u= gt; u.Id == model.SelectedUser); (selectedPatient == null)
{RedirectToAction ( GetRequests raquo ;, DoctorCardOperation raquo ;, new {message= Select a patient first });
} [ PatientRequest ]=selectedPatient; RedirectToAction ( GetRequest raquo ;, DoctorCardOperation );
} RedirectToAction ( DoctorIndex raquo ;, DoctorMain );
}
[HttpGet]
[Authorize] ActionResult GetRequest (string message)
{. Message=message; patient=Session [ PatientRequest ] as Patient; [ PatientForCardOpen ]=patient; model=new GetRequestModel
{= patient.Login,=patient.FirstName,=patient.LastName,=patient.Gender,=patient.Email,=patient.Phone,=(DateTime) patient.BirthDate,=patient.Address.Province.Name ,=patient.Address.AddressLine,=patient.IsResident.ToString ()
}; View (model);
}
[HttpGet]
[Authorize] ActionResult CreateAppointment (Doctor doctor, string message)
{. Message=message; patient=Session [ PatientRequest ] as Patient; appointerDoctor=Session [ CurrentDoctor ] as Doctor; [ DoctorRequest ]=doctor; model=new CreateAppointmentModel
{= patient.Login,=patient.FirstName,=patient.LastName,=doctor.Login,=doctor.FirstName,=doctor.LastName
}; View (model);
}
[HttpPost]
[Authorize]
[ValidateAntiForgeryToken] ActionResult CreateAppointment (CreateAppointmentModel model, string command)
{appointerDoctor=Session [ CurrentDoctor ] as Doctor; receiverDoctor=Session [ DoctorRequest ] as Doctor; patient=Session [ PatientRequest ] as Patient; (command == Back to patient card operation page )
{RedirectToAction ( GetRequest raquo ;, DoctorCardOperation );
} (command == Write feedback )
{RedirectToAction ( WriteFeedback raquo ;, AdditionalFunction );
} (patient.MedicalCard == null)
{
//If we got this far, something failed, redisplay form.AddModelError ( raquo ;, Patient has not a medical card ); View ();
} (command == Create )
{appointment=new Appointment
{= model.Title,=model.Description,=true,=DateTime.Now,=null,=receiverDoctor,=patient.MedicalCard
} ;. UnitOfWork.AppointmentRepository.Add (appointment); RedirectToAction ( GetRequest raquo ;, DoctorCardOperation raquo ;, new {message= The operation was successful });
} RedirectToAction ( CreateAppointment raquo ;, DoctorCardOperation raquo ;, new {message= You have to fill all empty areas });
}
[HttpGet]
[Authorize] ActionResult CreateIllness (Appointment appointment, string message)
{. Message=message; (Session [ AppointmentList ] == null)
{[ AppointmentList ]=new List lt; Appointment gt; ();
}
{
((List lt; Appointment gt;) Session [ AppointmentList ]). Add (appointment);
} attendingDoctor=Session [ CurrentDoctor ] as Doctor; patient=Session [ PatientRequest ] as Patient; model=new CreateIllnessModel
{= attendingDoctor.Login,=attendingDoctor.FirstName,=attendingDoctor.LastName,=patient.Login,=patient.FirstName,=patient.LastName,=((List lt; Appointment gt;) Session [ AppointmentList ]).Select (x= gt; new SelectListItem
{= x.Id.ToString (),=string.Format ( {0} raquo ;, x.Title)
})
}; View (model);
}
[HttpPost]
[Authorize]
[ValidateAntiForgeryToken] ActionResult CreateIllness (CreateIllnessModel model, string command)
{attendingDoctor=Session [ CurrentDoctor ] as Doctor; patient=Session [ PatientRequest ] as Patient; (command == Add appointment )
{RedirectToAction ( GetAppointments raquo ;, MedicalCard raquo ;, new {param= FromIllness });
} (command == Appoint medicine )
{RedirectToAction ( AppointMedicine raquo ;, DoctorCardOperation );
} (command == Write feedback )
{RedirectToAction ( WriteFeedback raquo ;, AdditionalFunction );
} (command == Back to patient card operation page )
{RedirectToAction ( GetRequest raquo ;, DoctorCardOperation );
...