コード例 #1
0
ファイル: BookList.cs プロジェクト: bkrichard/LibraryWebSite
        public BookList GetAll()
        {
            _list.Clear();
            Database db = new Database("Books");
            db.Command.CommandType = System.Data.CommandType.StoredProcedure;
            db.Command.CommandText = "tblBookGETALL";
            DataTable dt = db.ExecuteQuery();
            //dgvStudent.DataSource = dt;
            foreach (DataRow dr in dt.Rows)
            {
                Book s = new Book();
                s.Initialize(dr);
                s.InitializeBusinessData(dr);
                s.IsDirty = false;
                s.IsNew = false;
                s.evtIsSavable += new IsSavableHandler(s_evtIsSavable);
                _list.Add(s);
            }

            return this;
        }
コード例 #2
0
ファイル: BookList.cs プロジェクト: bkrichard/LibraryWebSite
        public BookList GetByBookTypeID(Guid bookTypeID)
        {
            _list.Clear();
            Database db = new Database("Books");
            db.Command.CommandType = System.Data.CommandType.StoredProcedure;
            db.Command.CommandText = "tblBookGETBYBOOKTYPEID";
            db.Command.Parameters.Add("@BookTypeID", SqlDbType.UniqueIdentifier).Value = bookTypeID;
            DataTable dt = db.ExecuteQuery();
            //dgvStudent.DataSource = dt;
            foreach (DataRow dr in dt.Rows)
            {
                Book s = new Book();
                s.Initialize(dr);
                s.InitializeBusinessData(dr);
                s.IsDirty = false;
                s.IsNew = false;
                s.evtIsSavable += new IsSavableHandler(s_evtIsSavable);
                _list.Add(s);
            }

            return this;
        }
コード例 #3
0
ファイル: BookList.cs プロジェクト: bkrichard/LibraryWebSite
        public BookList GetAll()
        {
            _list.Clear();
            Database db = new Database("Books");

            db.Command.CommandType = System.Data.CommandType.StoredProcedure;
            db.Command.CommandText = "tblBookGETALL";
            DataTable dt = db.ExecuteQuery();

            //dgvStudent.DataSource = dt;
            foreach (DataRow dr in dt.Rows)
            {
                Book s = new Book();
                s.Initialize(dr);
                s.InitializeBusinessData(dr);
                s.IsDirty       = false;
                s.IsNew         = false;
                s.evtIsSavable += new IsSavableHandler(s_evtIsSavable);
                _list.Add(s);
            }

            return(this);
        }
コード例 #4
0
ファイル: BookList.cs プロジェクト: bkrichard/LibraryWebSite
        public BookList GetByBookTypeID(Guid bookTypeID)
        {
            _list.Clear();
            Database db = new Database("Books");

            db.Command.CommandType = System.Data.CommandType.StoredProcedure;
            db.Command.CommandText = "tblBookGETBYBOOKTYPEID";
            db.Command.Parameters.Add("@BookTypeID", SqlDbType.UniqueIdentifier).Value = bookTypeID;
            DataTable dt = db.ExecuteQuery();

            //dgvStudent.DataSource = dt;
            foreach (DataRow dr in dt.Rows)
            {
                Book s = new Book();
                s.Initialize(dr);
                s.InitializeBusinessData(dr);
                s.IsDirty       = false;
                s.IsNew         = false;
                s.evtIsSavable += new IsSavableHandler(s_evtIsSavable);
                _list.Add(s);
            }

            return(this);
        }