protected void ddCampus_SelectedIndexChanged(object sender, EventArgs e) { //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 ClsRooms room = new ClsRooms("MasterSchedule"); if (!room.CheckIsBrickAndMortar(ddRoom.SelectedItem.Text)) { btnUpdateMeeting.ValidationGroup = ""; } else { btnUpdateMeeting.ValidationGroup = "editmeeting"; } }
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 } }