} //---------------------------- //this procedure updates a classroom information public void UpdateClassroomInformation(CommonExchange.SysAccess userInfo, CommonExchange.ClassroomInformation roomInfo) { using (RemoteClient.RemCntCourseManager remClient = new RemoteClient.RemCntCourseManager()) { remClient.UpdateClassroomInformation(userInfo, roomInfo); } if (_classroomTable != null) { Int32 index = 0; foreach (DataRow roomRow in _classroomTable.Rows) { if (String.Equals(roomInfo.ClassroomSysId, roomRow["sysid_classroom"].ToString())) { DataRow editRow = _classroomTable.Rows[index]; editRow.BeginEdit(); editRow["classroom_code"] = roomInfo.ClassroomCode; editRow["classroom_description"] = roomInfo.Description; editRow["maximum_capacity"] = roomInfo.MaximumCapacity; editRow["other_information"] = roomInfo.OtherInformation; editRow.EndEdit(); break; } index++; } _classroomTable.AcceptChanges(); } } //-----------------------------------
}//------------------- //############################################END CLASS ClassroomDateTimeForModular EVENTS####################################################### //################################################BUTTON btnSearchClassromm EVENTS#################################################### //event is raised when btnSearchClassromm is Clicked private void btnSearchClassroomClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; using (ClassroomSearchOnTextboxList frmSearch = new ClassroomSearchOnTextboxList(_userInfo, _scheduleManager)) { frmSearch.AdoptGridSize = true; frmSearch.ShowDialog(this); if (frmSearch.HasSelected) { this.Cursor = Cursors.WaitCursor; _classRoomInfo = _scheduleManager.GetDetailsClassroomInformation(frmSearch.PrimaryId); this.lblClassroomCode.Text = _classRoomInfo.ClassroomCode; this.lblMaxCapacity.Text = _classRoomInfo.MaximumCapacity.ToString(); this.txtDayAndTime.Focus(); } } } catch (Exception ex) { RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading Classroom Search Module"); } finally { this.Cursor = Cursors.Arrow; } }//-----------------
public ClassroomDateTimeSchedulerUpdate(CommonExchange.SysAccess userInfo, CommonExchange.ScheduleInformation schedInfo, String sysIdClassRoom, SubjectSchedulingLogic scheduleManager, CommonExchange.ScheduleInformationDetails schedDetailsInfo) : base(userInfo, schedInfo, scheduleManager, schedDetailsInfo) { this.InitializeComponent(); _classRoomInfo = _scheduleManager.GetDetailsClassroomInformation(sysIdClassRoom); _classRoomInfoTemp = (CommonExchange.ClassroomInformation)_classRoomInfo.Clone(); this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnClose.Click += new EventHandler(btnCloseClick); this.btnEdit.Click += new EventHandler(btnEditClick); }
public ClassroomUpdate(CommonExchange.SysAccess userInfo, CommonExchange.ClassroomInformation roomInfo, CourseLogic courseManager) { this.InitializeComponent(); _userInfo = userInfo; _roomInfo = roomInfo; _roomInfoTemp = (CommonExchange.ClassroomInformation)roomInfo.Clone(); _courseManager = courseManager; this.Load += new EventHandler(ClassLoad); this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnClose.Click += new EventHandler(btnCloseClick); this.btnUpdate.Click += new EventHandler(btnUpdateClick); }
} //--------------------------- //this function returns a classroom information details public CommonExchange.ClassroomInformation GetDetailsClassroomInformation(String roomId) { CommonExchange.ClassroomInformation roomInfo = new CommonExchange.ClassroomInformation(); if (_classroomTable != null) { String strFilter = "sysid_classroom = '" + roomId + "'"; DataRow[] selectRow = _classroomTable.Select(strFilter, "classroom_code ASC"); foreach (DataRow roomRow in selectRow) { roomInfo.ClassroomSysId = RemoteServerLib.ProcStatic.DataRowConvert(roomRow, "sysid_classroom", ""); roomInfo.ClassroomCode = RemoteServerLib.ProcStatic.DataRowConvert(roomRow, "classroom_code", ""); roomInfo.Description = RemoteServerLib.ProcStatic.DataRowConvert(roomRow, "classroom_description", ""); roomInfo.MaximumCapacity = RemoteServerLib.ProcStatic.DataRowConvert(roomRow, "maximum_capacity", Byte.Parse("0")); roomInfo.OtherInformation = RemoteServerLib.ProcStatic.DataRowConvert(roomRow, "other_information", ""); } } return(roomInfo); } //--------------------------------------
} //-------------------------------- //this procedure inserts a new classroom information public void InsertClassroomInformation(CommonExchange.SysAccess userInfo, CommonExchange.ClassroomInformation roomInfo) { using (RemoteClient.RemCntCourseManager remClient = new RemoteClient.RemCntCourseManager()) { remClient.InsertClassroomInformation(userInfo, ref roomInfo); } if (_classroomTable != null) { DataRow newRow = _classroomTable.NewRow(); newRow["sysid_classroom"] = roomInfo.ClassroomSysId; newRow["classroom_code"] = roomInfo.ClassroomCode; newRow["classroom_description"] = roomInfo.Description; newRow["maximum_capacity"] = roomInfo.MaximumCapacity; newRow["other_information"] = roomInfo.OtherInformation; _classroomTable.Rows.Add(newRow); _classroomTable.AcceptChanges(); } } //----------------------------
}//---------------------- //############################################END CLASS ClassroomDateTimeScheduler EVENTS####################################################### //################################################BUTTON btnSearchClassromm EVENTS#################################################### //event is raised when btnSearchClassromm is Clicked private void btnSearchClassroomClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; using (ClassroomSearchOnTextboxList frmSearch = new ClassroomSearchOnTextboxList(_userInfo, _scheduleManager)) { frmSearch.AdoptGridSize = true; frmSearch.ShowDialog(this); if (frmSearch.HasSelected) { this.Cursor = Cursors.WaitCursor; this.gbxDayTime.Enabled = true; _classRoomInfo = _scheduleManager.GetDetailsClassroomInformation(frmSearch.PrimaryId); this.lblClassroomCode.Text = _classRoomInfo.ClassroomCode; this.lblMaxCapacity.Text = _classRoomInfo.MaximumCapacity.ToString(); DateTime dateStart = DateTime.Parse(_scheduleManager.ServerDateTime); DateTime dateEnd = dateStart; if (_schedInfo.SubjectInfo.CourseGroupInfo.IsSemestral && !String.IsNullOrEmpty(_schedInfo.SemesterInfo.SemesterSysId)) { dateStart = _scheduleManager.GetSemesterDateStart(_schedInfo.SemesterInfo.SemesterSysId); dateEnd = _scheduleManager.GetSemesterDateEnd(_schedInfo.SemesterInfo.SemesterSysId); } else if (!_schedInfo.SubjectInfo.CourseGroupInfo.IsSemestral && !String.IsNullOrEmpty(_schedInfo.SchoolYearInfo.YearId)) { dateStart = _scheduleManager.GetSchoolYearDateStart(_schedInfo.SchoolYearInfo.YearId); dateEnd = _scheduleManager.GetSchoolYearDateEnd(_schedInfo.SchoolYearInfo.YearId); } _scheduleManager.SelectByClassroomCodeSubjectSchedule(_userInfo, dateStart.ToString(), dateEnd.ToString(), _classRoomInfo.ClassroomSysId, _schedDetailsInfo.ScheduleDetailsSysId); this.ctfDayTime.InitializeTimeFrameTables(_scheduleManager.GetWeekDayTable(this.ctfDayTime.WeekDayIdFieldName, this.ctfDayTime.WeekDayDescriptionFieldName, this.ctfDayTime.WeekDayAcronymFieldName), _scheduleManager.GetWeekTimeTable(this.ctfDayTime.TimeIdFieldName, this.ctfDayTime.TimeDescriptionFieldName), _scheduleManager.GetReadOnlySlotTable(this.ctfDayTime.ReadOnlySubjectCodeFieldName, this.ctfDayTime.TimeIdFieldName, this.ctfDayTime.WeekDayIdFieldName), 10); this.ctfDayTime.TimeFrames = _scheduleManager.GetTimeFrames(this.ctfDayTime.NumberOfDaysDisplayed, this.ctfDayTime.NumberOfTimeSlotsDisplayed, (Int32)RemoteClient.ControlTimeFrame.SelectedReadOnlyIndex.Selected, (Int32)RemoteClient.ControlTimeFrame.SelectedReadOnlyIndex.ReadOnly, (Int32)RemoteClient.ControlTimeFrame.SelectedValue.Selected, (Int32)RemoteClient.ControlTimeFrame.ReadOnlyValue.ReadOnly, (Int32)RemoteClient.ControlTimeFrame.SelectedValue.NotSelected, (Int32)RemoteClient.ControlTimeFrame.ReadOnlyValue.NotReadOnly); } } } catch (Exception ex) { RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading Classroom Search Module"); } finally { this.Cursor = Cursors.Arrow; } }//-------------------------
//############################################CLASS ClassroomDateTimeScheduler EVENTS####################################################### //event is raised when the class is loaded protected virtual void ClassLoad(object sender, EventArgs e) { _classRoomInfo = new CommonExchange.ClassroomInformation(); }//----------------------
//############################################CLASS ClassroomCreate EVENTS####################################################### //event is raised when the class is loaded private void ClassLoad(object sender, EventArgs e) { _roomInfo = new CommonExchange.ClassroomInformation(); } //-------------------------------------------