Exemplo n.º 1
0
        /// <summary>
        /// The Binddata method on this User Control is used to
        ///     obtain a DataReader of picture information from the Pictures
        ///     table, and then databind the results to a templated DataList
        ///     server control. It uses the Appleseed.PictureDB()
        ///     data component to encapsulate all data functionality.
        /// </summary>
        /// <param name="page">
        /// The page.
        /// </param>
        private void BindData(int page)
        {
            var pictures   = new PicturesDB();
            var dsPictures = pictures.GetPicturesPaged(
                this.ModuleID, page, Int32.Parse(this.Settings["PicturesPerPage"].ToString()), this.Version);

            if (dsPictures.Tables.Count > 0 && dsPictures.Tables[0].Rows.Count > 0)
            {
                this.pgPictures.RecordCount = (int)dsPictures.Tables[0].Rows[0]["RecordCount"];
            }

            this.dlPictures.DataSource = dsPictures;
            this.dlPictures.DataBind();
        }
Exemplo n.º 2
0
        /// <summary>
        /// The Binddata method on this User Control is used to
        /// obtain a DataReader of picture information from the Pictures
        /// table, and then databind the results to a templated DataList
        /// server control. It uses the Rainbow.PictureDB()
        /// data component to encapsulate all data functionality.
        /// </summary>
        private void BindData(int page)
        {
            PicturesDB pictures   = new PicturesDB();
            DataSet    dsPictures =
                pictures.GetPicturesPaged(ModuleID, page, Int32.Parse(Settings["PicturesPerPage"].ToString()), Version);

            if (dsPictures.Tables.Count > 0 && dsPictures.Tables[0].Rows.Count > 0)
            {
                pgPictures.RecordCount = (int)(dsPictures.Tables[0].Rows[0]["RecordCount"]);
            }

            dlPictures.DataSource = dsPictures;
            dlPictures.DataBind();
        }