コード例 #1
0
        }//------------------------------

        //this function gets the selected student
        public DataTable GetSearchedStudentInformation(CommonExchange.SysAccess userInfo,
                                                       String queryString, String dateStart, String dateEnd, String yearLevelId, String courseId)
        {
            DataTable newTable = new DataTable("StudentSearchByStudentNameIdCardNumberTable");

            newTable.Columns.Add("student_id", System.Type.GetType("System.String"));
            newTable.Columns.Add("card_number", System.Type.GetType("System.String"));
            newTable.Columns.Add("student_name", System.Type.GetType("System.String"));
            newTable.Columns.Add("course_title", System.Type.GetType("System.String"));
            newTable.Columns.Add("year_level_description", System.Type.GetType("System.String"));
            newTable.Columns.Add("department_name", System.Type.GetType("System.String"));

            using (RemoteClient.RemCntStudentManager remClient = new RemoteClient.RemCntStudentManager())
            {
                _studentTable = remClient.SelectStudentInformation(userInfo, queryString, dateStart, dateEnd, courseId, yearLevelId);
            }

            foreach (DataRow studentRow in _studentTable.Rows)
            {
                DataRow newRow = newTable.NewRow();

                newRow["student_id"]   = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "student_id", "");
                newRow["card_number"]  = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "card_number", "");
                newRow["student_name"] = RemoteClient.ProcStatic.GetCompleteNameMiddleInitial(studentRow, "last_name", "first_name", "middle_name");
                newRow["course_title"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "course_title", "") + " - " +
                                         RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "course_acronym", "");
                newRow["year_level_description"] = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "year_level_description", "");
                newRow["department_name"]        = RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "department_name", "") + " - " +
                                                   RemoteServerLib.ProcStatic.DataRowConvert(studentRow, "department_acronym", "");

                newTable.Rows.Add(newRow);
            }

            newTable.AcceptChanges();

            return(newTable);
        }//-----------------------------