public ActionResult Edit() { User user = AuthenticationManager.LoggedUser; DoctorService service = new DoctorService(); Doctor doctor = service.GetById(user.Id); EditDoctorVM edit = new EditDoctorVM(); edit.Id = user.Id; edit.Email = user.Email; edit.Password = user.Password; edit.Firstname = user.Firstname; edit.Lastname = user.Lastname; edit.Phone = user.Phone; edit.IsAdmin = AuthenticationManager.LoggedUser.IsAdmin; if (doctor != null) { edit.Specialization = doctor.Specialization; edit.Address = doctor.Address; } return(View(edit)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //var doctor = db.Doctors.Find(id); var doctor = doctorService.GetById(id); if (doctor == null) { return(HttpNotFound()); } return(View(doctor)); }
public ActionResult DoctorDetailsInfo(int?id) { if (id == null) { return(HttpNotFound()); } var doctor = _doctorService.GetById(id.Value); if (doctor == null) { return(HttpNotFound()); } return(View(doctor)); }