public void update(List <string> timecells, DateTime fromDate, DateTime toDate)
        {
            convertToMap(timecells);// Key:date Value: timecells
            ScheduleDAL   dal  = new ScheduleDAL();
            SqlConnection conn = DBManager.getSqlConnection();

            conn.Open();

            // foreach (String dtStr in this.timeCellMap.Keys)
            DateTime dateRange = fromDate;

            while (dateRange <= toDate)
            {
                DateTime scheduleDate = dateRange;//Util.StringToDate(dtStr) ?? DateTime.MaxValue;
                dal.delete(conn, this.userId, scheduleDate);
                dateRange = dateRange.AddDays(1);
            }

            foreach (String dtStr in this.timeCellMap.Keys)
            {
                DateTime scheduleDate = Util.StringToDate(dtStr) ?? DateTime.MaxValue;
                var      fromToList   = mergeCells(timeCellMap[dtStr]);

                foreach (Dictionary <String, DateTime> fromTo in fromToList)
                {
                    if (fromTo != null)
                    {
                        dal.insert(conn, this.userId, scheduleDate, fromTo["From"], fromTo["To"].AddMinutes(30), "Y");
                    }
                }
            }

            conn.Close();
        }