コード例 #1
0
        //public static bool DeleteGalleryImage(int moduleID, int itemID)
        //{
        //    bool result =  dbGallery.DeleteGalleryImage(itemID);

        //    IndexHelper.RemoveGalleryImageIndexItem(moduleID, itemID);

        //    return result;
        //}

        public static DataTable GetImagesByPage(int siteId, int pageId)
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("ItemID", typeof(int));
            dataTable.Columns.Add("ModuleID", typeof(int));
            dataTable.Columns.Add("ModuleTitle", typeof(string));
            dataTable.Columns.Add("Caption", typeof(string));
            dataTable.Columns.Add("Description", typeof(string));
            dataTable.Columns.Add("ViewRoles", typeof(string));
            dataTable.Columns.Add("UploadDate", typeof(DateTime));

            using (IDataReader reader = DBGallery.GetImagesByPage(siteId, pageId))
            {
                while (reader.Read())
                {
                    DataRow row = dataTable.NewRow();

                    row["ItemID"]      = reader["ItemID"];
                    row["ModuleID"]    = reader["ModuleID"];
                    row["ModuleTitle"] = reader["ModuleTitle"];
                    row["Caption"]     = reader["Caption"];
                    row["Description"] = reader["Description"];
                    row["ViewRoles"]   = reader["ViewRoles"];
                    row["UploadDate"]  = Convert.ToDateTime(reader["UploadDate"]);

                    dataTable.Rows.Add(row);
                }
            }

            return(dataTable);
        }
コード例 #2
0
        private bool Create()
        {
            int newID = -1;

            this.itemGuid = Guid.NewGuid();

            newID = DBGallery.AddGalleryImage(
                this.itemGuid,
                this.moduleGuid,
                this.moduleID,
                this.displayOrder,
                this.caption,
                this.description,
                this.metaDataXml,
                this.imageFile,
                this.webImageFile,
                this.thumbnailFile,
                this.uploadDate,
                this.uploadUser,
                this.userGuid);

            this.itemID = newID;

            bool result = (newID > -1);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            //IndexHelper.IndexItem(this);

            return(result);
        }
コード例 #3
0
        private void GetGalleryImage(int itemId)
        {
            using (IDataReader reader = DBGallery.GetGalleryImage(itemId))
            {
                if (reader.Read())
                {
                    this.itemID        = Convert.ToInt32(reader["ItemID"]);
                    this.moduleID      = Convert.ToInt32(reader["ModuleID"]);
                    this.displayOrder  = Convert.ToInt32(reader["DisplayOrder"]);
                    this.caption       = reader["Caption"].ToString();
                    this.description   = reader["Description"].ToString();
                    this.metaDataXml   = reader["MetaDataXml"].ToString();
                    this.imageFile     = reader["ImageFile"].ToString();
                    this.webImageFile  = reader["WebImageFile"].ToString();
                    this.thumbnailFile = reader["ThumbnailFile"].ToString();
                    this.uploadDate    = Convert.ToDateTime(reader["UploadDate"]);
                    this.uploadUser    = reader["UploadUser"].ToString();

                    this.itemGuid   = new Guid(reader["ItemGuid"].ToString());
                    this.moduleGuid = new Guid(reader["ModuleGuid"].ToString());
                    string user = reader["UserGuid"].ToString();
                    if (user.Length == 36)
                    {
                        this.userGuid = new Guid(user);
                    }
                }
            }
        }
コード例 #4
0
        public bool Delete()
        {
            bool result = false;

            result = DBGallery.DeleteGalleryImage(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #5
0
        private bool Update()
        {
            bool result = DBGallery.UpdateGalleryImage(
                this.itemID,
                this.moduleID,
                this.displayOrder,
                this.caption,
                this.description,
                this.metaDataXml,
                this.imageFile,
                this.webImageFile,
                this.thumbnailFile,
                this.uploadDate,
                this.uploadUser);

            //IndexHelper.IndexItem(this);
            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
コード例 #6
0
 public static bool DeleteByModule(int moduleId)
 {
     return(DBGallery.DeleteByModule(moduleId));
 }
コード例 #7
0
 public static bool DeleteBySite(int siteId)
 {
     return(DBGallery.DeleteBySite(siteId));
 }
コード例 #8
0
        //public static bool DeleteGalleryImage(int itemID)
        //{
        //    return dbGallery.GalleryImage_DeleteGalleryImage(itemID);

        //}

        public static IDataReader GetAllImages(int moduleId)
        {
            return(DBGallery.GetAllImages(moduleId));
        }
コード例 #9
0
        //public DataSet GetThumbsByPageDataset(int pageNumber, int thumbsPerPage)
        //{
        //    return dbGallery.GetThumbsByPageDataset(this.galleryID, pageNumber, thumbsPerPage);

        //}

        public DataTable GetWebImageByPage(int pageNumber)
        {
            return(DBGallery.GetWebImageByPage(this.galleryID, pageNumber));
        }
コード例 #10
0
 public DataTable GetThumbsByPage(int pageNumber, int thumbsPerPage)
 {
     return(DBGallery.GetThumbsByPage(this.galleryID, pageNumber, thumbsPerPage));
 }
コード例 #11
0
 public IDataReader GetAllImages()
 {
     return(DBGallery.GetAllImages(this.galleryID));
 }