예제 #1
0
        protected void btnUpdateMeeting_Click(object sender, EventArgs e)
        {
            DateTime selectdDate = new DateTime();

            selectdDate = DateTime.Parse(txtEditTermStartDate.Text);
            int semStartDate;

            semStartDate = (int)selectdDate.DayOfWeek;

            updateDateError.Visible = false;
            ClsRooms room = new ClsRooms("MasterSchedule");
            //if (semStartDate != cblDays.SelectedIndex && room.CheckIsBrickAndMortar(ddRoom.SelectedItem.Text))
            //{
            //    updateDateError.Visible = true;
            //}
            //else
            //{
            StringBuilder sb = new StringBuilder();

            sb.Append("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
            sb.Append("<td colspan=\"2\"><h4>Change Meeting:</h4></td></tr><tr>");
            sb.Append("<td style=\"padding-left:10px;\">From:</td>");
            sb.Append("<td style=\"padding-left:10px;\">To:</td></tr><tr>");
            sb.Append("<td style=\"padding-left:10px;\">");

            ClsSectionMeetings sm = new ClsSectionMeetings("MasterSchedule");

            sm.SectionMeetingsId = int.Parse(UpdateMeetingID.Value);
            sm.GetRecord();
            ClsSections section = new ClsSections("MasterSchedule");

            section.SectionsId = SectionID;
            section.GetRecord();

            room.RoomsId = sm.RoomsId;
            room.GetRecord();
            ClsCampuses campus = new ClsCampuses("MasterSchedule");

            campus.CampusesId = room.CampusesId;
            campus.GetRecord();

            sb.Append("<table cellpadding=\"0\" cellspacing=\"0\">");
            sb.Append("<tr><td style=\"padding-right:5px;\">Campus:</td><td " + MarkOrig(campus.CampusCode, ddCampus.SelectedItem.Text) + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">Room:</td><td " + MarkOrig(room.RoomNumber, ddRoom.SelectedItem.Text) + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">Days:</td><td>" + sm.MeetDays.Replace(":", "") + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">Start Time:</td><td>");

            if (sm.MeetStartTime != DateTime.MinValue)
            {
                sb.Append(sm.MeetStartTime.ToShortTimeString());
            }
            sb.Append("</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">End Time:</td><td>");
            if (sm.MeetEndTime != DateTime.MinValue)
            {
                sb.Append(sm.MeetEndTime.ToShortTimeString());
            }
            sb.Append("</td></tr>");

            sb.Append("<tr><td>Section Start:</td><td " + MarkOrig_DateType(section.SectionStartDate, txtEditTermStartDate.Text) + "</td></tr>");
            sb.Append("<tr><td>Section End:</td><td " + MarkOrig_DateType(section.SectionEndDate, txtEditTermEndDate.Text) + "</td></tr>");
            sb.Append("</table>");

            sb.Append("</td>");
            sb.Append("<td style=\"padding-left:10px;\">");

            sb.Append("<table cellpadding=\"0\" cellspacing=\"0\">");
            sb.Append("<tr><td style=\"padding-right:5px;\">Campus:</td><td " + MarkChanges(campus.CampusCode, ddCampus.SelectedItem.Text) + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">Room:</td><td " + MarkChanges(room.RoomNumber, ddRoom.SelectedItem.Text) + "</td></tr>");

            sb.Append("<tr><td style=\"padding-right:5px;\">Days:</td><td>");
            foreach (ListItem item in cblDays.Items)
            {
                if (item.Selected)
                {
                    if (_meetChanged)
                    {
                        sb.Append("<strong>");
                    }
                    sb.Append(item.Value); if (_meetChanged)
                    {
                        sb.Append("</strong>");
                    }
                }
            }

            sb.Append("</td></tr>");

            sb.Append("<tr><td style=\"padding-right:5px;\">Start Time:</td><td " + MarkChanges_TimeType(sm.MeetStartTime, txtStartTime.Text) + "</td></tr>");
            sb.Append("<tr><td style=\"padding-right:5px;\">End Time:</td><td " + MarkChanges_TimeType(sm.MeetEndTime, txtEndTime.Text) + "</td></tr>");

            sb.Append("<tr><td>Start Date:</td><td " + MarkChanges_DateType(section.SectionStartDate, txtEditTermStartDate.Text) + "</td></tr>");
            sb.Append("<tr><td>End Date:</td><td " + MarkChanges_DateType(section.SectionEndDate, txtEditTermEndDate.Text) + "</td></tr>");
            sb.Append("</table>");

            sb.Append("</td></tr></table>");

            log.SectionsId   = int.Parse(Request["SectionsID"]);
            log.SubmittedBy  = Session["deltaid"].ToString();
            log.Change       = sb.ToString();
            log.ProcessGroup = "divsionchairs";
            log.AddRecord();

            Helpers.RefreshSortPending((GridView)Helpers.FindControlRecursive(Page.Master, "gvPendingChanges")); //Refresh the pending list

            MultiView1.ActiveViewIndex = 0;
            UpdateMeetingID.Value      = "";
            //}
        }
예제 #2
0
        protected void gvMeetings_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "editmeeting")
            {
                UpdateMeetingID.Value      = e.CommandArgument.ToString();
                MultiView1.ActiveViewIndex = 1;
                ClsSectionMeetings meeting = new ClsSectionMeetings("MasterSchedule");
                meeting.SectionMeetingsId = int.Parse(e.CommandArgument.ToString());
                meeting.GetRecord();
                ClsRooms room = new ClsRooms("MasterSchedule");
                room.RoomsId = meeting.RoomsId;
                room.GetRecord();

                ddCampus.DataBind();
                ddCampus.SelectedValue = room.CampusesId.ToString();

                ddRoom.DataBind();
                ddRoom.SelectedValue = meeting.RoomsId.ToString();

                //When we switch to the edit view, we are going to disable the validation for the times fields if the course
                //is an inet tnet tele courses.
                //Durring the actual update process, we also check the value so we do not attempt to parse a empty datetime entry
                if (!room.CheckIsBrickAndMortar(ddRoom.SelectedItem.Text))
                {
                    btnUpdateMeeting.ValidationGroup = "";
                }
                else
                {
                    btnUpdateMeeting.ValidationGroup = "editmeeting";
                }

                foreach (ListItem item in cblDays.Items)
                {
                    item.Selected = meeting.MeetDays.ToLower().Contains(item.Value.ToLower());
                }

                if (meeting.MeetStartTime > DateTime.MinValue)
                {
                    txtStartTime.Text = meeting.MeetStartTime.ToShortTimeString();
                }
                else
                {
                    txtStartTime.Text = "";
                }

                if (meeting.MeetEndTime > DateTime.MinValue)
                {
                    txtEndTime.Text = meeting.MeetEndTime.ToShortTimeString();
                }
                else
                {
                    txtEndTime.Text = "";
                }
            }
            if (e.CommandName == "deletemeeting")
            {
                log.SectionsId  = int.Parse(Request["SectionsID"]);
                log.SubmittedBy = Session["deltaid"].ToString();
                log.Change      = e.CommandArgument.ToString();
                log.AddRecord();

                Helpers.RefreshSortPending((GridView)Helpers.FindControlRecursive(Page.Master, "gvPendingChanges")); //Refresh the pending list
            }
        }