Ejemplo n.º 1
0
        } //---------------------------------

        //##########################################END CLASS SubjectSearchList EVENTS###################################################

        #endregion

        #region Programmer-Defined Void Procedures

        //this procedure shows the search result
        private void ShowSearchResultDialog(Boolean isNewQuery)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                String queryString = RemoteClient.ProcStatic.TrimStartEndString(ctlManager.GetSearchString);

                if (!String.IsNullOrEmpty(queryString))
                {
                    if (_courseFilter.ForRoom)
                    {
                        _frmClassroomSearch.DataSource = _courseManager.GetSearchedClassroomInformation(_userInfo, queryString, isNewQuery);
                    }
                    else if (_courseFilter.ForSubject)
                    {
                        _frmSubjectSearch.DataSource = _courseManager.GetSearchedSubjectInformation(_userInfo, queryString, isNewQuery);
                    }
                    else if (_courseFilter.ForCourse)
                    {
                        _frmCourseSearch.DataSource = _courseManager.GetSearchedCourseInformation(_userInfo, queryString, isNewQuery);
                    }
                }
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Retrieving Data");
            }
            finally
            {
                this.ctlManager.SetFocusOnSearchTextBox();

                this.Cursor = Cursors.Arrow;
            }
        } //--------------------------
        } //------------------------------

        //################################END CLASS PrerequisiteSearchOnTextboxList EVENTS####################################

        //##################################TEXTBOX txtSearch EVENTS##########################################################
        //event is raised when the key is up
        protected override void txtSearchKeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;

                    this.SetDataGridViewSource(_roomSubjectManager.GetSearchedSubjectInformation(_userInfo, ((TextBox)sender).Text, _departmentId, true));
                }
                catch (Exception ex)
                {
                    RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Retrieving Subject List");
                }
                finally
                {
                    this.Cursor = Cursors.Arrow;
                }
            }

            base.txtSearchKeyUp(sender, e);
        } //-------------------------