Hi
I have set the limit of appointments to show on a specific day in the month view to 5, so when there are more than that number on that day the "more.." link appears. Although when it is clicked it doesnt do anything, should it goto the day view on clicking? as at the moment it does nothing.
Thanks
I have set the limit of appointments to show on a specific day in the month view to 5, so when there are more than that number on that day the "more.." link appears. Although when it is clicked it doesnt do anything, should it goto the day view on clicking? as at the moment it does nothing.
Thanks
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="calendars.aspx.cs" Inherits="modules_Admissions_calendars_calendars" Trace="false"%> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <style type="text/css"> |
| .disableDelete .rsAptDelete |
| { |
| display: none; |
| } |
| div.RadScheduler_Office2007 .rsMonthView .rsTodayCell |
| { |
| background-color:silver; |
| } |
| .ableToMove |
| { |
| cursor:pointer; |
| } |
| </style> |
| </head> |
| <body style="background-color: White" > |
| <form id="form1" runat="server" > |
| <Telerik:RadScriptManager runat="Server" ID="RadScriptManager1" /> |
| <script type="text/javascript"> |
| var intCalendarWidth = 0; |
| var intCalendarHeight = 0; |
| /* Firefox resize scrollable content */ |
| function hideScrollableArea(sender, eventArgs) { |
| if ($telerik.isFirefox) |
| $telerik.$('.rsContentScrollArea').css('overflow', 'hidden'); |
| } |
| function showScrollableArea(sender, eventArgs) { |
| if ($telerik.isFirefox) |
| $telerik.$('.rsContentScrollArea').css('overflow', 'auto'); |
| } |
| function OnClientAppointmentEditing(sender, eventArgs) |
| { |
| var appointmentObject = eventArgs.get_appointment(); |
| arrayAppointmentID = appointmentObject.get_id().split('_'); |
| if (arrayAppointmentID[0].toUpperCase() != "INTERVIEW" && arrayAppointmentID[0].toUpperCase() != "VISIT") |
| { |
| eventArgs.set_cancel(true); |
| } |
| else |
| { |
| eventArgs.set_cancel(false); |
| } |
| } |
| function OnClientAppointmentMoveStart(sender, eventArgs) |
| { |
| var appointmentObject = eventArgs.get_appointment(); |
| arrayAppointmentID = appointmentObject.get_id().split('_'); |
| if (arrayAppointmentID[0].toUpperCase() != "INTERVIEW" && arrayAppointmentID[0].toUpperCase() != "VISIT") |
| { |
| eventArgs.set_cancel(true); |
| } |
| else |
| { |
| eventArgs.set_cancel(false); |
| } |
| } |
| function OnClientAppointmentEditing(sender, eventArgs) |
| { |
| if (eventArgs.get_appointment()) |
| eventArgs.set_cancel(true); |
| } |
| function OnClientAppointmentInserting(sender, eventArgs) |
| { |
| eventArgs.set_cancel(true); |
| } |
| function OnClientAppointmentResizeStart(sender, eventArgs) |
| { |
| eventArgs.set_cancel(true); |
| } |
| function OnClientTimeSlotClick(sender, eventArgs) |
| { |
| //alert(eventArgs.get_time()); |
| } |
| </script> |
| <Telerik:RadAjaxManager runat="Server" ID="RadAjaxManager1"> |
| <AjaxSettings> |
| <Telerik:AjaxSetting AjaxControlID="RadCalendar1"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="RadCalendar2"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadCalendar1" /> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="chkVisits"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="chkInterviews"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="chkDOB"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="chkRegistered"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="chkEnquiry"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="chkProspectus"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="chkWithdrawn"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="chkRejected"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| <Telerik:AjaxSetting AjaxControlID="RadScheduler1"> |
| <UpdatedControls> |
| <Telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </Telerik:AjaxSetting> |
| </AjaxSettings> |
| </Telerik:RadAjaxManager> |
| <Telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Office2007"/> |
| <Telerik:RadSplitter runat="server" ID="RadSplitter1" PanesBorderSize="0" Width="100%" Height="100%" Skin="Office2007" > |
| <!-- the scheduler view --> |
| <Telerik:RadPane runat="Server" ID="leftPane" Scrolling="None"> |
| <div style="padding:10px 0px 10px 10px;"> |
| <Telerik:RadScheduler Culture="en-GB" runat="server" ID="RadScheduler1" Skin="Office2007" EnableEmbeddedSkins="True" |
| ShowFooter="true" DayStartTime="08:00:00" DayEndTime="21:00:00" SelectedView="MonthView" |
| TimeZoneOffset="00:00:00" OverflowBehavior="Expand" Height="100%" |
| TimelineView-UserSelectable="false" ReadOnly="false" |
| FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" CustomAttributeNames="customTitle, calendarType" |
| OnClientAppointmentMoveStart="OnClientAppointmentMoveStart" ShowAllDayRow="true" OnFormCreated="RadScheduler1_FormCreated" |
| MinimumInlineFormWidth="300" MinimumInlineFormHeight="150" MinutesPerRow="15" TimeLabelRowSpan="1" |
| HoursPanelTimeFormat="HH:mm:tt" MonthView-VisibleAppointmentsPerDay="5" |
| OnClientAppointmentInserting="OnClientAppointmentInserting" |
| OnClientAppointmentEditing="OnClientAppointmentEditing" |
| OnClientAppointmentResizeStart="OnClientAppointmentResizeStart" |
| OnClientTimeSlotClick="OnClientTimeSlotClick" |
| > |
| <AppointmentTemplate> |
| <asp:Label ID="lblTitle" runat="server"><%# Eval("customTitle") %></asp:Label> |
| </AppointmentTemplate> |
| <InlineInsertTemplate> |
| <div id="InlineInsertTemplate"> |
| <table width="100%" border="0"> |
| <tr> |
| <td align="right">Note</td> |
| <td> |
| <asp:TextBox ID="txtboxNote" runat="server" TextMode="MultiLine" Width="100%" Height="50px"></asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td align="right">Appointment Type</td> |
| <td> |
| <asp:HiddenField ID="hiddenCalendarTypes" runat="server" Value='<%# Bind("calendarType") %>' /> |
| <asp:DropDownList ID="ddlCalendarTypes" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlCalendarTypes_selectedIndexChanged"></asp:DropDownList> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2" align="right"> |
| <table> |
| <tr> |
| <td> |
| <iSAMS:iSAMSButton ID="InsertButton" runat="server" CommandName="Insert" Text="Submit"/></iSAMS:iSAMSButton> |
| </td> |
| <td> </td> |
| <td> |
| <iSAMS:iSAMSButton ID="CancelButton" runat="server" CommandName="Insert" Text="Cancel"/></iSAMS:iSAMSButton> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </div> |
| </InlineInsertTemplate> |
| </Telerik:RadScheduler> |
| </div> |
| </Telerik:RadPane> |
| <Telerik:RadPane runat="Server" ID="RightPane" Width="240px" MinWidth="240" MaxWidth="240" |
| Scrolling="None" OnClientBeforeResize="hideScrollableArea" OnClientResized="showScrollableArea" |
| OnClientBeforeExpand="hideScrollableArea" OnClientExpanded="showScrollableArea" |
| OnClientBeforeCollapse="hideScrollableArea" OnClientCollapsed="showScrollableArea" > |
| <div style="padding:10px"> |
| <div class="calendar-container" align="center" style="padding-bottom:10px"> <!-- holds the calendar--> |
| <Telerik:RadCalendar runat="server" ID="RadCalendar1" Skin="Office2007" AutoPostBack="true" |
| EnableMultiSelect="false" DayNameFormat="FirstTwoLetters" EnableNavigation="true" |
| EnableMonthYearFastNavigation="false" OnSelectionChanged="RadCalendar1_SelectionChanged" |
| Width="220px" > |
| </Telerik:RadCalendar> |
| </div> |
| <!-- the checkbox selectors --> |
| <Telerik:RadPanelBar runat="server" Skin="Office2007" ID="PanelBarMarketing" Width="100%"> |
| <Items> |
| <Telerik:RadPanelItem runat="server" Text="Marketing" Expanded="true" Width="100%"> |
| <Items> |
| <Telerik:RadPanelItem runat="server" ID="PanelBarMarketingCheckboxes"> |
| <ItemTemplate> |
| <div> |
| <div> |
| <asp:CheckBox ID="chkVisits" runat="server" Text="Visits" Checked="true" AutoPostBack="true" |
| OnCheckedChanged="CheckBoxes_CheckedChanged" /> |
| </div> |
| <div> |
| <asp:CheckBox ID="chkInterviews" runat="server" Text="Interviews" Checked="true" AutoPostBack="true" |
| OnCheckedChanged="CheckBoxes_CheckedChanged" /> |
| </div> |
| </div> |
| </ItemTemplate> |
| </Telerik:RadPanelItem> |
| </Items> |
| </Telerik:RadPanelItem> |
| </Items> |
| </Telerik:RadPanelBar> |
| <Telerik:RadPanelBar runat="server" Skin="Office2007" ID="PanelBarPupil" Width="100%"> |
| <Items> |
| <Telerik:RadPanelItem runat="server" Text="Pupil" Expanded="true"> |
| <Items> |
| <Telerik:RadPanelItem runat="server" ID="PanelBarPupilCheckboxes" > |
| <ItemTemplate> |
| <div> |
| <div > |
| <asp:CheckBox ID="chkDOB" runat="server" Text="DOB" Checked="true" AutoPostBack="true" |
| OnCheckedChanged="CheckBoxes_CheckedChanged" /> |
| </div> |
| <div> |
| <asp:CheckBox ID="chkRegistered" runat="server" Text="Registered" Checked="true" AutoPostBack="true" |
| OnCheckedChanged="CheckBoxes_CheckedChanged" /> |
| </div> |
| <div> |
| <asp:CheckBox ID="chkEnquiry" runat="server" Text="Enquiry" Checked="true" AutoPostBack="true" |
| OnCheckedChanged="CheckBoxes_CheckedChanged" /> |
| </div> |
| <div> |
| <asp:CheckBox ID="chkProspectus" runat="server" Text="Propsectus Sent" Checked="true" AutoPostBack="true" |
| OnCheckedChanged="CheckBoxes_CheckedChanged" /> |
| </div> |
| <div> |
| <asp:CheckBox ID="chkWithdrawn" runat="server" Text="Withdrawn" Checked="true" AutoPostBack="true" |
| OnCheckedChanged="CheckBoxes_CheckedChanged" /> |
| </div> |
| <div> |
| <asp:CheckBox ID="chkRejected" runat="server" Text="Rejected" Checked="true" AutoPostBack="true" |
| OnCheckedChanged="CheckBoxes_CheckedChanged" /> |
| </div> |
| </div> |
| </ItemTemplate> |
| </Telerik:RadPanelItem> |
| </Items> |
| </Telerik:RadPanelItem> |
| </Items> |
| </Telerik:RadPanelBar> |
| </div> |
| </Telerik:RadPane> |
| </Telerik:RadSplitter> |
| <!-- Critical Error Display --> |
| <table id="tblCriticalError" runat="server" width="100%" height="100%" visible="false"> |
| <tr> |
| <td> |
| <iSAMS:InfoTable runat="server" ID="infCriticalError" StyleType="PageError" HeadingText="The following error occurred:" /> |
| </td> |
| </tr> |
| </table> |
| <asp:HiddenField ID="hiddenWidth" runat="server" Value="" /> |
| <asp:HiddenField ID="hiddenHeight" runat="server" Value="" /> |
| </form> |
| </body> |
| </html> |
| #region Using Directives |
| // In-Built assemblies |
| using System; |
| using System.Collections.Generic; |
| using System.Web; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| // iSAMS assemblies |
| using iSAMS.Security; |
| using iSAMS.Services; |
| using iSAMS.Entities; |
| using iSAMS.Web.Controls; |
| using System.Text; |
| using System.Collections; |
| using System.Web.UI.HtmlControls; |
| using iSAMS.Runtime; |
| //telerik namespaces |
| using Telerik.Web.UI; |
| using Telerik.Web.UI.Calendar; |
| // 3rd Party assemblies |
| #endregion Using Directives |
| public partial class modules_Admissions_calendars_calendars :SecurePage |
| { |
| /// <summary> |
| /// telerik stuff |
| /// </summary> |
| private const string ProviderSessionKey = " modules_Admissions_calendars_calendars"; |
| //private Dictionary<int, string> checkBoxIDs; |
| public List<Appointment> appointments = new List<Appointment>(); |
| DateTime dteSelectedDate = new DateTime(); |
| RadCalendar selectionCalendar; |
| string datetimeFilter; |
| #region Page Events |
| /// <summary> |
| /// PreInit |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void Page_PreInit(object sender, EventArgs e) |
| { |
| MSM = new iSAMS.Security.ModuleSecurityManager("ISAMS_ADMISSIONSMANAGER", Global.SystemVars.SYS_UserSecurity); |
| } |
| /// <summary> |
| /// Init |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void Page_Init(object sender, EventArgs e) |
| { |
| //telerik stuff |
| RegisterClientScripts(); |
| WireUpControls(); |
| ApplyStyling(); |
| } |
| /// <summary> |
| /// Load |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| RadScheduler1.DataKeyField = "ID"; |
| RadScheduler1.DataStartField = "Start"; |
| RadScheduler1.DataEndField = "End"; |
| RadScheduler1.DataSubjectField = "Subject"; |
| RadScheduler1.DataRecurrenceField = "RecurrenceRule"; |
| RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID"; |
| if (!IsPostBack) |
| { |
| datetimeFilter = DateTime.Now.ToShortDateString(); |
| //RadScheduler1.SelectedView = SchedulerViewType.DayView; |
| RadCalendar1.SelectedDate = DateTime.Now; |
| BindData(); |
| } |
| else |
| { |
| datetimeFilter = RadCalendar1.SelectedDate.ToShortDateString(); |
| } |
| } |
| #endregion Page Events |
| #region UI Generation |
| /// <summary> |
| /// This method contains all client script registration |
| /// </summary> |
| private void RegisterClientScripts() |
| { |
| } |
| /// <summary> |
| /// This method wires up control events and properties |
| /// </summary> |
| private void WireUpControls() |
| { |
| // TODO : Wire up controls HERE (e.g. btn.Click += new EventHandler(btn_Click);) |
| RadScheduler1.AppointmentDataBound +=new AppointmentDataBoundEventHandler(RadScheduler1_AppointmentDataBound); |
| RadScheduler1.AppointmentCreated += new AppointmentCreatedEventHandler(RadScheduler1_AppointmentCreated); |
| RadScheduler1.AppointmentUpdate += new AppointmentUpdateEventHandler(RadScheduler1_AppointmentUpdate); |
| RadScheduler1.NavigationCommand += new SchedulerNavigationCommandEventHandler(RadScheduler1_NavigationCommand); |
| RadScheduler1.NavigationComplete += new SchedulerNavigationCompleteEventHandler(RadScheduler1_NavigationComplete); |
| RadCalendar1.DayRender += new Telerik.Web.UI.Calendar.DayRenderEventHandler(RadCalendar1_DayRender); |
| RadCalendar1.SelectionChanged += new SelectedDatesEventHandler(RadCalendar1_SelectionChanged); |
| } |
| /// <summary> |
| /// Binds the data based on checkboxes selected |
| /// </summary> |
| private void BindData() |
| { |
| Trace.Warn("Start BindData"); |
| appointments = new List<Appointment>(); |
| CheckBox chkBox1 = PanelBarMarketingCheckboxes.FindControl("chkVisits") as CheckBox; |
| if (chkBox1.Checked) |
| { |
| showVisits(); |
| } |
| CheckBox chkBox2 = PanelBarMarketingCheckboxes.FindControl("chkInterviews") as CheckBox; |
| if (chkBox2.Checked) |
| { |
| showInterviews(); |
| } |
| ShowPupilDetails(); |
| RadScheduler1.DataSource = appointments; |
| RadScheduler1.DataBind(); |
| Trace.Warn("End BindData"); |
| } |
| /// <summary> |
| /// This method retrieves any data from the database and generates the appropriate UI content |
| /// </summary> |
| private void showVisits() |
| { |
| Trace.Warn("Start showVisits"); |
| AdmissionsVisitsService avService = new AdmissionsVisitsService(); |
| using (TList<AdmissionsVisits> avList = avService.GetAll()) |
| { |
| avList.ApplyFilter(delegate(AdmissionsVisits a) |
| { |
| if (!String.IsNullOrEmpty(a.TxtVisitDateTime.ToString())) |
| { |
| DateTime dateTimeShort = DateTime.Parse(a.TxtVisitDateTime.ToString()); |
| if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| { |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView) |
| { |
| return dateTimeShort.Month.Equals(RadCalendar1.SelectedDate.Month); |
| } |
| else |
| { |
| if (DateTime.Parse(dateTimeShort.ToShortDateString()) >= RadScheduler1.VisibleRangeStart && DateTime.Parse(dateTimeShort.ToShortDateString()) <= RadScheduler1.VisibleRangeEnd) |
| { |
| return true; |
| } |
| else |
| { |
| return false; |
| } |
| } |
| } |
| else |
| { |
| return dateTimeShort.ToShortDateString().Equals(RadCalendar1.SelectedDate.ToShortDateString()); |
| } |
| } |
| else |
| { |
| return false; |
| } |
| }, false); |
| foreach (AdmissionsVisits avItem in avList) |
| { |
| DateTime dateTimeShort = DateTime.Parse(avItem.TxtVisitDateTime.ToString()); |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView) |
| { |
| Appointment appointment = new Appointment("Visit_" + avItem.TblAdmissionsVisitsId.ToString(), avItem.TxtVisitDateTime, avItem.TxtVisitDateTime, avItem.TxtNote.ToString()); |
| appointment.Attributes["customTitle"] = "Visit: " + GetPupilName(avItem.TxtSchoolid.ToString()); |
| appointments.Add(appointment); |
| } |
| else |
| { |
| AdmissionsVisitsItineraryService aviService = new AdmissionsVisitsItineraryService(); |
| using (TList<AdmissionsVisitsItinerary> aviList = aviService.GetAll()) |
| { |
| foreach (AdmissionsVisitsItinerary aviItem in aviList) |
| { |
| DateTime dteHolderDateTime = new DateTime(); |
| DateTime dteHolderEndDateTime = new DateTime(); |
| int intDurationHours = 0; |
| int intDurationMinutes = 0; |
| string txtDate = ""; |
| string txtNote = "Visit itinerary[" + GetPupilName(avItem.TxtSchoolid.ToString()) + "]"; |
| string[] arrayDateTime; |
| string[] arrayDurationTime; |
| //arrayDurationTime = aviItem.txtDuration.toString().Split(':'); |
| arrayDateTime = avItem.TxtVisitDateTime.ToString().Split(' '); |
| txtDate = arrayDateTime[0].ToString(); |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + aviItem.TxtTime.ToString()); |
| //dteHolderEndDateTime = DateTime.Parse(txtDate + " " + aviItem.TxtTime.ToString()).AddHours(Int32.Parse(arrayDurationTime[0].ToString())).AddMinutes(Int32.Parse(arrayDurationTime[1].ToString())); |
| if (aviItem.IntVisitId == avItem.TblAdmissionsVisitsId) |
| { |
| txtNote += " " + aviItem.TxtTime.ToString() + " " + aviItem.TxtCategory.ToString(); |
| if (aviItem.TxtNote.ToString() != "") |
| { |
| txtNote += " : " + aviItem.TxtNote.ToString(); |
| } |
| Appointment appointmentItinerary = new Appointment("VisitItinerary_" + aviItem.TblAdmissionsVisitsItineraryId.ToString(), dteHolderDateTime, dteHolderDateTime, aviItem.TxtNote.ToString()); |
| appointmentItinerary.Attributes["customTitle"] = txtNote.ToString(); |
| appointments.Add(appointmentItinerary); |
| } |
| } |
| } |
| } |
| } |
| } |
| Trace.Warn("End showVisits"); |
| } |
| private void showInterviews() |
| { |
| Trace.Warn("Start showInterviews"); |
| AdmissionInterviewNoteService ainService = new AdmissionInterviewNoteService(); |
| using (TList<AdmissionInterviewNote> ainList = ainService.GetAll()) |
| { |
| ainList.ApplyFilter(delegate(AdmissionInterviewNote ain) |
| { |
| if (!String.IsNullOrEmpty(ain.DteInterviewDateTime.ToString())) |
| { |
| DateTime dateTimeShort = DateTime.Parse(ain.DteInterviewDateTime.ToString()); |
| if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| { |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView) |
| { |
| return dateTimeShort.Month.Equals(RadCalendar1.SelectedDate.Month); |
| } |
| else |
| { |
| if (DateTime.Parse(dateTimeShort.ToShortDateString()) >= RadScheduler1.VisibleRangeStart && DateTime.Parse(dateTimeShort.ToShortDateString()) <= RadScheduler1.VisibleRangeEnd) |
| { |
| return true; |
| } |
| else |
| { |
| return false; |
| } |
| } |
| } |
| else |
| { |
| return dateTimeShort.ToShortDateString().Equals(RadCalendar1.SelectedDate.ToShortDateString()); |
| } |
| } |
| else |
| { |
| return false; |
| } |
| }, false); |
| foreach (AdmissionInterviewNote ainItem in ainList) |
| { |
| DateTime dteInterviewDateTime; |
| string txtDate = ""; |
| string txtTime = ""; |
| string[] arrayDateTime; |
| txtDate = ainItem.DteInterviewDateTime.ToString(); |
| arrayDateTime = txtDate.Split(' '); |
| txtDate = arrayDateTime[0].ToString(); |
| txtTime = arrayDateTime[1].ToString(); |
| dteInterviewDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| Appointment appointment = new Appointment("Interview_" + ainItem.TxtSchoolId.ToString(), dteInterviewDateTime, dteInterviewDateTime, "No Interview Notes Available"); |
| appointment.Attributes["customTitle"] = "Interview: " + GetPupilName(ainItem.TxtSchoolId.ToString()); |
| appointments.Add(appointment); |
| } |
| } |
| Trace.Warn("End showInterviews"); |
| } |
| private void ShowPupilDetails() |
| { |
| Trace.Warn("Start ShowPupilDetails"); |
| PupilManagementPupilsService pmpService = new PupilManagementPupilsService(); |
| //all the information that comes from the same table |
| using (TList<PupilManagementPupils> pmpList = pmpService.GetAll()) |
| { |
| /*filters on date*/ |
| CheckBox chkBox3 = PanelBarPupilCheckboxes.FindControl("chkDOB") as CheckBox; |
| if (chkBox3.Checked) |
| { |
| foreach (PupilManagementPupils pmpItem in pmpList) |
| { |
| DateTime dteHolderDateTime = new DateTime(); |
| DateTime dteHolderEndDateTime = new DateTime(); |
| string txtDate = ""; |
| string txtTime = ""; |
| string txtNote = ""; |
| string[] arrayDateTime; |
| Appointment appointment = new Appointment(); |
| if (!String.IsNullOrEmpty(pmpItem.TxtDob.ToString())) |
| { |
| txtDate = pmpItem.TxtDob.ToString(); |
| arrayDateTime = txtDate.Split(' '); |
| txtDate = arrayDateTime[0].ToString(); |
| txtTime = arrayDateTime[1].ToString(); |
| DateTime dateTimeShort = DateTime.Parse(pmpItem.TxtDob.ToString()); |
| if (txtTime == "00:00:00") |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime).AddDays(01); |
| } |
| else |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| } |
| appointment = new Appointment("DOB_" + pmpItem.TxtSchoolId.ToString(), dteHolderDateTime, dteHolderEndDateTime, dteHolderDateTime.ToString()); |
| appointment.Attributes["customTitle"] = "DOB: " + pmpItem.DisplayNamePlain; ; |
| //if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| //{ |
| // if (dateTimeShort.Month.Equals(RadCalendar1.SelectedDate.Month)) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| //else |
| //{ |
| // if (dateTimeShort.ToShortDateString().Equals(RadCalendar1.SelectedDate.ToShortDateString())) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| } |
| } |
| } |
| CheckBox chkBox4 = PanelBarPupilCheckboxes.FindControl("chkRegistered") as CheckBox; |
| if (chkBox4.Checked) |
| { |
| foreach (PupilManagementPupils pmpItem in pmpList) |
| { |
| DateTime dteHolderDateTime = new DateTime(); |
| DateTime dteHolderEndDateTime = new DateTime(); |
| string txtDate = ""; |
| string txtTime = ""; |
| string txtNote = ""; |
| string[] arrayDateTime; |
| Appointment appointment = new Appointment(); |
| if (!String.IsNullOrEmpty(pmpItem.TxtRegisteredDate.ToString())) |
| { |
| txtDate = pmpItem.TxtRegisteredDate.ToString(); |
| arrayDateTime = txtDate.Split(' '); |
| txtDate = arrayDateTime[0].ToString(); |
| txtTime = arrayDateTime[1].ToString(); |
| DateTime dateTimeShort = DateTime.Parse(pmpItem.TxtRegisteredDate.ToString()); |
| if (txtTime == "00:00:00") |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime).AddDays(01); |
| } |
| else |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| } |
| appointment = new Appointment("Registered_" + pmpItem.TxtSchoolId.ToString(), dteHolderDateTime, dteHolderEndDateTime, "No Registered Notes"); |
| appointment.Attributes["customTitle"] = "Registered: " + pmpItem.DisplayNamePlain; |
| if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| { |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView) |
| { |
| appointments.Add(appointment); |
| } |
| else |
| { |
| if (DateTime.Parse(dateTimeShort.ToShortDateString()) >= RadScheduler1.VisibleRangeStart && DateTime.Parse(dateTimeShort.ToShortDateString()) <= RadScheduler1.VisibleRangeEnd) |
| { |
| appointments.Add(appointment); |
| } |
| } |
| } |
| else |
| { |
| appointments.Add(appointment); |
| } |
| //if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| //{ |
| // if (dateTimeShort.Month.Equals(RadCalendar1.SelectedDate.Month)) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| //else |
| //{ |
| // if (dateTimeShort.ToShortDateString().Equals(RadCalendar1.SelectedDate.ToShortDateString())) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| } |
| } |
| } |
| CheckBox chkBox5 = PanelBarPupilCheckboxes.FindControl("chkEnquiry") as CheckBox; |
| if (chkBox5.Checked) |
| { |
| foreach (PupilManagementPupils pmpItem in pmpList) |
| { |
| DateTime dteHolderDateTime = new DateTime(); |
| DateTime dteHolderEndDateTime = new DateTime(); |
| string txtDate = ""; |
| string txtTime = ""; |
| string txtNote = ""; |
| string[] arrayDateTime; |
| Appointment appointment = new Appointment(); |
| if (!String.IsNullOrEmpty(pmpItem.TxtEnquiryDate.ToString())) |
| { |
| txtDate = pmpItem.TxtEnquiryDate.ToString(); |
| arrayDateTime = txtDate.Split(' '); |
| txtDate = arrayDateTime[0].ToString(); |
| txtTime = arrayDateTime[1].ToString(); |
| DateTime dateTimeShort = DateTime.Parse(pmpItem.TxtEnquiryDate.ToString()); |
| if (txtTime == "00:00:00") |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime).AddDays(01); |
| } |
| else |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| } |
| appointment = new Appointment("Enquiry_" + pmpItem.TxtSchoolId.ToString(), dteHolderDateTime, dteHolderEndDateTime, "No Enquiry Notes"); |
| appointment.Attributes["customTitle"] = "Enquiry: " + pmpItem.DisplayNamePlain; |
| if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| { |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView) |
| { |
| appointments.Add(appointment); |
| } |
| else |
| { |
| if (DateTime.Parse(dateTimeShort.ToShortDateString()) >= RadScheduler1.VisibleRangeStart && DateTime.Parse(dateTimeShort.ToShortDateString()) <= RadScheduler1.VisibleRangeEnd) |
| { |
| appointments.Add(appointment); |
| } |
| } |
| } |
| else |
| { |
| appointments.Add(appointment); |
| } |
| //if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| //{ |
| // if (dateTimeShort.Month.Equals(RadCalendar1.SelectedDate.Month)) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| //else |
| //{ |
| // if (dateTimeShort.ToShortDateString().Equals(RadCalendar1.SelectedDate.ToShortDateString())) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| } |
| } |
| } |
| CheckBox chkBox6 = PanelBarPupilCheckboxes.FindControl("chkWithdrawn") as CheckBox; |
| if (chkBox6.Checked) |
| { |
| foreach (PupilManagementPupils pmpItem in pmpList) |
| { |
| DateTime dteHolderDateTime = new DateTime(); |
| DateTime dteHolderEndDateTime = new DateTime(); |
| string txtDate = ""; |
| string txtTime = ""; |
| string txtNote = ""; |
| string[] arrayDateTime; |
| Appointment appointment = new Appointment(); |
| if (!String.IsNullOrEmpty(pmpItem.TxtWithdrawnDate.ToString())) |
| { |
| txtDate = pmpItem.TxtWithdrawnDate.ToString(); |
| arrayDateTime = txtDate.Split(' '); |
| txtDate = arrayDateTime[0].ToString(); |
| txtTime = arrayDateTime[1].ToString(); |
| DateTime dateTimeShort = DateTime.Parse(pmpItem.TxtWithdrawnDate.ToString()); |
| if (txtTime == "00:00:00") |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime).AddDays(01); |
| } |
| else |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| } |
| appointment = new Appointment("Withdrawn_" + pmpItem.TxtSchoolId.ToString(), dteHolderDateTime, dteHolderEndDateTime, "No Withdrawn Notes"); |
| appointment.Attributes["customTitle"] = "Withdrawn: " + pmpItem.DisplayNamePlain; |
| if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| { |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView) |
| { |
| appointments.Add(appointment); |
| } |
| else |
| { |
| if (DateTime.Parse(dateTimeShort.ToShortDateString()) >= RadScheduler1.VisibleRangeStart && DateTime.Parse(dateTimeShort.ToShortDateString()) <= RadScheduler1.VisibleRangeEnd) |
| { |
| appointments.Add(appointment); |
| } |
| } |
| } |
| else |
| { |
| appointments.Add(appointment); |
| } |
| //if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| //{ |
| // if (dateTimeShort.Month.Equals(RadCalendar1.SelectedDate.Month)) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| //else |
| //{ |
| // if (dateTimeShort.ToShortDateString().Equals(RadCalendar1.SelectedDate.ToShortDateString())) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| } |
| } |
| } |
| CheckBox chkBox7 = PanelBarPupilCheckboxes.FindControl("chkRejected") as CheckBox; |
| if (chkBox7.Checked) |
| { |
| foreach (PupilManagementPupils pmpItem in pmpList) |
| { |
| DateTime dteHolderDateTime = new DateTime(); |
| DateTime dteHolderEndDateTime = new DateTime(); |
| string txtDate = ""; |
| string txtTime = ""; |
| string txtNote = ""; |
| string[] arrayDateTime; |
| Appointment appointment = new Appointment(); |
| if (!String.IsNullOrEmpty(pmpItem.TxtRejectedDate.ToString())) |
| { |
| txtDate = pmpItem.TxtRejectedDate.ToString(); |
| arrayDateTime = txtDate.Split(' '); |
| txtDate = arrayDateTime[0].ToString(); |
| txtTime = arrayDateTime[1].ToString(); |
| DateTime dateTimeShort = DateTime.Parse(pmpItem.TxtRejectedDate.ToString()); |
| if (txtTime == "00:00:00") |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime).AddDays(01); |
| } |
| else |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| } |
| appointment = new Appointment("Rejected_" + pmpItem.TxtSchoolId.ToString(), dteHolderDateTime, dteHolderEndDateTime, "No Rejected Notes"); |
| appointment.Attributes["customTitle"] = "Rejected: " + pmpItem.DisplayNamePlain; |
| if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| { |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView) |
| { |
| appointments.Add(appointment); |
| } |
| else |
| { |
| if (DateTime.Parse(dateTimeShort.ToShortDateString()) >= RadScheduler1.VisibleRangeStart && DateTime.Parse(dateTimeShort.ToShortDateString()) <= RadScheduler1.VisibleRangeEnd) |
| { |
| appointments.Add(appointment); |
| } |
| } |
| } |
| else |
| { |
| appointments.Add(appointment); |
| } |
| //if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| //{ |
| // if (dateTimeShort.Month.Equals(RadCalendar1.SelectedDate.Month)) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| //else |
| //{ |
| // if (dateTimeShort.ToShortDateString().Equals(RadCalendar1.SelectedDate.ToShortDateString())) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| } |
| } |
| } |
| } |
| CheckBox chkBox8 = PanelBarPupilCheckboxes.FindControl("chkProspectus") as CheckBox; |
| if (chkBox8.Checked) |
| { |
| AdmissionsProspectusService apService = new AdmissionsProspectusService(); |
| using (TList<AdmissionsProspectus> apList = apService.GetAll()) |
| { |
| foreach (AdmissionsProspectus apItem in apList) |
| { |
| DateTime dteHolderDateTime = new DateTime(); |
| DateTime dteHolderEndDateTime = new DateTime(); |
| string txtDate = ""; |
| string txtTime = ""; |
| string txtNote = ""; |
| string[] arrayDateTime; |
| Appointment appointment = new Appointment(); |
| if (!String.IsNullOrEmpty(apItem.DteDateSent.ToString())) |
| { |
| txtDate = apItem.DteDateSent.ToString(); |
| arrayDateTime = txtDate.Split(' '); |
| txtDate = arrayDateTime[0].ToString(); |
| txtTime = arrayDateTime[1].ToString(); |
| DateTime dateTimeShort = DateTime.Parse(apItem.DteDateSent.ToString()); |
| if (txtTime == "00:00:00") |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime).AddDays(01); |
| } |
| else |
| { |
| dteHolderDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| dteHolderEndDateTime = DateTime.Parse(txtDate + " " + txtTime); |
| } |
| appointment = new Appointment("Prospectus_" + apItem.TxtSchoolid.ToString(), dteHolderDateTime, dteHolderEndDateTime, "No Prospectus Notes"); |
| appointment.Attributes["customTitle"] = "Prospectus Sent: " + GetPupilName(apItem.TxtSchoolid.ToString()); |
| if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| { |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView) |
| { |
| appointments.Add(appointment); |
| } |
| else |
| { |
| if (DateTime.Parse(dateTimeShort.ToShortDateString()) >= RadScheduler1.VisibleRangeStart && DateTime.Parse(dateTimeShort.ToShortDateString()) <= RadScheduler1.VisibleRangeEnd) |
| { |
| appointments.Add(appointment); |
| } |
| } |
| } |
| else |
| { |
| appointments.Add(appointment); |
| } |
| //if (RadScheduler1.SelectedView != SchedulerViewType.DayView) |
| //{ |
| // if (dateTimeShort.Month.Equals(RadCalendar1.SelectedDate.Month)) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| //else |
| //{ |
| // if (dateTimeShort.ToShortDateString().Equals(RadCalendar1.SelectedDate.ToShortDateString())) |
| // { |
| // appointments.Add(appointment); |
| // } |
| //} |
| } |
| } |
| } |
| } |
| } |
| public string GetPupilName(string txtPupilID) |
| { |
| string txtPupilName = ""; |
| PupilManagementPupilsService pmpService = new PupilManagementPupilsService(); |
| using (PupilManagementPupils pmpItem = pmpService.GetByTxtSchoolId(txtPupilID)) |
| { |
| if (pmpItem != null) |
| { |
| if (!String.IsNullOrEmpty(pmpItem.TxtFullName) && pmpItem.TxtFullName.ToString() != "0") |
| { |
| txtPupilName = pmpItem.TxtFullName.ToString(); |
| } |
| else |
| { |
| txtPupilName = "Unknown"; |
| } |
| } |
| else |
| { |
| txtPupilName = "Unknown"; |
| } |
| } |
| return txtPupilName; |
| } |
| /// <summary> |
| /// This method applies styling attributes to page elements and controls |
| /// </summary> |
| private void ApplyStyling() |
| { |
| } |
| #endregion UI Generation |
| #region Control Events |
| /// <summary> |
| /// Fires when any of the "Day", "Month" or "Week" view buttons are clicked |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void RadScheduler1_NavigationCommand(object sender, SchedulerNavigationCommandEventArgs e) |
| { |
| Trace.Warn("RadScheduler1_NavigationCommand"); |
| if (e.Command == SchedulerNavigationCommand.SwitchToDayView) |
| { |
| RadScheduler1.SelectedView = SchedulerViewType.DayView; |
| } |
| if (e.Command == SchedulerNavigationCommand.SwitchToWeekView) |
| { |
| RadScheduler1.SelectedView = SchedulerViewType.WeekView; |
| } |
| if (e.Command == SchedulerNavigationCommand.SwitchToMonthView) |
| { |
| RadScheduler1.SelectedView = SchedulerViewType.MonthView; |
| } |
| BindData(); |
| e.Cancel = true; |
| } |
| /// <summary> |
| /// Fires when finished RadScheduler1_NavigationCommand |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e) |
| { |
| Trace.Warn("RadScheduler1_NavigationComplete"); |
| RadCalendar1.FocusedDate = RadScheduler1.SelectedDate; |
| //if (e.Command == SchedulerNavigationCommand.SwitchToDayView) |
| //{ |
| // RadScheduler1.SelectedView = SchedulerViewType.DayView; |
| //} |
| //else |
| //{ |
| // RadScheduler1.SelectedView = SchedulerViewType.MonthView; |
| //} |
| } |
| /// <summary> |
| /// Fires when each day is rendered |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e) |
| { |
| Trace.Warn("RadCalendar1_DayRender"); |
| DateTime CurrentDate = e.Day.Date; |
| } |
| /// <summary> |
| /// Fires when the calander selection is changed |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void RadCalendar1_SelectionChanged(object sender, SelectedDatesEventArgs e) |
| { |
| Trace.Warn("RadCalendar1_SelectionChanged"); |
| if (RadCalendar1.SelectedDates.Count > 0) |
| { |
| RadScheduler1.SelectedDate = RadCalendar1.SelectedDate; |
| if (RadScheduler1.SelectedView == SchedulerViewType.MonthView || RadScheduler1.SelectedView == SchedulerViewType.WeekView) |
| { |
| RadScheduler1.SelectedView = SchedulerViewType.DayView; |
| } |
| } |
| datetimeFilter = RadCalendar1.SelectedDate.ToShortDateString(); |
| BindData(); |
| } |
| /// <summary> |
| /// Fires when the Appointment is bound to the scheduler |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e) |
| { |
| // Trace.Warn("RadScheduler1_AppointmentDataBound"); |
| // RadCalendarDay radCalendarDay = new RadCalendarDay(RadCalendar1); |
| // radCalendarDay.Date = e.Appointment.Start; |
| // radCalendarDay.ItemStyle.CssClass = "class name here"; |
| // RadCalendar1.SpecialDays.Add(radCalendarDay); |
| } |
| protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e) |
| { |
| //Trace.Warn("RadScheduler1_AppointmentDelete"); |
| //RadCalendar1.SpecialDays.Clear(); |
| //appointments.Remove(FindById(e.Appointment.ID.ToString())); |
| } |
| protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e) |
| { |
| //Trace.Warn("RadScheduler1_AppointmentUpdate"); |
| RadCalendar1.SpecialDays.Clear(); |
| string[] arrayAppointmentItem; |
| arrayAppointmentItem = e.ModifiedAppointment.ID.ToString().Split('_'); |
| switch (GetTypeFromID(e.Appointment.ID.ToString())) |
| { |
| case "VISIT": |
| AdmissionsVisitsService avService = new AdmissionsVisitsService(); |
| using (AdmissionsVisits avItem = avService.GetByTblAdmissionsVisitsId(Int32.Parse(arrayAppointmentItem[1]))) |
| { |
| avItem.TxtVisitDateTime = e.ModifiedAppointment.Start; |
| avItem.TxtSubmitBy = iSAMS.Runtime.Context.Current.LoggedInUser.TxtUserCode; |
| avItem.TxtSubmitDateTime = DateTime.Today; |
| avService.Save(avItem); |
| } |
| break; |
| case "INTERVIEW": |
| PupilManagementPupilsService pmpService = new PupilManagementPupilsService(); |
| using (PupilManagementPupils pmpItem = pmpService.GetByTxtSchoolId(arrayAppointmentItem[1].ToString())) |
| { |
| pmpItem.TxtInterviewDate = e.ModifiedAppointment.Start; |
| pmpItem.TxtInterviewTime = e.ModifiedAppointment.Start.ToShortTimeString(); |
| pmpItem.TxtSubmitBy = iSAMS.Runtime.Context.Current.LoggedInUser.TxtUserCode; |
| pmpItem.TxtSubmitDateTime = DateTime.Now; |
| pmpService.Save(pmpItem); |
| } |
| break; |
| } |
| BindData(); |
| } |
| protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) |
| { |
| //Trace.Warn("RadScheduler1_AppointmentInsert"); |
| //String calType = e.Appointment.Attributes["calendarType"]; |
| //switch (calType) |
| //{ |
| // case "1": |
| // //visits stuff |
| // break; |
| // case "2": |
| // //interview stuff |
| // break; |
| //} |
| //Appointment addAppointment = new Appointment(); |
| //addAppointment.Subject = e.Appointment.Subject.ToString(); |
| //addAppointment.Start = e.Appointment.Start; |
| //addAppointment.End = e.Appointment.End; |
| //SchoolNewsTypesService sntService = new SchoolNewsTypesService(); |
| //SchoolNewsTypes addNewSchooltype; |
| //addNewSchooltype = new SchoolNewsTypes(); |
| //addNewSchooltype.TxtSubmitBy = "test"; |
| //addNewSchooltype.TxtSubmitDateTime = e.Appointment.Start; |
| //addNewSchooltype.TxtNewsType = e.Appointment.Subject.ToString(); |
| //sntService.Save(addNewSchooltype); |
| } |
| protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e) |
| { |
| Trace.Warn("RadScheduler1_AppointmentCreated"); |
| RadCalendar1.SpecialDays.Clear(); |
| switch (GetTypeFromID(e.Appointment.ID.ToString())) |
| { |
| case "VISIT": |
| e.Appointment.CssClass = "ableToMove disableDelete rsCategoryGreen "; |
| break; |
| case "VISITITINERARY": |
| e.Appointment.CssClass = " disableDelete rsCategoryGreen "; |
| break; |
| case "INTERVIEW": |
| e.Appointment.CssClass = "ableToMove disableDelete rsCategoryDarkBlue "; |
| break; |
| case "DOB": |
| e.Appointment.CssClass = "disableDelete rsCategoryBlue"; |
| break; |
| case "REGISTERED": |
| e.Appointment.CssClass = "disableDelete rsCategoryDarkGreen"; |
| break; |
| case "ENQUIRY": |
| e.Appointment.CssClass = "disableDelete rsCategoryDarkRed"; |
| break; |
| case "PROSPECTUS": |
| e.Appointment.CssClass = "disableDelete rsCategoryOrange"; |
| break; |
| case "WITHDRAWN": |
| e.Appointment.CssClass = "disableDelete rsCategoryViolet"; |
| break; |
| case "REJECTED": |
| e.Appointment.CssClass = "disableDelete rsCategoryYellow"; |
| break; |
| } |
| } |
| protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e) |
| { |
| //Trace.Warn("RadScheduler1_FormCreated"); |
| //if (e.Container.Mode == SchedulerFormMode.Insert) |
| //{ |
| // DropDownList ddlList = (DropDownList)e.Container.FindControl("ddlCalendarTypes"); |
| // ListItem liItem1 = new ListItem(); |
| // liItem1.Value = "1"; |
| // liItem1.Text = "Visit"; |
| // ddlList.Items.Add(liItem1); |
| // ListItem liItem2 = new ListItem(); |
| // liItem2.Value = "2"; |
| // liItem2.Text = "Interview"; |
| // ddlList.Items.Add(liItem2); |
| //} |
| } |
| #endregion Control Events |
| #region Server-Side Validation |
| #endregion Server-Side Validation |
| #region Error Handling |
| /// <summary> |
| /// Displays a critical error to the user |
| /// </summary> |
| /// <param name="message">Error message</param> |
| private void DoCriticalError(string message) |
| { |
| DoCriticalError(message, true); |
| } |
| /// <summary> |
| /// Displays a critical error to the user |
| /// </summary> |
| /// <param name="message">Error message</param> |
| /// <param name="_bStopProcessing">Boolean to stop the processing</param> |
| private void DoCriticalError(string message, bool stopProcessing) |
| { |
| infCriticalError.ContentText = message; |
| tblCriticalError.Visible = true; |
| } |
| #endregion Error Handling |
| private string GetTypeFromID(string ID) |
| { |
| string[] arrayAppointmentItem; |
| string txtAppointmentType = ""; |
| arrayAppointmentItem = ID.ToString().Split('_'); |
| txtAppointmentType = arrayAppointmentItem[0].ToUpper(); |
| return txtAppointmentType; |
| } |
| protected void CheckBoxes_CheckedChanged(object sender, EventArgs e) |
| { |
| BindData(); |
| } |
| /// <summary> |
| /// this uses a hidden field to hold the value of the drop downhj list of types so i can get the values of it when i add an appointment |
| /// </summary> |
| /// <param name="sender"></param> |
| /// <param name="e"></param> |
| protected void ddlCalendarTypes_selectedIndexChanged(object sender, System.EventArgs e) |
| { |
| //HiddenField field = (HiddenField)(((DropDownList)sender).NamingContainer).FindControl("hiddenCalendarTypes"); |
| //field.Value = ((DropDownList)sender).SelectedValue.ToString(); |
| } |
| } |