コード例 #1
0
        protected void btn_view_Click(object sender, ImageClickEventArgs e)
        {
            ScheduleBLL scheduleBLL = new ScheduleBLL();

            scheduleBLL.userId = (Int32)Session["userId"];
            scheduleBLL.readSchedule(Util.StringToDate(this.tb_dateFrom.Text), Util.StringToDate(this.tb_dateTo.Text));
            List <Schedule> scheduleList = scheduleBLL.scheduleList;

            foreach (Schedule schedule in scheduleList)
            {
                Console.WriteLine(schedule.freeSlotTimeFrom);
                Console.WriteLine(schedule.freeSlotTimeTo);
            }

            //   this.saveChanges.Visible = false;
        }
コード例 #2
0
        public static string GetCurrentTime(int userId, string startDate, string endDate)
        {
            ScheduleBLL scheduleBLL = new ScheduleBLL();

            scheduleBLL.userId = userId;
            scheduleBLL.readSchedule(Util.StringToDate(startDate), Util.StringToDate(endDate));
            List <Schedule> scheduleList = scheduleBLL.scheduleList;
            List <string>   allcells     = new List <string>();//E.g 8:00 - 10:00 Then in allcells: 8:00, 8:30, 9:00, 9:30, 10:00

            foreach (Schedule schedule in scheduleList)
            {
                List <String> cells = convertTimeLinetoTimeCell(schedule.freeSlotTimeFrom, schedule.freeSlotTimeTo);
                allcells.AddRange(cells);
            }

            String json = allcells.ToJSON();

            return(json);
        }
コード例 #3
0
        public static string GetGroupTime(int groupId, string name, string startDate, string endDate)
        {
            ScheduleBLL scheduleBLL = new ScheduleBLL();

            // scheduleBLL.userId = (Int32)Session["userId"];
            //scheduleBLL.userId = 1;
            scheduleBLL.readSchedule(Util.StringToDate(startDate), Util.StringToDate(endDate));
            //scheduleBLL.readSchedule(null, null);
            List <Schedule> dss      = scheduleBLL.scheduleList;
            List <string>   allcells = new List <string>();

            foreach (Schedule s in dss)
            {
                List <String> cells = convertTimeLinetoTimeCell(s.freeSlotTimeFrom, s.freeSlotTimeTo);
                allcells.AddRange(cells);
            }

            String json = allcells.ToJSON();


            return(json);
        }