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();
            }
        }
Example #2
0
    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("");
        }
    }
Example #3
0
        protected void gvNeedsApproval_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            logProcess.ProcessingId = int.Parse(e.CommandArgument.ToString());
            logProcess.GetRecord();

            string to = Helpers.GetDeltaEmail(log.SubmittedBy);

            if (e.CommandName == "approve")
            {
                //Update the current process information
                this.UpdateCurrentProcess("processed");
                StringBuilder sb = new StringBuilder();
                if (log.SectionsId > 0)
                {
                    sb.Append(" to ");
                    ClsSections section = new ClsSections("MasterSchedule");
                    section.SectionsId = log.SectionsId;
                    section.GetRecord();
                    ClsCourses course = new ClsCourses("MasterSchedule");
                    course.CoursesId = section.CoursesId;
                    course.GetRecord();
                    ClsTerms term = new ClsTerms("MasterSchedule");
                    term.TermsId = section.TermsId;
                    term.GetRecord();
                    sb.Append("Schedule change for " + term.Term + " " + course.CourseNumber + " " + section.SectionNumber + ":<br/><br/>");
                    sb.Append(" has been processed by " + this.ProcessName);
                    sb.Append(log.Change);
                }
                if (!string.IsNullOrEmpty(to))
                {
                    SendEmail("Schedule change processed", sb.ToString(), to);
                }
            }

            if (e.CommandName == "ignore")
            {
                this.UpdateCurrentProcess("notprocessed");
            }

            Response.Write(log.LastError);
            gvNeedsApproval.DataBind();
        }
Example #4
0
        protected void btnDeleteCourse_Click(object sender, EventArgs e)
        {
            ClsSections section = new ClsSections("MasterSchedule");

            section.SectionsId = int.Parse(Request["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();

            log.SectionsId  = int.Parse(Request["SectionsID"]);
            log.SubmittedBy = Session["deltaid"].ToString();
            log.Change      = "Drop Course: " + term.Term + " " + course.CourseNumber + " sec " + section.SectionNumber;
            log.AddRecord();

            Helpers.RefreshSortPending((GridView)Helpers.FindControlRecursive(Page.Master, "gvPendingChanges")); //Refresh the pending list
        }
    protected void gvNeedsApproval_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string divChairComments = string.Empty;

        if (e.CommandName != "Page")
        {
            log.LogId = int.Parse(e.CommandArgument.ToString());
            log.GetRecord();
            log.UpdatedBy   = Session["deltaid"].ToString();
            log.DateUpdated = DateTime.Now;

            string to    = Helpers.GetDeltaEmail(log.SubmittedBy);
            string admin = ConfigurationManager.AppSettings["EmailAdmin"];

            if (e.CommandName == "approve")
            {
                StringBuilder sb1 = new StringBuilder(log.Change);
                sb1.Append("<ul><br>Division Chair: ");
                foreach (GridViewRow row in gvNeedsApproval.Rows)
                {
                    if (row.FindControl <HiddenField>("LOGID").Value == log.LogId.ToString())
                    {
                        divChairComments = row.FindControl <TextBox>("DivChairCommentsTextBox").Text;
                        if (string.IsNullOrEmpty(divChairComments))
                        {
                            divChairComments = "<b>No comments.</b>";
                        }
                    }
                }
                sb1.Append(divChairComments);
                sb1.Append("</ul>");
                log.Status       = "approved";
                log.ProcessGroup = "registars";
                log.Change       = sb1.ToString();
                log.UpdateRecord();

                //Add the registars processing information
                this.AddNextProcess();

                if (to != "")
                {
                    Helpers.SendEmail("Schedule change approved", "<br /> Your schedule change has been approved and has been sent to the registration office for processing.<br />Division Chair Comments: " + divChairComments, to);
                }
                StringBuilder sb = new StringBuilder();
                if (log.SectionsId > 0)
                {
                    sb.Append(" to ");
                    ClsSections section = new ClsSections("MasterSchedule");
                    section.SectionsId = log.SectionsId;
                    section.GetRecord();
                    ClsCourses course = new ClsCourses("MasterSchedule");
                    course.CoursesId = section.CoursesId;
                    course.GetRecord();
                    ClsTerms term = new ClsTerms("MasterSchedule");
                    term.TermsId = section.TermsId;
                    term.GetRecord();
                    sb.Append("<br /> Please make the following change to " + term.Term + " " + course.CourseNumber + " " + section.SectionNumber + ":<br/><br/>");
                }
                sb.Append(log.Change);
                Helpers.SendEmail("Schedule change submitted", sb.ToString(), "*****@*****.**");
            }
            if (e.CommandName == "ignore")
            {
                StringBuilder sb2 = new StringBuilder(log.Change);
                sb2.Append("<ul><br>Division Chair: ");
                foreach (GridViewRow row in gvNeedsApproval.Rows)
                {
                    if (row.FindControl <HiddenField>("LOGID").Value == log.LogId.ToString())
                    {
                        divChairComments = row.FindControl <TextBox>("DivChairDenyTextBox").Text;
                        if (string.IsNullOrEmpty(divChairComments))
                        {
                            divChairComments = "<b>No comments.</b>";
                        }
                    }
                }
                sb2.Append(divChairComments);
                sb2.Append("</ul>");
                log.Status = "ignored";
                log.Change = sb2.ToString();
                log.UpdateRecord();
                if (to != "")
                {
                    SendEmail("Schedule change denied", "Your schedule change has been denied.<br /><br />Comments<br />" + divChairComments, to);
                }
            }
            gvNeedsApproval.DataBind();
        }
    }
Example #6
0
        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();
            }
        }
