//GET:/Dermatologists/Edit/5
        public ActionResult Edit(int id)
        {
            ViewBag.ProfId = new SelectList(db.doctorprefesions, "ProfId", "ProfName"); //Learn to do this with repository
            DermatologistsDoctor dermagologist = interfaceobj.GetModelByID(id);

            return(View(dermagologist));
        }
 public ActionResult Edit(DermatologistsDoctor dermatologist)
 {
     try
     {
         if (ModelState.IsValid)
         {
             interfaceobj.UpdateModel(dermatologist);
             interfaceobj.Save();
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException)
     {
         ModelState.AddModelError(string.Empty, "Unable to save changes.Try again, and if the problem persists contact your system administrator.");
     }
     ViewBag.ProfId = new SelectList(db.doctorprefesions, "ProfId", "ProfName", dermatologist.ProfId);
     return(View(dermatologist));
 }
        // GET: /Dermatologist/Delete/5
        public ActionResult Delete(int id)
        {
            DermatologistsDoctor dermatologist = interfaceobj.GetModelByID(id);

            return(View(dermatologist));
        }