public ActionResult List(int ID, double EndDate, int completed)
        {
            iDiary Diary = new iDiary();

            Diary.StartDate = DateTime.Now.AddMonths(-6);
            Diary.EndDate = UnixTimeStampToDateTime(EndDate);

            try
            {
                if (!Diary.GetAppointments(ID, completed))
                {
                    //ModelState.AddModelError("", "Error!");
                    Diary.Appointments = new List<DiaryAppointment>();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return PartialView(Diary);
        }
        public JsonResult GetCalendar(double start, double end, int ID, int completed)
        {
            iDiary Diary = new iDiary();
            var events = new List<Calendar>();

            Diary.StartDate = UnixTimeStampToDateTime(start);
            Diary.EndDate = UnixTimeStampToDateTime(end);

            try
            {
                if (!Diary.GetAppointments(ID, completed))
                {
                    //ModelState.AddModelError("", "Error!");
                    Diary.Appointments = new List<DiaryAppointment>();
                }

                events = ToCalendarist(Diary);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            var rows = events.ToArray();
            return Json(rows, JsonRequestBehavior.AllowGet);
        }