Esempio n. 1
0
        public ViewResult Index()
        {
            CurrentPage = PageTypes.TravelCalendar;
            var model = new CalenderVm();

            model.Candidates = _srv.GetTravelling(model.StartDate, model.EndDate);
            return(View(model));
        }
Esempio n. 2
0
        public JsonResult GetDoctorCalender()
        {
            try
            {
                using (_dbEntities)
                {
                    var  userid   = CookieHelper.Get(StaticValues.SessionUserId);
                    long doctorId = 0;
                    if (!string.IsNullOrWhiteSpace(userid))
                    {
                        doctorId = Convert.ToInt64(userid);
                    }
                    var response    = new List <CalenderVm>();
                    var appointment = _dbEntities.Appointments.Where(s => s.DoctorId == doctorId).ToList();

                    if (appointment.Any())
                    {
                        foreach (var item in appointment)
                        {
                            if (Request.Url != null)
                            {
                                var calData = new CalenderVm
                                {
                                    id    = item.AppointmentId,
                                    end   = item.AppointmentDate.ToString("yyyy-MM-dd"),
                                    start = item.AppointmentDate.ToString("yyyy-MM-dd")
                                };

                                if (Request.Url != null)
                                {
                                    calData.url = Url.Action("Appointments", "Doctor", "", protocol: Request.Url.Scheme);
                                }

                                if (item.IsRejected)
                                {
                                    calData.title = "Rejected Apmt: " + item.Fullname;
                                }
                                else
                                {
                                    if (item.IsConfirm)
                                    {
                                        calData.title = "Confirm Apmt: " + item.Fullname;
                                    }
                                    else
                                    {
                                        calData.title = "Pending Apmt: " + item.Fullname;
                                    }
                                }

                                response.Add(calData);
                            }
                        }
                    }


                    return(Json(new { status = true, data = response.ToArray() }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Esempio n. 3
0
 public ViewResult Index(CalenderVm model)
 {
     model.Candidates = _srv.GetTravelling(model.StartDate, model.EndDate);
     return(View(model));
 }