Esempio n. 1
0
 /// <summary>
 /// 读取DataRow数据到Model中
 /// </summary>
 private void StudentsDataRowToModel(XYStudent model, DataRow dr)
 {
     model.strTeacherGUID   = ObjectConvertClass.static_ext_string(dr["strTeacherGUID"]);
     model.strStudentGUID   = ObjectConvertClass.static_ext_string(dr["strStudentGUID"]);
     model.strStudentNumber = ObjectConvertClass.static_ext_string(dr["strStudentNumber"]);
     model.strStudentName   = ObjectConvertClass.static_ext_string(dr["strStudentName"]);
 }
Esempio n. 2
0
        /// <summary>
        /// 读取DataRow数据到Model中
        /// </summary>
        private void RelationsDataRowToModel(XYTeacher model, DataRow dr)
        {
            model.strTeacherGUID   = ObjectConvertClass.static_ext_string(dr["strTeacherGUID"]);
            model.strTeacherNumber = ObjectConvertClass.static_ext_string(dr["strTeacherNumber"]);
            model.strTeacherName   = ObjectConvertClass.static_ext_string(dr["strTeacherName"]);
            //学员数组
            XYStudentArray listStudent = new XYStudentArray();
            XYStudent      _XYStudent  = new XYStudent();

            _XYStudent.strTeacherGUID   = ObjectConvertClass.static_ext_string(dr["strTeacherGUID"]);
            _XYStudent.strStudentGUID   = ObjectConvertClass.static_ext_string(dr["strStudentGUID"]);
            _XYStudent.strStudentNumber = ObjectConvertClass.static_ext_string(dr["strStudentNumber"]);
            _XYStudent.strStudentName   = ObjectConvertClass.static_ext_string(dr["strStudentName"]);
            listStudent.Add(_XYStudent);
            model.StudentArray = listStudent;
        }
Esempio n. 3
0
        /// <summary>
        /// 获得数据List
        /// </summary>
        public XYStudentArray GetStudentsDataList(string strTeacherGUID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * from VIEW_Base_XYRelation_Student where strTeacherGUID=@strTeacherGUID ");
            strSql.Append(" and (not (strStudentGUID is null)) and (strStudentGUID <> '')");
            SqlParameter[] parameters =
            {
                new SqlParameter("@strTeacherGUID", strTeacherGUID)
            };
            DataTable      dt   = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql.ToString(), parameters).Tables[0];
            XYStudentArray list = new XYStudentArray();

            foreach (DataRow dr in dt.Rows)
            {
                XYStudent _Base_XYRelation_Student = new XYStudent();
                StudentsDataRowToModel(_Base_XYRelation_Student, dr);
                list.Add(_Base_XYRelation_Student);
            }
            return(list);
        }