public StudentCommentList GetByStudentId(Guid studentId)
 {
     _list.Clear();
     Database db = new Database("Student");
     db.Command.CommandType = CommandType.StoredProcedure;
     db.Command.CommandText = "tblStudentCommentGetByStudentId";
     db.Command.Parameters.Add("@StudentId", SqlDbType.UniqueIdentifier).Value = studentId;
     DataTable dt = db.ExecuteQuery();
     foreach (DataRow dr in dt.Rows)
     {
         StudentComment s = new StudentComment();
         s.Initialize(dr);
         s.InitializeBusiniessData(dr);
         s.IsDirty = false;
         s.IsNew = false;
         s.evtIsSavable += new IsSavableHandler(s_evtIsSavable);
         _list.Add(s);
     }
     return this;
 }
示例#2
0
        public StudentCommentList GetByStudentId(Guid studentId)
        {
            _list.Clear();
            Database db = new Database("Student");

            db.Command.CommandType = CommandType.StoredProcedure;
            db.Command.CommandText = "tblStudentCommentGetByStudentId";
            db.Command.Parameters.Add("@StudentId", SqlDbType.UniqueIdentifier).Value = studentId;
            DataTable dt = db.ExecuteQuery();

            foreach (DataRow dr in dt.Rows)
            {
                StudentComment s = new StudentComment();
                s.Initialize(dr);
                s.InitializeBusiniessData(dr);
                s.IsDirty       = false;
                s.IsNew         = false;
                s.evtIsSavable += new IsSavableHandler(s_evtIsSavable);
                _list.Add(s);
            }
            return(this);
        }