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

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

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