Exemple #1
0
        public RepositoryImage AddImage(string imageName, MemoryStream stream)
        {
            var image = new RepositoryImage();

            image.Name   = imageName;
            image.Stream = stream;

            var record = m_dbAdapter.Image.New(image.Name, string.Empty);

            image.Guid           = record.Guid;
            image.CreateUserName = record.CreateUserName;
            image.CreateTime     = record.CreateTime;
            record.Path          = image.SaveToDisk();
            m_dbAdapter.Image.Update(record);
            return(image);
        }
Exemple #2
0
        public RepositoryImage GetImage(string guid, bool autoLoadImage = true)
        {
            var record = m_dbAdapter.Image.GetByGuid(guid);

            var image = new RepositoryImage();

            image.Name           = record.Name;
            image.Guid           = record.Guid;
            image.CreateUserName = record.CreateUserName;
            image.CreateTime     = record.CreateTime;
            image.Id             = record.Id;

            if (autoLoadImage)
            {
                image.LoadFromDisk();
            }

            return(image);
        }