Beispiel #1
0
        // devsolution 2003/6/17: Finished - Added items for calendar control

        /// <summary>
        /// devsolution 2003/6/17:
        /// Change to make a RenderEvents for modularity
        ///	Routine to add show calendar logic
        ///	And Clean up code as now the calendar next and previous
        ///	controls must re-render the display and get the data again
        ///	e.g. modularize the code
        /// </summary>
        /// <param name="DisplayMonth">Month to display 1=Jan, 2=Feb, etc</param>
        /// <param name="DisplayYear">Year to display YYYY, 2003 for 2003</param>
        private void RenderEvents(int DisplayMonth, int DisplayYear)
        {
            EventsDB events = new EventsDB();

            myDataList.RepeatDirection = (Settings["RepeatDirectionSetting"].ToString() == "Horizontal" ?     RepeatDirection.Horizontal : RepeatDirection.Vertical);
            myDataList.RepeatColumns   = Int32.Parse(Settings["RepeatColumns"].ToString());

            if (bool.Parse(Settings["ShowBorder"].ToString()))
            {
                //myDataList.BorderWidth=Unit.Pixel(1);
                myDataList.ItemStyle.BorderWidth = Unit.Pixel(1);
            }
            dsEventData           = events.GetEvents(ModuleID, Version);
            myDataList.DataSource = dsEventData;
            myDataList.DataBind();

            // devsolution 2003/6/17: Added items for calendar control
            if (bool.Parse(Settings["ShowCalendar"].ToString()))
            {
                CalendarPanel.Visible = true;
                string DisplayDate = string.Empty;
                // devsolution 2003/6/17: Must have Devsolution.Portal.dll in \bin for calendar display functionality
                DevSolution.Portal.EventCalendar eventcalendar = new DevSolution.Portal.EventCalendar();
                lblCalendar.Text    = eventcalendar.GenerateCalendar(ModuleID, DisplayMonth, DisplayYear, out DisplayDate, dsEventData);
                lblDisplayDate.Text = DisplayDate;
            }
            // devsolution 2003/6/17: Finished - Added items for calendar control

            myDataList.DataSource = dsEventData;
            myDataList.DataBind();
        }
Beispiel #2
0
 /// <summary>
 /// Wrapper to call Devsolution.Portal dll
 /// If all day should not return anything
 /// if time passed and not allday should display in HH:MM AM or HH:MM PM format
 /// </summary>
 /// <param name="AllDay"></param>
 /// <param name="StartTime"></param>
 /// <returns></returns>
 public string DisplayTime(bool AllDay, object StartTime)
 {
     DevSolution.Portal.EventCalendar eventcalendar = new DevSolution.Portal.EventCalendar();
     return(eventcalendar.DisplayTime(AllDay, StartTime));
 }