public ActionResult BookAppointment(string id) { var doctor = _doctorRepo.GetById(Convert.ToInt32(id)); var appointment = new AppointmentViewModel(); appointment.DoctorID = doctor.ID; appointment.DoctorName = doctor.Name; return(View(appointment)); }
public override Expression <Func <Appointment, bool> > GenerateFilter() { DoctorRepo repo = new DoctorRepo(); Doctor doc = repo.GetById(AuthenticationManager.LoggedUser.Id); if (doc != null) { return(u => (u.DoctorId == AuthenticationManager.LoggedUser.Id || u.User.Id == AuthenticationManager.LoggedUser.Id) && (String.IsNullOrEmpty(Name) || u.User.Firstname.Contains(Name)) && (String.IsNullOrEmpty(Status) || u.IsApproved.ToLower().Equals(Status.ToLower())) && (String.IsNullOrEmpty(Name) || u.User.Lastname.Contains(Name))); } else { return(u => (u.DoctorId == AuthenticationManager.LoggedUser.Id || u.User.Id == AuthenticationManager.LoggedUser.Id) && (String.IsNullOrEmpty(Status) || u.IsApproved.ToLower().Equals(Status.ToLower())) && (String.IsNullOrEmpty(Name) || u.Doctor.User.Lastname.Contains(Name))); } }