public ActionResult Edit(int id)
        {
            iDiary Diary = new iDiary();

            try
            {
                if (Diary.GetAppointmentbyID(id))
                {
                    String.Format("{0:d/M/yyyy HH:mm}", Diary.Appointments[0].EndDate);
                    String.Format("{0:d/M/yyyy HH:mm}", Diary.Appointments[0].DueDate);

                    Diary.GetAllDiaryLogsbyID(id);
                }
                else
                {
                    Diary.Appointments = new List<DiaryAppointment>();
                    Diary.Reminders = new List<AquariumDiaryManagement.Reminder>();

                    Diary.Appointments.Add(new DiaryAppointment());
                    Diary.Reminders.Add(new AquariumDiaryManagement.Reminder());

                    Diary.Appointments[0].EndDate = DateTime.Now.AddDays(7);
                    Diary.Appointments[0].DueDate = DateTime.Now;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return View(Diary);
        }
        public ActionResult Complete(int id)
        {
            iDiary Diary = new iDiary();

            try
            {
                if (Diary.GetAppointmentbyID(id))
                {
                    Diary.Appointments[0].Completed = true;
                    Diary.Appointments[0].EndDate = DateTime.Now;

                    Diary.AddDiaryAppointment();
                    Diary.AddDiaryLog(Diary.Appointments[0].DiaryAppointmentID, 5, DateTime.Now, Diary.Appointments[0].CreatedBy, "Task Completed");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return RedirectToAction("Index", "iDiary");
        }