public ActionResult DeleteConfirmed(Guid id)
        {
            DoctorPatientMapping doctorPatientMapping = db.DoctorPatientMappings.Find(id);

            db.DoctorPatientMappings.Remove(doctorPatientMapping);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,PatientDetailsId,DoctorDetailsId,FromDateTime,ToDateTime,IsCancelled")] DoctorPatientMapping doctorPatientMapping)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doctorPatientMapping).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DoctorDetailsId  = new SelectList(db.DoctorDetails, "Id", "Name", doctorPatientMapping.DoctorDetailsId);
     ViewBag.PatientDetailsId = new SelectList(db.PatientDetails, "Id", "Name", doctorPatientMapping.PatientDetailsId);
     return(View(doctorPatientMapping));
 }
        public ActionResult Create([Bind(Include = "Id,PatientDetailsId,DoctorDetailsId,FromDateTime,ToDateTime,IsCancelled")] DoctorPatientMapping doctorPatientMapping)
        {
            if (ModelState.IsValid)
            {
                doctorPatientMapping.Id = Guid.NewGuid();
                db.DoctorPatientMappings.Add(doctorPatientMapping);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DoctorDetailsId  = new SelectList(db.DoctorDetails, "Id", "Name", doctorPatientMapping.DoctorDetailsId);
            ViewBag.PatientDetailsId = new SelectList(db.PatientDetails, "Id", "Name", doctorPatientMapping.PatientDetailsId);
            return(View(doctorPatientMapping));
        }
        // GET: DoctorPatientMappings/Details/5
        public ActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DoctorPatientMapping doctorPatientMapping = db.DoctorPatientMappings.Find(id);

            if (doctorPatientMapping == null)
            {
                return(HttpNotFound());
            }
            return(View(doctorPatientMapping));
        }
        // GET: DoctorPatientMappings/Edit/5
        public ActionResult Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DoctorPatientMapping doctorPatientMapping = db.DoctorPatientMappings.Find(id);

            if (doctorPatientMapping == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DoctorDetailsId  = new SelectList(db.DoctorDetails, "Id", "Name", doctorPatientMapping.DoctorDetailsId);
            ViewBag.PatientDetailsId = new SelectList(db.PatientDetails, "Id", "Name", doctorPatientMapping.PatientDetailsId);
            return(View(doctorPatientMapping));
        }