Пример #1
0
        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
        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
        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
        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);
        }