protected void Page_Load(object sender, EventArgs e) { int.TryParse(Request["SectionsID"], out SectionID); if (SectionID <= 0) { Response.Redirect("~/?Error=SectionDetails.ascx+had+no+SectionID"); } // FIX for hiding calendar when a date is selected Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "hideCalendar", "function hideCalendar(cb) { cb.hide(); }", true); if (!IsPostBack) { ClsSections section = new ClsSections("MasterSchedule"); section.SectionsId = SectionID; section.GetRecord(); ClsTerms term = new ClsTerms("MasterSchedule"); term.TermsId = section.TermsId; term.GetRecord(); ClsCourses course = new ClsCourses("MasterSchedule"); course.CoursesId = section.CoursesId; course.GetRecord(); ClsDepartments department = new ClsDepartments("MasterSchedule"); department.DepartmentsId = course.DepartmentsId; department.GetRecord(); ClsSemesters semester = new ClsSemesters("MasterSchedule"); semester.SemestersId = term.SemestersId; semester.GetRecord(); } }
private string GetDescriptiveEmail() { if (_sectionsId > 0) { ClsSections section = new ClsSections("MasterSchedule"); section.SectionsId = this._sectionsId; section.GetRecord(); ClsTerms term = new ClsTerms("MasterSchedule"); term.TermsId = section.TermsId; term.GetRecord(); ClsCourses course = new ClsCourses("MasterSchedule"); course.CoursesId = section.CoursesId; course.GetRecord(); ClsDepartments department = new ClsDepartments("MasterSchedule"); department.DepartmentsId = course.DepartmentsId; department.GetRecord(); ClsSemesters semester = new ClsSemesters("MasterSchedule"); semester.SemestersId = term.SemestersId; semester.GetRecord(); StringBuilder sb = new StringBuilder(); sb.Append("<p style='font-weight:bold;'>"); sb.Append("Change Submitted By: " + this._submittedBy); sb.Append("Change Submitted On: " + this._dateSubmitted.ToString()); sb.Append("</p>"); sb.Append("<br /><br />Orginal Section Detail"); sb.Append("<table>"); AppendRow("Department", department.DepartmentCode, sb); AppendRow("Course Number", course.CourseNumber, sb); AppendRow("Section", section.SectionNumber, sb); AppendRow("Section Start", section.SectionStartDate.ToShortDateString(), sb); AppendRow("Section End", section.SectionEndDate.ToShortDateString(), sb); sb.Append("</table>"); return(sb.ToString()); } else { return(""); } }
protected void Page_Load(object sender, EventArgs e) { int.TryParse(Request["SectionsID"], out SectionID); if (SectionID <= 0) { Response.Redirect("~/?Error=SectionDetails.ascx+had+no+SectionID"); } // FIX for hiding calendar when a date is selected Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "hideCalendar", "function hideCalendar(cb) { cb.hide(); }", true); // FIX for css not loading when a calendar is inside of an updatepanel+multiview (+tabcontrol?) string url = Page.ClientScript.GetWebResourceUrl(typeof(ClientCssResourceAttribute), "AjaxControlToolkit.Calendar.Calendar.css"); HtmlLink myHtmlLink = new HtmlLink(); myHtmlLink.Href = url; myHtmlLink.Attributes.Add("rel", "stylesheet"); myHtmlLink.Attributes.Add("type", "text/css"); Page.Header.Controls.Add(myHtmlLink); if (!IsPostBack) { MultiView1.ActiveViewIndex = 1; ClsSections section = new ClsSections("MasterSchedule"); section.SectionsId = SectionID; section.GetRecord(); ClsTerms term = new ClsTerms("MasterSchedule"); term.TermsId = section.TermsId; term.GetRecord(); ClsCourses course = new ClsCourses("MasterSchedule"); course.CoursesId = section.CoursesId; course.GetRecord(); ClsDepartments department = new ClsDepartments("MasterSchedule"); department.DepartmentsId = course.DepartmentsId; department.GetRecord(); // DepartmentsID = course.DepartmentsID; ClsSemesters semester = new ClsSemesters("MasterSchedule"); semester.SemestersId = term.SemestersId; semester.GetRecord(); lblCatalogNumber.Text = course.CourseNumber; lblDepartment.Text = department.DepartmentDesc; lblSectionNumber.Text = section.SectionNumber; lblSemester.Text = semester.SemesterDesc; //lblTermEndDate.Text = section.SectionEndDate.ToShortDateString(); //lblTermStartDate.Text = section.SectionStartDate.ToShortDateString(); lblTermYear.Text = term.TermYear.ToString(); lblCapacity.Text = String.Format(section.Capacity.ToString(), "{0:0}"); txtCatalogNumber.Text = course.CourseNumber; txtSectionNumber.Text = section.SectionNumber; txtTermEndDate.Text = section.SectionEndDate.ToShortDateString(); txtTermStartDate.Text = section.SectionStartDate.ToShortDateString(); txtCapacity.Text = String.Format(section.Capacity.ToString(), "{0:0}"); //ddYear.DataBind(); Year = term.TermYear.ToString(); //ddSemester.DataBind(); Semester = semester.SemesterDesc; //ddDepartment.DataBind(); Department = department.DepartmentDesc; hdfDepartmentID.Value = course.DepartmentsId.ToString(); } }
public StringBuilder SaveCourseDetails(int SectionID) { ClsSections section = new ClsSections("MasterSchedule"); section.SectionsId = SectionID; section.GetRecord(); ClsTerms term = new ClsTerms("MasterSchedule"); term.TermsId = section.TermsId; term.GetRecord(); ClsCourses course = new ClsCourses("MasterSchedule"); course.CoursesId = section.CoursesId; course.GetRecord(); ClsDepartments department = new ClsDepartments("MasterSchedule"); department.DepartmentsId = course.DepartmentsId; department.GetRecord(); ClsSemesters semester = new ClsSemesters("MasterSchedule"); semester.SemestersId = term.SemestersId; semester.GetRecord(); StringBuilder sb = new StringBuilder(); int oldDays = section.SectionEndDate.Subtract(section.SectionStartDate).Days + 1; int newDays = DateTime.Parse(txtTermEndDate.Text).Subtract(DateTime.Parse(txtTermStartDate.Text)).Days + 1; string beforeDay = ""; string afterDay = ""; if (oldDays != newDays) { beforeDay = "<strong>"; afterDay = "</strong>"; } sb.Append("<table><tr>"); sb.Append("<td><strong>Change Course:</strong></td>"); sb.Append("<td><strong>From:</strong></td>"); sb.Append("<td><strong>To:</strong></td>"); sb.Append("</tr><tr>"); sb.Append("<td></td>"); sb.Append("<td>"); sb.Append("<table>"); sb.Append("<tr><td>Year:</td><td><strong>" + Year + "</strong></td></tr>"); sb.Append("<tr><td>Semester:</td><td><strong>" + Semester + "</strong></td></tr>"); sb.Append("<tr><td>Department:</td><td><strong>" + Department + "</strong></td></tr>"); sb.Append("<tr><td>Catalog Number:</td><td><strong>" + MarkOrig(course.CourseNumber, txtCatalogNumber.Text) + "</strong></td></tr>"); sb.Append("<tr><td>Section Number:</td><td><strong>" + MarkOrig(section.SectionNumber, txtSectionNumber.Text) + "</strong></td></tr>"); sb.Append("<tr><td>Semester Start:</td><td><strong>" + MarkOrig_DateType(section.SectionStartDate, txtTermStartDate.Text) + "</strong></td></tr>"); sb.Append("<tr><td>Semester End:</td><td><strong>" + MarkOrig_DateType(section.SectionEndDate, txtTermEndDate.Text) + "</strong></td></tr>"); sb.Append("<tr><td>Capacity:</td><td><strong>" + MarkOrig(section.Capacity.ToString(), (txtCapacity.Text)) + "</strong></td></tr>"); if (GetCourseSections.GetCreditType(term.Term.Replace("-", "/"), section.SectionNumber, course.CourseNumber) != "2") { sb.Append("<tr><td>Refund Policy:</td><td><strong>" + MarkOrig_RefundPeriod(DateTime.Parse(txtTermStartDate.Text), section.SectionStartDate, DateTime.Parse(txtTermEndDate.Text), section.SectionEndDate) + "</strong></td></tr>"); sb.Append("<tr><td>Days:</td><td>" + beforeDay + oldDays.ToString() + afterDay + "</td></tr>"); } //Days sb.Append("</table>"); sb.Append("</td>"); sb.Append("<td>"); sb.Append("<table>"); sb.Append("<tr><td>Year:</td><td><strong>" + Year + "</strong></td></tr>"); sb.Append("<tr><td>Semester:</td><td><strong>" + Semester + "</strong></td></tr>"); sb.Append("<tr><td>Department:</td><td><strong>" + Department + "</strong></td></tr>"); sb.Append("<tr><td>Catalog Number:</td><td><strong>" + MarkChanges(course.CourseNumber, txtCatalogNumber.Text) + "</strong></td></tr>"); sb.Append("<tr><td>Section Number:</td><td><strong>" + MarkChanges(section.SectionNumber, txtSectionNumber.Text) + "</strong></td></tr>"); sb.Append("<tr><td>Semester Start:</td><td><strong>" + MarkChanges_DateType(section.SectionStartDate, txtTermStartDate.Text) + "</strong></td></tr>"); sb.Append("<tr><td>Semester End:</td><td><strong>" + MarkChanges_DateType(section.SectionEndDate, txtTermEndDate.Text) + "</strong></td></tr>"); sb.Append("<tr><td>Capacity:</td><td><strong>" + MarkChanges(section.Capacity.ToString(), (txtCapacity.Text)) + "</strong></td></tr>"); if (GetCourseSections.GetCreditType(term.Term.Replace("-", "/"), section.SectionNumber, course.CourseNumber) != "2") { sb.Append("<tr><td>Refund Policy:</td><td><strong>" + MarkChange_RefundPeriod(DateTime.Parse(txtTermStartDate.Text), section.SectionStartDate, DateTime.Parse(txtTermEndDate.Text), section.SectionEndDate) + "</strong></td></tr>"); sb.Append("<tr><td>Days:</td><td>" + beforeDay + newDays.ToString() + afterDay + "</td></tr>"); } sb.Append("</table>"); sb.Append("</td>"); sb.Append("</tr></table>"); sb.Append("<table><tr><td>"); sb.Append(txtShortNote.Text); sb.Append("</td></tr></table>"); return(sb); //log.SectionsID = int.Parse(Request["SectionsID"]); //log.SubmittedBy = Session["deltaid"].ToString(); //log.Change = sb.ToString(); //log.AddRecord(); //Helpers.RefreshSortPending((GridView)Helpers.FindControlRecursive(Page.Master, "gvPendingChanges")); //Refresh the pending list // MultiView1.ActiveViewIndex = 0; }