public ActionResult Index() { DoctorTimeModel model = new DoctorTimeModel(); model.DoctorTimeList = pro.GetDoctosrNameList(); return(View(model)); }
public ActionResult IndividualDoctorTimeDetails(int id) { DoctorTimeModel model = new DoctorTimeModel(); model.DoctorTimeList = pro.GetById(id); return(PartialView(model)); }
public ActionResult Edit(int id) { DoctorTimeModel model = new DoctorTimeModel(); model.DoctorTimeList = pro.EditData(id); return(PartialView("Edit", model)); }
public ActionResult Index() { int docid = -1; if (Session["doctorid"] == null) { return(RedirectToAction("Authenticate", "Login")); } else { docid = Convert.ToInt32(Session["doctorid"]); } var dblist = db.tblDoctorTimes.Where(x => x.intDoctorID == docid).ToList(); List <DoctorTimeModel> list = new List <DoctorTimeModel>(); foreach (tblDoctorTime T in dblist) { DoctorTimeModel t = new DoctorTimeModel(); t.TimeId = T.intTimeID; t.DoctorId = (int)T.intClinicID; t.ClinicId = (int)T.intClinicID; t.DayNo = (int)T.intDayNo; t.FromTime = (DateTime)T.dtmFromTime; t.ToTime = (DateTime)T.dtmToTime; t.Charges = (decimal)T.decCharges; list.Add(t); } return(View(list)); }
public ActionResult ShowAllData(int id) { DoctorTimeModel model = new DoctorTimeModel(); model.DoctorTimeList = pro.GetById(id); return(View(model)); }
public ActionResult DoctorTimeSearh() { EHMSEntities ent = new EHMSEntities(); DoctorTimeModel model = new DoctorTimeModel(); //model.selectList=new SelectList (ent.SetupDoctorMaster.ToList(),"",""); return(View(model)); }
public ActionResult Delete(DoctorTimeModel N) { var d = db.tblDoctorTimes.SingleOrDefault(x => x.intTimeID == N.TimeId); db.tblDoctorTimes.Remove(d); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult _DoctorTimeDetails(int DoctorID, string DoctorDays) { DoctorTimeModel model = new DoctorTimeModel(); model.DoctorTimeList = pro.GetDoctorTimeDetails(DoctorID, DoctorDays); if (model.DoctorTimeList.Count == 0) { TempData["NOTFOUND"] = "0"; } return(PartialView("_DoctorTimeDetails", model)); }
public ActionResult GetData(TimeSpan stime, TimeSpan etime, int cp, int wp, int did) { DoctorTimeModel model = new DoctorTimeModel(); model.StartTime = stime; model.EndTime = etime; model.CheckPatientPerDay = cp; model.WebPatientPerDay = wp; model.DoctorAvailableTimeId = did; DoctorTimeProvider pro = new DoctorTimeProvider(); pro.Update(model); return(null); }
public ActionResult Details(int?id) { tblDoctorTime D = db.tblDoctorTimes.SingleOrDefault(x => x.intTimeID == id); DoctorTimeModel N = new DoctorTimeModel() { TimeId = D.intTimeID, DoctorId = (int)D.intDoctorID, ClinicId = (int)D.intClinicID, DayNo = (int)D.intDayNo, FromTime = (DateTime)D.dtmFromTime, ToTime = (DateTime)D.dtmToTime, Charges = (decimal)D.decCharges, }; return(View(N)); }
public ActionResult Edit(DoctorTimeModel dm) { tblDoctorTime t = db.tblDoctorTimes.SingleOrDefault(x => x.intTimeID == dm.TimeId); if (t != null) { t.dtmFromTime = dm.FromTime; t.dtmToTime = dm.ToTime; t.decCharges = dm.Charges; t.intClinicID = dm.ClinicId; t.intDayNo = dm.DayNo; t.intDoctorID = dm.DoctorId; db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Create(DoctorTimeModel D) { tblDoctorTime dr = new tblDoctorTime(); // dr.intTimeID = D.TimeId; dr.intDoctorID = Convert.ToInt32(Session["doctorid"].ToString()); dr.intClinicID = D.ClinicId; dr.intDayNo = D.DayNo; dr.dtmFromTime = D.FromTime; dr.dtmToTime = D.ToTime; dr.decCharges = D.Charges; db.tblDoctorTimes.Add(dr); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(DoctorTimeModel model) { if (model.DoctorTimeList == null) { return(RedirectToAction("Create")); } else { foreach (var item in model.DoctorTimeList) { if (item.StartTime == null || item.EndTime == null) { TempData["notSave"] = "0"; return(RedirectToAction("Create")); } } } EHMSEntities ent = new EHMSEntities(); if (ModelState.IsValid) { ViewBag.Data = ent.SetupDoctorAvailableTimes.Where(m => m.DoctorID == model.DoctorID).ToList(); int i = 0; i = pro.Insert(model); if (i != 0) { TempData["success"] = UtilityMessage.save; return(RedirectToAction("Index")); } else { TempData["success"] = UtilityMessage.savefailed; return(RedirectToAction("Index")); } //ViewBag.Data = ent.SetupDoctorAvailableTime.Where(m => m.DoctorID == model.DoctorID).ToList(); } return(RedirectToAction("Index")); }
//Update public int Update(DoctorTimeModel model) { using (EHMSEntities ent = new EHMSEntities()) { var UpdateData = ent.SetupDoctorAvailableTimes.Where(m => m.DoctorAvailableTimeId == model.DoctorAvailableTimeId).SingleOrDefault(); model.CreatedBy = UpdateData.CreatedBy; model.DoctorID = UpdateData.DoctorID; model.Shift = UpdateData.Shift; model.DoctorFee = UpdateData.DoctorFee; model.CreatedDate = UpdateData.CreatedDate; model.MaxTokenNumber = UpdateData.MaxTokenNumber; model.DoctorDays = UpdateData.DoctorDays; model.Status = UpdateData.Status; model.Remarks = UpdateData.Remarks; AutoMapper.Mapper.Map(model, UpdateData); ent.Entry(UpdateData).State = System.Data.EntityState.Modified; ent.SaveChanges(); return(1); } }
public int Insert(DoctorTimeModel model) { int i = 0; using (EHMSEntities ent = new EHMSEntities()) { var doctorTime = AutoMapper.Mapper.Map <DoctorTimeModel, SetupDoctorAvailableTime>(model); doctorTime.DoctorID = model.DoctorID; doctorTime.DoctorDays = model.DoctorDays; foreach (var item in model.DoctorTimeList) { if (model.DoctorDays == null) { string day = ""; for (int d = 1; d <= 7; d++) { // @Hospital.Utility.GetIpdWardName().Where(x => x.Value == Model.IpdPatientroomDetailsModel.WardNo.ToString()).Select(x => x.Text).SingleOrDefault() //day=Hospital.Utility.GetDayOfWeek()Select(x=>x.Text).Single(); //if (i == 1) //{ // day = "Sunday"; //} //if(i==) day = HospitalManagementSystem.Utility.getDayName(d); var ObjDocotrTime = AutoMapper.Mapper.Map <DoctorTimeModel, SetupDoctorAvailableTime>(model); ObjDocotrTime.DoctorID = model.DoctorID; ObjDocotrTime.DoctorDays = day; ObjDocotrTime.Shift = item.Shift; ObjDocotrTime.StartTime = item.StartTime; ObjDocotrTime.EndTime = item.EndTime; ObjDocotrTime.CheckPatientPerDay = item.CheckPatientPerDay; ObjDocotrTime.WebPatientPerDay = item.WebPatientPerDay; ObjDocotrTime.DoctorFee = 0; ObjDocotrTime.MaxTokenNumber = 0; ObjDocotrTime.Remarks = item.Remarks; ObjDocotrTime.CreatedBy = 1; ObjDocotrTime.CreatedDate = DateTime.Now; ObjDocotrTime.Status = true; ent.SetupDoctorAvailableTimes.Add(ObjDocotrTime); i = ent.SaveChanges(); } } else { var ObjDocotrTime = AutoMapper.Mapper.Map <DoctorTimeModel, SetupDoctorAvailableTime>(model); ObjDocotrTime.DoctorID = model.DoctorID; ObjDocotrTime.DoctorDays = model.DoctorDays; ObjDocotrTime.Shift = item.Shift; ObjDocotrTime.StartTime = item.StartTime; ObjDocotrTime.EndTime = item.EndTime; ObjDocotrTime.CheckPatientPerDay = item.CheckPatientPerDay; ObjDocotrTime.WebPatientPerDay = item.WebPatientPerDay; ObjDocotrTime.DoctorFee = 0; ObjDocotrTime.MaxTokenNumber = 0; ObjDocotrTime.Remarks = item.Remarks; ObjDocotrTime.CreatedBy = 1; ObjDocotrTime.CreatedDate = DateTime.Now; ObjDocotrTime.Status = true; ent.SetupDoctorAvailableTimes.Add(ObjDocotrTime); i = ent.SaveChanges(); } } return(i); } }
public ActionResult Create() { DoctorTimeModel model = new DoctorTimeModel(); return(View(model)); }
public ActionResult AddMoreDoctorTime() { DoctorTimeModel model = new DoctorTimeModel(); return(PartialView("AddMoreDoctorTime", model)); }