private void CreateClassRoom(Core.Helpers.Elements.Forms.Form form, Core.Helpers.Elements.Forms.Group classGroup) { Core.Helpers.Elements.Forms.Row roomRow = classGroup.AddRow(); TimetableText roomText = new TimetableText(); roomRow.Description = "<strong>Room</strong>"; if (this._state.Equals(TimetableStates.Teaching)) { if (this._isUnique) { roomText.Highlighted = "None"; form.AddHiddenField("ClassRoomId", "ClassRoomId", null); form.AddHiddenField("ClassRoomName-Original", "ClassRoomName-Original", "None"); form.AddHiddenField("ClassRoomId-Original", "ClassRoomId-Original", null); } else { if (string.IsNullOrEmpty(this._roomName)) { roomText.Highlighted = "None"; form.AddHiddenField("ClassRoomName-Original", "ClassRoomName-Original", "None"); } else { roomText.Highlighted = this._roomName; form.AddHiddenField("ClassRoomName-Original", "ClassRoomName-Original", this._roomName); } form.AddHiddenField("ClassRoomId", "ClassRoomId", this._roomId.ToString()); form.AddHiddenField("ClassRoomId-Original", "ClassRoomId-Original", this._roomId.ToString()); } } else { roomText.Highlighted = "None"; form.AddHiddenField("ClassRoomId", "ClassRoomId", null); form.AddHiddenField("ClassRoomName-Original", "ClassRoomName-Original", "None"); form.AddHiddenField("ClassRoomId-Original", "ClassRoomId-Original", null); } roomText.HighlightedId = "ClassRoomName"; roomText.OnClick = "selectClassRoom();"; roomRow.Text = roomText.ToString(); }
private void CreateUniqueName(Core.Helpers.Elements.Forms.Form form, Core.Helpers.Elements.Forms.Group uniqueGroup) { Core.Helpers.Elements.Forms.Row nameRow = uniqueGroup.AddRow(); nameRow.Description = "<strong>Name</strong>"; if (this._state.Equals(TimetableStates.Teaching)) { if (this._isUnique) { nameRow.SetToTextField("UniqueName", null, this._commitmentName, 1, 0, false, false); } else { nameRow.SetToTextField("UniqueName", null, null, 1, 0, false, false); } } else { nameRow.SetToTextField("UniqueName", null, null, 1, 0, false, false); } }
private void CreateClassClass(Core.Helpers.Elements.Forms.Form form, Core.Helpers.Elements.Forms.Group classGroup) { Core.Helpers.Elements.Forms.Row classRow = classGroup.AddRow(); TimetableText classText = new TimetableText(); classRow.Description = "<strong>Class</strong>"; if (this._state.Equals(TimetableStates.Teaching)) { if (this._isUnique) { classText.Highlighted = "None"; form.AddHiddenField("ClassClassId", "ClassClassId", null); form.AddHiddenField("ClassClassName-Original", "ClassClassName-Original", "None"); form.AddHiddenField("ClassClassId-Original", "ClassClassId-Original", null); } else { classText.Highlighted = this._className; form.AddHiddenField("ClassClassId", "ClassClassId", this._classId.ToString()); form.AddHiddenField("ClassClassName-Original", "ClassClassName-Original", this._className); form.AddHiddenField("ClassClassId-Original", "ClassClassId-Original", this._classId.ToString()); } } else { classText.Highlighted = "None"; form.AddHiddenField("ClassClassId", "ClassClassId", null); form.AddHiddenField("ClassClassName-Original", "ClassClassName-Original", "None"); form.AddHiddenField("ClassClassId-Original", "ClassClassId-Original", null); } classText.HighlightedId = "ClassClassName"; classText.OnClick = "selectClassClass();"; classRow.Text = classText.ToString(); }
private void CreateClassQualification(Core.Helpers.Elements.Forms.Form form, Core.Helpers.Elements.Forms.Group classGroup) { Core.Helpers.Elements.Forms.Row qualificationRow = classGroup.AddRow(); TimetableText qualificationText = new TimetableText(); qualificationRow.Description = "<strong>Qualification</strong>"; if (this._state.Equals(TimetableStates.Teaching)) { if (this._isUnique) { qualificationText.Highlighted = "None"; form.AddHiddenField("ClassSubjectQualificationId", "ClassSubjectQualificationId", null); form.AddHiddenField("ClassQualificationName-Original", "ClassQualificationName-Original", "None"); form.AddHiddenField("ClassSubjectQualificationId-Original", "ClassSubjectQualificationId-Original", null); } else { qualificationText.Highlighted = this._qualificationName; form.AddHiddenField("ClassSubjectQualificationId", "ClassSubjectQualificationId", this._subjectQualificationId.ToString()); form.AddHiddenField("ClassQualificationName-Original", "ClassQualificationName-Original", this._qualificationName); form.AddHiddenField("ClassSubjectQualificationId-Original", "ClassSubjectQualificationId-Original", this._subjectQualificationId.ToString()); } } else { qualificationText.Highlighted = "None"; form.AddHiddenField("ClassSubjectQualificationId", "ClassSubjectQualificationId", null); form.AddHiddenField("ClassQualificationName-Original", "ClassQualificationName-Original", "None"); form.AddHiddenField("ClassSubjectQualificationId-Original", "ClassSubjectQualificationId-Original", null); } qualificationText.HighlightedId = "ClassQualificationName"; qualificationText.OnClick = "selectClassQualification();"; qualificationRow.Text = qualificationText.ToString(); }
private void CreateUniqueYeargroup(Core.Helpers.Elements.Forms.Form form, Core.Helpers.Elements.Forms.Group uniqueGroup) { Core.Helpers.Elements.Forms.Row yeargroupRow = uniqueGroup.AddRow(); TimetableText yeargroupText = new TimetableText(); yeargroupRow.Description = "<strong>Yeargroup</strong>"; if (this._state.Equals(TimetableStates.Teaching)) { if (this._isUnique) { yeargroupText.Highlighted = this._yeargroupName; form.AddHiddenField("UniqueYeargroupId", "UniqueYeargroupId", this._yeargroupId.ToString()); form.AddHiddenField("UniqueYeargroupName-Original", "UniqueYeargroupName-Original", this._yeargroupName); form.AddHiddenField("UniqueYeargroupId-Original", "UniqueYeargroupId-Original", this._yeargroupId.ToString()); } else { yeargroupText.Highlighted = "None"; form.AddHiddenField("UniqueYeargroupId", "UniqueYeargroupId", null); form.AddHiddenField("UniqueYeargroupName-Original", "UniqueYeargroupName-Original", "None"); form.AddHiddenField("UniqueYeargroupId-Original", "UniqueYeargroupId-Original", null); } } else { yeargroupText.Highlighted = "None"; form.AddHiddenField("UniqueYeargroupId", "UniqueYeargroupId", null); form.AddHiddenField("UniqueYeargroupName-Original", "UniqueYeargroupName-Original", "None"); form.AddHiddenField("UniqueYeargroupId-Original", "UniqueYeargroupId-Original", null); } yeargroupText.HighlightedId = "UniqueYeargroupName"; yeargroupText.OnClick = "selectUniqueYeargroup();"; yeargroupRow.Text = yeargroupText.ToString(); }
protected override void SetTabSpecific() { foreach (Core.Helpers.Elements.Tabs.Tab tab in this.Tabs) { Core.Helpers.Elements.MenuBar.Bar menuBar = new Core.Helpers.Elements.MenuBar.Bar(); menuBar.Text = "Rotation week <strong>" + this._weekNo + "</strong>, <strong>" + ((DayOfWeek)(this._dayNo - 1)) + "</strong>, period <strong>" + this._period + "</strong>"; menuBar.AddButton("back.png", "Click here to jump back to the staff member's timetable.", "?path=/staff/modify/teaching/" + this._staffId + "/week/" + this._weekNo + "/#Timetable", null); switch (tab.Id) { case "Unavailable": if (this._state.Equals(TimetableStates.Unavailable)) { tab.Content.SetVariable("UnavailableForm", new Core.Helpers.Constructor("/Templates/Specific/Staff/Modify/Teaching/Timetable/current.html").ToString()); } else { Core.Helpers.Elements.Forms.BasicForm unavailableForm = new Core.Helpers.Elements.Forms.BasicForm(); unavailableForm.Id = "Unavailable"; unavailableForm.HasTopSpace = true; unavailableForm.PostUrl = "/staff/modify/update/teaching/timetable/"; unavailableForm.AddButton(null, "Switch", null, 1, Core.Helpers.Elements.Forms.ButtonTypes.Submit); unavailableForm.AddHiddenField("State", null, "Unavailable"); unavailableForm.AddHiddenField("StaffId", null, this._staffId.ToString()); unavailableForm.AddHiddenField("WeekNo", null, this._weekNo.ToString()); unavailableForm.AddHiddenField("DayNo", null, this._dayNo.ToString()); unavailableForm.AddHiddenField("Period", null, this._period.ToString()); tab.Content.SetVariable("UnavailableForm", unavailableForm.ToString()); } menuBar.AddButton("thumbsup.png", "Click here to switch to the 'Free' tab.", "#Free", "switchToTab('Free');"); menuBar.AddButton("teach.png", "Click here to switch to the 'Teaching' tab.", "#Teaching", "switchToTab('Teaching');"); menuBar.AddButton("job.png", "Click here to switch to the 'Busy' tab.", "#Busy", "switchToTab('Busy');"); tab.Content.SetVariable("MenuBar", menuBar.ToString()); break; case "Free": if (this._state.Equals(TimetableStates.Free)) { tab.Content.SetVariable("FreeForm", new Core.Helpers.Constructor("/Templates/Specific/Staff/Modify/Teaching/Timetable/current.html").ToString()); } else { Core.Helpers.Elements.Forms.BasicForm freeForm = new Core.Helpers.Elements.Forms.BasicForm(); freeForm.Id = "Free"; freeForm.HasTopSpace = true; freeForm.PostUrl = "/staff/modify/update/teaching/timetable/"; freeForm.AddButton(null, "Switch", null, 1, Core.Helpers.Elements.Forms.ButtonTypes.Submit); freeForm.AddHiddenField("State", null, "Free"); freeForm.AddHiddenField("StaffId", null, this._staffId.ToString()); freeForm.AddHiddenField("WeekNo", null, this._weekNo.ToString()); freeForm.AddHiddenField("DayNo", null, this._dayNo.ToString()); freeForm.AddHiddenField("Period", null, this._period.ToString()); tab.Content.SetVariable("FreeForm", freeForm.ToString()); } menuBar.AddButton("noentry.png", "Click here to switch to the 'Unavailable' tab.", "#Unavailable", "switchToTab('Unavailable');"); menuBar.AddButton("teach.png", "Click here to switch to the 'Teaching' tab.", "#Teaching", "switchToTab('Teaching');"); menuBar.AddButton("job.png", "Click here to switch to the 'Busy' tab.", "#Busy", "switchToTab('Busy');"); tab.Content.SetVariable("MenuBar", menuBar.ToString()); break; case "Teaching": Core.Helpers.Elements.Forms.GroupedForm teachingForm = new Core.Helpers.Elements.Forms.GroupedForm(); teachingForm.Id = "Teaching"; teachingForm.HasTopSpace = true; teachingForm.PostUrl = "/staff/modify/update/teaching/timetable/"; teachingForm.RadioGroupName = "SelectedGroup"; teachingForm.AddHiddenField("State", null, "Teaching"); teachingForm.AddHiddenField("StaffId", null, this._staffId.ToString()); teachingForm.AddHiddenField("WeekNo", null, this._weekNo.ToString()); teachingForm.AddHiddenField("DayNo", null, this._dayNo.ToString()); teachingForm.AddHiddenField("Period", null, this._period.ToString()); Core.Helpers.Elements.Forms.Group uniqueGroup = teachingForm.AddGroup("Unique"); uniqueGroup.TitleDetails.Image.Src = "teach.png"; uniqueGroup.TitleDetails.Image.Tooltip = "A timetable entry unique to this staff member."; uniqueGroup.TitleDetails.Text = "<strong>A unique teaching entry</strong>"; uniqueGroup.RadioValue = "Unique"; if (this.Path.HasNext() && this.Path.Peek().Equals("uniquefail")) { Core.Helpers.Elements.Alerts.Alert uniqueFail = new Core.Helpers.Elements.Alerts.Alert("UniqueFail"); uniqueFail.Colour = Core.Helpers.Elements.Alerts.Colours.Red; uniqueFail.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Period/uniquefailed.html").ToString(); uniqueGroup.RightPane.Contents = uniqueFail.ToString(); } else { uniqueGroup.RightPane.Contents = " "; } Core.Helpers.Elements.Forms.Group classGroup = teachingForm.AddGroup("Class"); classGroup.TitleDetails.Image.Src = "teach.png"; classGroup.TitleDetails.Image.Tooltip = "A class"; classGroup.TitleDetails.Text = "<strong>A class</strong>"; classGroup.RadioValue = "Class"; if (this.Path.HasNext() && this.Path.Peek().Equals("classfail")) { Core.Helpers.Elements.Alerts.Alert classFail = new Core.Helpers.Elements.Alerts.Alert("ClassFail"); classFail.Colour = Core.Helpers.Elements.Alerts.Colours.Red; classFail.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Period/classfailed.html").ToString(); classGroup.RightPane.Contents = classFail.ToString(); } else { classGroup.RightPane.Contents = " "; } this.CreateUniqueYeargroup(teachingForm, uniqueGroup); this.CreateUniqueRoom(teachingForm, uniqueGroup); this.CreateUniqueName(teachingForm, uniqueGroup); this.CreateClassSubject(teachingForm, classGroup); this.CreateClassQualification(teachingForm, classGroup); this.CreateClassClass(teachingForm, classGroup); this.CreateClassRoom(teachingForm, classGroup); if (this._state.Equals(TimetableStates.Teaching)) { if (this._isUnique) { teachingForm.OnReset = "setFormTo('Teaching', 'Unique');"; uniqueGroup.IsDefault = true; } else { teachingForm.OnReset = "setFormTo('Teaching', 'Class');"; classGroup.IsDefault = true; } teachingForm.AddButton(null, "Reset", "resetNonFields();", 3, Core.Helpers.Elements.Forms.ButtonTypes.Reset); teachingForm.AddButton(null, "Update", null, 2, Core.Helpers.Elements.Forms.ButtonTypes.Submit); } else { teachingForm.AddButton(null, "Switch", null, 2, Core.Helpers.Elements.Forms.ButtonTypes.Submit); } menuBar.AddButton("noentry.png", "Click here to switch to the 'Unavailable' tab.", "#Unavailable", "switchToTab('Unavailable');"); menuBar.AddButton("thumbsup.png", "Click here to switch to the 'Free' tab.", "#Free", "switchToTab('Free');"); menuBar.AddButton("job.png", "Click here to switch to the 'Busy' tab.", "#Busy", "switchToTab('Busy');"); tab.Content.SetVariable("TeachingForm", teachingForm.ToString()); tab.Content.SetVariable("MenuBar", menuBar.ToString()); break; case "Selection": Core.Helpers.Elements.Search.SearchArea selectionSearch = new Core.Helpers.Elements.Search.SearchArea("Selection"); selectionSearch.AddButton("search.png", null, "doSelectionSearch();", "Click here to search."); selectionSearch.AddButton("refresh.png", null, "resetSelectionSearch();", "Click here to reset the search criteria."); selectionSearch.AddButton("back.png", null, "switchToTab('Teaching');", "Click here to jump back to the 'Teaching' tab."); selectionSearch.AjaxUrl = "/staff/modify/ajax/teaching/timetable/selection/search/"; selectionSearch.AjaxStatusUrl = "/staff/modify/ajax/teaching/timetable/selection/status/"; tab.Content.SetVariable("SearchArea", selectionSearch.ToString()); break; case "Busy": Core.Helpers.Elements.Forms.BasicForm busyForm = new Core.Helpers.Elements.Forms.BasicForm(); busyForm.Id = "Busy"; busyForm.HasTopSpace = true; busyForm.PostUrl = "/staff/modify/update/teaching/timetable/"; busyForm.AddHiddenField("State", null, "Busy"); busyForm.AddHiddenField("StaffId", null, this._staffId.ToString()); busyForm.AddHiddenField("WeekNo", null, this._weekNo.ToString()); busyForm.AddHiddenField("DayNo", null, this._dayNo.ToString()); busyForm.AddHiddenField("Period", null, this._period.ToString()); Core.Helpers.Elements.Forms.Row busyRow = busyForm.AddRow(); busyRow.Description = "<strong>Commitment Name</strong>"; if (tab.Alerts.IsEmpty) { busyForm.RightPane.Contents = " "; } else { busyForm.RightPane.Contents = tab.Alerts.ToString(); } if (this._state.Equals(TimetableStates.Busy)) { busyForm.AddButton(null, "Reset", null, 3, Core.Helpers.Elements.Forms.ButtonTypes.Reset); busyForm.AddButton(null, "Update", null, 2, Core.Helpers.Elements.Forms.ButtonTypes.Submit); busyRow.SetToTextField("BusyCommitment", null, this._commitmentName, 1, 0, false, false); } else { busyForm.AddButton(null, "Switch", null, 2, Core.Helpers.Elements.Forms.ButtonTypes.Submit); busyRow.SetToTextField("BusyCommitment", null, null, 1, 0, false, false); } tab.Content.SetVariable("BusyForm", busyForm.ToString()); menuBar.AddButton("noentry.png", "Click here to switch to the 'Unavailable' tab.", "#Unavailable", "switchToTab('Unavailable');"); menuBar.AddButton("thumbsup.png", "Click here to switch to the 'Free' tab.", "#Free", "switchToTab('Free');"); menuBar.AddButton("teach.png", "Click here to switch to the 'Teaching' tab.", "#Teaching", "switchToTab('Teaching');"); tab.Content.SetVariable("MenuBar", menuBar.ToString()); break; } } }
protected override void SetTabSpecific() { foreach (Core.Helpers.Elements.Tabs.Tab tab in this.Tabs) { switch (tab.Id) { case "Name": Core.Helpers.Elements.Forms.BasicForm nameForm = new Core.Helpers.Elements.Forms.BasicForm(); nameForm.Id = "Name"; nameForm.FieldWidths = 250; nameForm.HasTopSpace = true; nameForm.PostUrl = "/staff/modify/update/teaching/name/"; nameForm.AddHiddenField("StaffId", null, this._staffId.ToString()); nameForm.AddButton(null, "Reset", null, 6, Core.Helpers.Elements.Forms.ButtonTypes.Reset); nameForm.AddButton(null, "Update", null, 5, Core.Helpers.Elements.Forms.ButtonTypes.Submit); if (!string.IsNullOrEmpty(this._alert)) { switch (this._alert) { case "nameallblank": Core.Helpers.Elements.Alerts.Alert nameAllBlankAlert = new Core.Helpers.Elements.Alerts.Alert("NameAllBlank"); nameAllBlankAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Red; nameAllBlankAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Name/nameallblank.html").ToString(); nameAllBlankAlert.NoScript = false; nameAllBlankAlert.ShowCloseBox = false; nameAllBlankAlert.StartHidden = false; nameForm.RightPane.Contents = nameAllBlankAlert.ToString(); break; case "nameincomplete": Core.Helpers.Elements.Alerts.Alert nameIncompleteAlert = new Core.Helpers.Elements.Alerts.Alert("NameIncomplete"); nameIncompleteAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Red; nameIncompleteAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Name/nameincomplete.html").ToString(); nameIncompleteAlert.NoScript = false; nameIncompleteAlert.ShowCloseBox = false; nameIncompleteAlert.StartHidden = false; nameForm.RightPane.Contents = nameIncompleteAlert.ToString(); break; case "namesuccess": Core.Helpers.Elements.Alerts.Alert nameSuccessAlert = new Core.Helpers.Elements.Alerts.Alert("NameSuccess"); nameSuccessAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Green; nameSuccessAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Name/namesuccess.html").ToString(); nameSuccessAlert.NoScript = false; nameSuccessAlert.ShowCloseBox = false; nameSuccessAlert.StartHidden = false; nameForm.RightPane.Contents = nameSuccessAlert.ToString(); break; case "namenew": Core.Helpers.Elements.Alerts.Alert newStaffMemberAlert = new Core.Helpers.Elements.Alerts.Alert("NewStaffMember"); newStaffMemberAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Green; newStaffMemberAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Name/new.html").ToString(); newStaffMemberAlert.NoScript = false; newStaffMemberAlert.ShowCloseBox = false; newStaffMemberAlert.StartHidden = false; nameForm.RightPane.Contents = newStaffMemberAlert.ToString(); break; default: nameForm.RightPane.Contents = " "; break; } } else nameForm.RightPane.Contents = " "; Core.Helpers.Elements.Forms.Row titleRow = nameForm.AddRow(); titleRow.Description = "<strong>Title</strong>"; titleRow.SetToTextField("Title", null, this._name.Title, 1, 0, false, false); Core.Helpers.Elements.Forms.Row forenameRow = nameForm.AddRow(); forenameRow.Description = "<strong>Forename</strong>"; forenameRow.SetToTextField("Forename", null, this._name.Forename, 2, 0, false, false); Core.Helpers.Elements.Forms.Row surnameRow = nameForm.AddRow(); surnameRow.Description = "<strong>Surname</strong>"; surnameRow.SetToTextField("Surname", null, this._name.Surname, 3, 0, false, false); Core.Helpers.Elements.Forms.Row holdingNameRow = nameForm.AddRow(); holdingNameRow.Description = "<strong>Holding Name</strong>"; holdingNameRow.SetToTextField("HoldingName", null, this._name.HoldingName, 4, 0, false, true); tab.Content.SetVariable("NameForm", nameForm.ToString()); break; case "Entitlement": Core.Helpers.Elements.Forms.BasicForm entitlementForm = new Core.Helpers.Elements.Forms.BasicForm(); entitlementForm.Id = "Entitlement"; entitlementForm.HasTopSpace = true; entitlementForm.FieldWidths = 250; entitlementForm.PostUrl = "/staff/modify/update/teaching/entitlement/"; entitlementForm.AddHiddenField("StaffId", null, this._staffId.ToString()); entitlementForm.AddButton(null, "Reset", null, 3, Core.Helpers.Elements.Forms.ButtonTypes.Reset); entitlementForm.AddButton(null, "Update", null, 2, Core.Helpers.Elements.Forms.ButtonTypes.Submit); if (!string.IsNullOrEmpty(this._alert)) { switch (this._alert) { case "entitlementbad": Core.Helpers.Elements.Alerts.Alert entitlementBadAlert = new Core.Helpers.Elements.Alerts.Alert("EntitlementBad"); entitlementBadAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Red; entitlementBadAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Entitlement/entitlementbad.html").ToString(); entitlementBadAlert.NoScript = false; entitlementBadAlert.ShowCloseBox = false; entitlementBadAlert.StartHidden = false; entitlementForm.RightPane.Contents = entitlementBadAlert.ToString(); break; case "entitlementsuccess": Core.Helpers.Elements.Alerts.Alert entitlementSuccessAlert = new Core.Helpers.Elements.Alerts.Alert("EntitlementSuccess"); entitlementSuccessAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Green; entitlementSuccessAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Entitlement/entitlementsuccess.html").ToString(); entitlementSuccessAlert.NoScript = false; entitlementSuccessAlert.ShowCloseBox = false; entitlementSuccessAlert.StartHidden = false; entitlementForm.RightPane.Contents = entitlementSuccessAlert.ToString(); break; } } else entitlementForm.RightPane.Contents = " "; Core.Helpers.Elements.Forms.Row entitlementRow = entitlementForm.AddRow(); entitlementRow.Description = "<strong>Entitlement Value</strong>"; entitlementRow.SetToTextField("Entitlement", null, this._entitlement.ToString(), 1, Core.WebServer.PleaseTakes.Session.CurrentInstance.School.Settings.Timetabling.Layout.NoPeriods.ToString().Length, false, false); tab.Content.SetVariable("EntitlementForm", entitlementForm.ToString()); tab.Content.SetVariable("MaxPeriods", Core.WebServer.PleaseTakes.Session.CurrentInstance.School.Settings.Timetabling.Layout.NoPeriods.ToString()); break; case "Account": tab.Content.SetVariable("AccountForm", this.InitialiseAccountForm().ToString()); break; case "Department": Core.Helpers.Elements.Search.SearchArea departmentSearch = new Core.Helpers.Elements.Search.SearchArea("Department"); departmentSearch.AjaxUrl = "/staff/modify/ajax/teaching/department/" + this._staffId + "/search/"; departmentSearch.AjaxStatusUrl = "/staff/modify/ajax/teaching/department/status/"; departmentSearch.AddButton("search.png", null, "doSearch('Department');", "Click here to search for departments."); departmentSearch.AddButton("refresh.png", null, "resetSearch('Department');", "Click here to reset the department search."); tab.Content.SetVariable("DepartmentSearchArea", departmentSearch.ToString()); break; case "Timetable": Core.Helpers.Elements.Ajax.Element ajaxTimetableArea = new Core.Helpers.Elements.Ajax.Element("Timetable"); ajaxTimetableArea.ShowLoadingMessage = true; ajaxTimetableArea.GetPath = true; ajaxTimetableArea.Url = "/staff/modify/ajax/teaching/timetable/" + this._staffId + "/"; Core.Helpers.Elements.Alerts.Alert statusAlert = this.GetTimetableStatusMessage(); if (statusAlert == null) tab.Content.DeleteVariable("UpdateAlert"); else tab.Content.SetVariable("UpdateAlert", statusAlert.ToString()); tab.Content.SetVariable("AjaxTimetable", ajaxTimetableArea.ToString()); break; } } }
protected override void SetTabSpecific() { this.SetAlert(); foreach (Core.Helpers.Elements.Tabs.Tab tab in this.Tabs) { switch (tab.Id) { case "Password": Core.Helpers.Elements.Forms.BasicForm passwordForm = new Core.Helpers.Elements.Forms.BasicForm(); passwordForm.Id = "Password"; passwordForm.HasTopSpace = true; passwordForm.PostUrl = "/account/update/password/"; switch (this._alert) { case "passwordmissing": Helpers.Elements.Alerts.Alert missingAlert = new Helpers.Elements.Alerts.Alert("PasswordMissing"); missingAlert.Colour = Helpers.Elements.Alerts.Colours.Red; missingAlert.Message = new Helpers.Constructor("/Alerts/Specific/Account/Password/missing.html").ToString(); passwordForm.RightPane.Contents = missingAlert.ToString(); break; case "passwordold": Helpers.Elements.Alerts.Alert oldAlert = new Helpers.Elements.Alerts.Alert("PasswordOld"); oldAlert.Colour = Helpers.Elements.Alerts.Colours.Red; oldAlert.Message = new Helpers.Constructor("/Alerts/Specific/Account/Password/old.html").ToString(); passwordForm.RightPane.Contents = oldAlert.ToString(); break; case "passwordmatch": Helpers.Elements.Alerts.Alert matchAlert = new Helpers.Elements.Alerts.Alert("PasswordMatch"); matchAlert.Colour = Helpers.Elements.Alerts.Colours.Red; matchAlert.Message = new Helpers.Constructor("/Alerts/Specific/Account/Password/match.html").ToString(); passwordForm.RightPane.Contents = matchAlert.ToString(); break; case "passwordlength": Helpers.Elements.Alerts.Alert lengthAlert = new Helpers.Elements.Alerts.Alert("PasswordLength"); Helpers.Constructor lengthConstructor = new Helpers.Constructor("/Alerts/Specific/Account/Password/length.html"); lengthConstructor.SetVariable("NumChars", Consts.MinimumPasswordLength.ToString()); lengthAlert.Colour = Helpers.Elements.Alerts.Colours.Red; lengthAlert.Message = lengthConstructor.ToString(); passwordForm.RightPane.Contents = lengthAlert.ToString(); break; case "passwordsuccess": Helpers.Elements.Alerts.Alert successAlert = new Helpers.Elements.Alerts.Alert("PasswordSuccess"); successAlert.Colour = Helpers.Elements.Alerts.Colours.Green; successAlert.Message = new Helpers.Constructor("/Alerts/Specific/Account/Password/success.html").ToString(); passwordForm.RightPane.Contents = successAlert.ToString(); break; default: passwordForm.RightPane.Contents = " "; break; } passwordForm.AddButton(null, "Clear", null, 5, Core.Helpers.Elements.Forms.ButtonTypes.Reset); passwordForm.AddButton(null, "Change", null, 4, Core.Helpers.Elements.Forms.ButtonTypes.Submit); Core.Helpers.Elements.Forms.Row oldRow = passwordForm.AddRow(); oldRow.Description = "<strong>Old Password</strong>"; oldRow.SetToTextField("Old", null, null, 1, 0, true, false); Core.Helpers.Elements.Forms.Row newRow = passwordForm.AddRow(); newRow.Description = "<strong>New Password</strong>"; newRow.SetToTextField("New", null, null, 2, 0, true, false); Core.Helpers.Elements.Forms.Row confirmRow = passwordForm.AddRow(); confirmRow.Description = "<strong>Confirm Password</strong>"; confirmRow.SetToTextField("Confirm", null, null, 3, 0, true, false); tab.Content.SetVariable("NumChars", Consts.MinimumPasswordLength.ToString()); tab.Content.SetVariable("PasswordForm", passwordForm.ToString()); break; } } }