コード例 #1
0
        /// <summary>
        /// Loads a populated student Object from Database
        /// </summary>
        /// <param name="studentId"></param>
        /// <returns></returns>
        public static Student Load(string studentId)
        {
            try
            {
                StudentDataService dataService = new StudentDataService();
                DataSet            ds          = dataService.Load(studentId);

                Student objStudent = new Student();

                return(objStudent.MapData(ds) ? objStudent : null);
            }

            catch (Exception ex)
            {
                // throw new System.Exception(ex.Message);
                throw new System.Exception("Exception: '" + ex.Message + "' occured while loading students!");
            }
        }