public static string UpdateEventTime(ImproperCalendarEvent improperEvent)
        {
            List <int> idList = (List <int>)System.Web.HttpContext.Current.Session["idList"];

            if (idList != null && idList.Contains(improperEvent.id))
            {
                // FullCalendar 1.x
                //EventDAO.updateEventTime(improperEvent.id,
                //    DateTime.ParseExact(improperEvent.start, "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture),
                //    DateTime.ParseExact(improperEvent.end, "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture));

                // FullCalendar 2.x
                EventDAO.updateEventTime(improperEvent.id,
                                         Convert.ToDateTime(improperEvent.start).ToUniversalTime(),
                                         Convert.ToDateTime(improperEvent.end).ToUniversalTime(),
                                         improperEvent.allDay);  //allDay parameter added for FullCalendar 2.x

                return("updated event with id:" + improperEvent.id + " update start to: " + improperEvent.start +
                       " update end to: " + improperEvent.end);
            }

            return("unable to update event with id: " + improperEvent.id);
        }
        public static int addEvent(ImproperCalendarEvent improperEvent)
        {
            // FullCalendar 1.x
            //CalendarEvent cevent = new CalendarEvent()
            //{
            //    title = improperEvent.title,
            //    description = improperEvent.description,
            //    start = DateTime.ParseExact(improperEvent.start, "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture),
            //    end = DateTime.ParseExact(improperEvent.end, "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture)
            //};

            // FullCalendar 2.x
            CalendarEvent cevent = new CalendarEvent()
            {
                title       = improperEvent.title,
                description = improperEvent.description,
                start       = Convert.ToDateTime(improperEvent.start).ToUniversalTime(),
                end         = Convert.ToDateTime(improperEvent.end).ToUniversalTime(),
                allDay      = improperEvent.allDay
            };

            if (CheckAlphaNumeric(cevent.title) && CheckAlphaNumeric(cevent.description))
            {
                int key = EventDAO.addEvent(cevent);

                List <int> idList = (List <int>)System.Web.HttpContext.Current.Session["idList"];

                if (idList != null)
                {
                    idList.Add(key);
                }

                return(key); //return the primary key of the added cevent object
            }

            return(-1); //return a negative number just to signify nothing has been added
        }