Esempio n. 1
0
        public ActionResult Index()
        {
            DoctorTimeModel model = new DoctorTimeModel();

            model.DoctorTimeList = pro.GetDoctosrNameList();
            return(View(model));
        }
Esempio n. 2
0
        public ActionResult IndividualDoctorTimeDetails(int id)
        {
            DoctorTimeModel model = new DoctorTimeModel();

            model.DoctorTimeList = pro.GetById(id);
            return(PartialView(model));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 5
0
        public ActionResult ShowAllData(int id)
        {
            DoctorTimeModel model = new DoctorTimeModel();

            model.DoctorTimeList = pro.GetById(id);
            return(View(model));
        }
Esempio n. 6
0
        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"));
        }
Esempio n. 8
0
        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));
        }
Esempio n. 9
0
        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"));
        }
Esempio n. 13
0
        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"));
        }
Esempio n. 14
0
 //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);
     }
 }
Esempio n. 15
0
        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);
            }
        }
Esempio n. 16
0
        public ActionResult Create()
        {
            DoctorTimeModel model = new DoctorTimeModel();

            return(View(model));
        }
Esempio n. 17
0
        public ActionResult AddMoreDoctorTime()
        {
            DoctorTimeModel model = new DoctorTimeModel();

            return(PartialView("AddMoreDoctorTime", model));
        }