Example #7
0
        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;
        }
Example #8
0
    protected void gvNeedsApproval_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string registrarComments = string.Empty;

        if (e.CommandName != "Page")
        {
            log.LogId = int.Parse(e.CommandArgument.ToString());
            log.GetRecord();

            string to = Helpers.GetDeltaEmail(log.SubmittedBy);
            //Get division chair email address
            string        DivChairEmail = log.UpdatedBy.ToString() + "@delta.edu";
            StringBuilder sbCourseInfo  = new StringBuilder(string.Empty);

            if (e.CommandName == "approve")
            {
                StringBuilder sb1 = new StringBuilder(log.Change);
                sb1.Append("<ul><br>Registrar: ");
                foreach (GridViewRow row in gvNeedsApproval.Rows)
                {
                    if (row.FindControl <HiddenField>("LOGID").Value == log.LogId.ToString())
                    {
                        registrarComments = row.FindControl <TextBox>("RegisCommentsTextBox").Text;
                        if (string.IsNullOrEmpty(registrarComments))
                        {
                            registrarComments = "<b>No comments.</b>";
                        }
                    }
                }
                sb1.Append(registrarComments);
                sb1.Append("</ul>");

                log.ProcessGroup = "final";
                log.UpdatedBy    = User.Identity.Name;
                log.Change       = sb1.ToString();
                log.UpdateRecord();

                this.UpdateCurrentProcess("approved");

                //Add the additional processing screens.

                string[] sendTo = GetNextProcessGroups();
                for (int i = 0; i < sendTo.Length; i++)
                {
                    AddProcess(sendTo[i], "last");
                }

                StringBuilder sb = new StringBuilder();
                if (log.SectionsId > 0)
                {
                    ClsSections section = new ClsSections("MasterSchedule");
                    section.SectionsId = log.SectionsId;
                    section.GetRecord();
                    ClsCourses course = new ClsCourses("MasterSchedule");
                    course.CoursesId = section.CoursesId;
                    course.GetRecord();
                    ClsTerms term = new ClsTerms("MasterSchedule");
                    term.TermsId = section.TermsId;
                    term.GetRecord();
                    sbCourseInfo.Append(term.Term + " " + course.CourseNumber + " " + section.SectionNumber + ":<br/><br/>");
                    sb.Append("<br /> Please make the following change to " + term.Term + " " + course.CourseNumber + " " + section.SectionNumber + ":<br/><br/>");
                }
                if (sbCourseInfo.Length > 1)
                {
                    sb.Append("<h4>Add Course:</h4><br/><br/>");
                }
                sb.Append(log.Change);
                sbCourseInfo.Append(log.Change);

                Helpers.SendEmail("Master Schedule change approved", sb.ToString(), GetNextProcessEmails(), log.SectionsId);
                // 3/23/16 - mgm - changed richardzeien to michaelmccloskey
                Helpers.SendEmail("Master Schedule change approved.", "Email sending to: " + GetNextProcessEmails() + "<br />" + sb.ToString(), "*****@*****.**", log.SectionsId);
                using (MasterScheduleDataContext db = new MasterScheduleDataContext())
                {
                    List <SendMessageOnLogApproval> messagesToSend = db.SendMessageOnLogApprovals.Where(X => X.LogID == log.LogId).ToList();

                    foreach (SendMessageOnLogApproval thisMessage in messagesToSend)
                    {
                        var results = db.GetMeetingCenterEmail(thisMessage.CampusID).ToList();
                        if (results.Count() > 0)
                        {
                            StringBuilder emailsToSend = new StringBuilder();

                            results.ForEach(X => emailsToSend.Append(X.DeltaEmail + ";"));

                            Helpers.SendEmail("Master Schedule change approved", sb.ToString(), emailsToSend.ToString().TrimEnd(";".ToCharArray()), log.SectionsId);
                        }
                        thisMessage.DateCompleted = DateTime.Now;
                        db.SubmitChanges();
                    }
                }

                if (to != "")
                {
                    Helpers.SendEmail("Master Schedule change approved", "Records and Registration has <b>approved</b> your schedule change. <br />Registrar Comments: " + registrarComments + "<br /><br /><b>Course Info:</b><br/>" + sbCourseInfo.ToString(), to, log.SectionsId);
                }

                Helpers.SendEmail("Master Schedule change approved.", "This email will be sent to:  " + DivChairEmail + "Records and Registration has <b>approved</b> the schedule change. <br />Registrar Comments: " + registrarComments + "<br /><br /><b>Course Info:</b><br/>" + sbCourseInfo.ToString(), "*****@*****.**", log.SectionsId);
                if (DivChairEmail != "")
                {
                    /*Commented out for testing.. Cyrus */
                    Helpers.SendEmail("Master Schedule change approved", "Records and Registration has <b>approved</b> the schedule change. <br />Registrar Comments: " + registrarComments + "<br /><br /><b>Course Info:</b><br/>" + sbCourseInfo.ToString(), DivChairEmail, log.SectionsId);
                }
                else
                {
                }
            }
            if (e.CommandName == "ignore")
            {
                StringBuilder sb2 = new StringBuilder(log.Change);
                sb2.Append("<ul><br>Registrar: ");
                foreach (GridViewRow row in gvNeedsApproval.Rows)
                {
                    if (row.FindControl <HiddenField>("LOGID").Value == log.LogId.ToString())
                    {
                        registrarComments = row.FindControl <TextBox>("RegistrarDenyTextBox").Text;
                        if (string.IsNullOrEmpty(registrarComments))
                        {
                            registrarComments = "<b>No comments.</b>";
                        }
                    }
                }
                sb2.Append(registrarComments);
                sb2.Append("</ul>");

                sbCourseInfo.Append(log.Change);
                log.Status       = "ignored";
                log.ProcessGroup = "complete";
                log.Change       = sb2.ToString();
                log.UpdateRecord();

                this.UpdateCurrentProcess("ignored");

                if (to != "")
                {
                    Helpers.SendEmail("Master Schedule change denied", "Your schedule change has been <b>denied</b> by Records and Registration. <br />Registrar Comments: " + registrarComments + "<br /><br /><b>Course Info:</b><br/>" + sbCourseInfo.ToString(), to, log.SectionsId);
                }

                if (DivChairEmail != "")
                {
                    /*Commented out for testing.. Cyrus */
                    Helpers.SendEmail("Master Schedule change denied", "The schedule change has been <b>denied</b> by Records and Registration. <br />Registrar Comments: " + registrarComments + "<br /><br /><b>Course Info:</b><br/>" + sbCourseInfo.ToString(), DivChairEmail, log.SectionsId);
                }
            }
            DataSet ds = new DataSet();
            rowFilter = string.Empty;
            BindGvNeedsApproval(ds);
            BindLists(ds);
        }
    }