public ActionResult DoctorSpecialist() { DoctorTypeSetupModel model = new DoctorTypeSetupModel(); model = pro.GetDoctorSpecialistList(); return(View(model)); }
public ActionResult Details(int id) { DoctorTypeSetupModel model = new DoctorTypeSetupModel(); model = pro.GetListofDoctorTypeSetupModel().Where(x => x.DoctorTypeId == id).FirstOrDefault(); return(View(model)); }
public ActionResult Index() { DoctorTypeSetupModel obj = new DoctorTypeSetupModel(); obj.lstOfDoctorTypeSetupModel = pro.GetListofDoctorTypeSetupModel(); return(View(obj)); }
public DoctorTypeSetupModel GetDoctorSpecialistByDoctorId(int DoctorId) { DoctorTypeSetupModel model = new DoctorTypeSetupModel(); using (EHMSEntities ent = new EHMSEntities()) { var result = ent.DoctorsDiseases.Where(x => x.Status == true && x.DoctorID == DoctorId).ToList(); if (result.Count() > 0) { foreach (var item in result) { var ObjModel = new DoctorSpecialistViewModel() { DepartmentID = item.DepartmentID, DiseaseID = item.DiseaseID, DoctorDiseaseID = item.DoctorDiseaseID, DiseaseName = item.DiseaseName, DoctorID = item.DoctorID }; model.DoctorSpecialistViewModelList.Add(ObjModel); } } return(model); } }
public ActionResult Edit(int id) { EHMSEntities ent = new EHMSEntities(); DoctorTypeSetupModel model = new DoctorTypeSetupModel(); model = pro.GetListofDoctorTypeSetupModel().Where(x => x.DoctorTypeId == id).FirstOrDefault(); return(View(model)); }
public int insert(DoctorTypeSetupModel model) { int i = 0; var objToSave = AutoMapper.Mapper.Map <DoctorTypeSetupModel, DoctorTypeSetup>(model); ent.DoctorTypeSetups.Add(objToSave); i = ent.SaveChanges(); return(i); }
public int Update(DoctorTypeSetupModel model) { int i = 0; EHMSEntities ent = new EHMSEntities(); var objToEdit = ent.DoctorTypeSetups.Where(x => x.DoctorTypeId == model.DoctorTypeId).FirstOrDefault(); AutoMapper.Mapper.Map(model, objToEdit); // ent.Entry(objToEdit).State = System.Data.EntityState.Modified; ent.Entry(objToEdit).State = System.Data.EntityState.Modified; i = ent.SaveChanges(); return(i); }
public ActionResult Edit(DoctorTypeSetupModel model) { int i = pro.Update(model); if (i != 0) { TempData["success"] = HospitalManagementSystem.UtilityMessage.edit; return(RedirectToAction("Index")); } else { TempData["success"] = HospitalManagementSystem.UtilityMessage.editfailed; return(RedirectToAction("Index")); } }
public ActionResult Create(DoctorTypeSetupModel model) { int i = pro.insert(model); if (i != 0) { TempData["success"] = HospitalManagementSystem.UtilityMessage.save; } else { TempData["success"] = HospitalManagementSystem.UtilityMessage.savefailed; } return(RedirectToAction("Index")); }
public bool InsertIntoDoctorDisease(DoctorTypeSetupModel model) { using (EHMSEntities ent = new EHMSEntities()) { var result = new DoctorsDisease() { DepartmentID = model.ObjDoctorSpecialistViewModel.DepartmentID, DoctorID = model.ObjDoctorSpecialistViewModel.DoctorID, DiseaseID = model.ObjDoctorSpecialistViewModel.DiseaseID, DiseaseName = model.ObjDoctorSpecialistViewModel.DiseaseName, Status = true, BranchId = 1 }; ent.DoctorsDiseases.Add(result); ent.SaveChanges(); return(true); } }
public ActionResult CreateDoctorSpecialist() { DoctorTypeSetupModel model = new DoctorTypeSetupModel(); return(View(model)); }