// GET: Doctor/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DoctorViewModel doctorViewModel = doctorModel.GetDoctor((int)id); if (doctorViewModel == null) { return(HttpNotFound()); } return(View(doctorViewModel)); }
// GET: DoctorsList/Edit/5 public ActionResult Edit(int id) { DoctorModel Model = new DoctorModel(); Doctor doctor = new Doctor(Model.GetDoctor(id)); DoctorViewModel viewModel = new DoctorViewModel(doctor); return(View(viewModel)); }
//[HttpGet] public ActionResult Delete(Doctor d) { //var doctor = (Doctor)TempData["doctor"]; DoctorModel Model = new DoctorModel(); Doctor doctor = new Doctor(Model.GetDoctor(d.ID)); Model.Delete(doctor); return(RedirectToAction("Index")); }
// GET: DoctorsList/Delete/5 public ActionResult Delete(int id) { DoctorModel Model = new DoctorModel(); Doctor doctor = new Doctor(Model.GetDoctor(id)); DoctorViewModel viewModel = new DoctorViewModel(doctor); //TempData["doctor"] = doctor; return(View(viewModel)); }