public CommonController(SiteSettingService settingService, UserService userService, ImageStorageService imageService, ImageProcessor imageProcessor, ILogger <CommonController> logger) : base(userService)
 {
     _settingService = settingService;
     _imageService   = imageService;
     _imageProcessor = imageProcessor;
     _logger         = logger;
 }
Exemple #2
0
        public static DataTable GetImageByNum(string imageNum, Guid userId)
        {
            ImageStorageService iss = new ImageStorageService();
            DataTable           dt  = iss.GetImageByAuthAndNum(imageNum, userId);

            return(dt);
            //DataRow dr = dt.Rows[0];
            //return QJVRMS.Business.ImageStorage.ParseImageStorage(dr);
        }
Exemple #3
0
        //public static IImageStorage GetImageInfoByNum(string serialNum)
        //{
        //    ImageStorageService iss = new ImageStorageService();
        //    string objStr = iss.GetImageInfoByNum(serialNum);

        //    QJVRMS.Common.SerializeObjectFactory sof = new QJVRMS.Common.SerializeObjectFactory();
        //    object o = sof.DesializeFromBase64(objStr);

        //    QJVRMS.Business.ImageStorage oimage = (QJVRMS.Business.ImageStorage)o;

        //    return oimage;
        //}

        public static IImageStorage GetImageInfoByItemId(Guid itemId, Guid userId)
        {
            ImageStorageService iss = new ImageStorageService();
            // string objStr = iss.GetImageInfoByItemId(itemId);
            DataTable dt = iss.GetImageInfoByAuthAndId(itemId, userId);

            return(ImageStorage.ParseImageStorage(dt.Rows[0]));

            //QJVRMS.Common.SerializeObjectFactory sof = new QJVRMS.Common.SerializeObjectFactory();
            //object o = sof.DesializeFromBase64(objStr);

            //QJVRMS.Business.ImageStorage oimage = (QJVRMS.Business.ImageStorage)o;
        }
Exemple #4
0
        /// <summary>
        /// 修改图片信息
        /// </summary>
        /// <param name="img"></param>
        /// <returns></returns>
        public static bool UpdateImageStorage(IImageStorage img)
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.UpdateImageStorage(img.ItemId,
                                          img.Caption,
                                          img.Address,
                                          img.Character,
                                          img.StartDate,
                                          img.EndDate,
                                          img.shotDate,
                                          img.Keyword,
                                          img.Description));
        }
Exemple #5
0
        /// <summary>
        /// 修改图片信息
        /// </summary>
        /// <param name="img"></param>
        /// <returns></returns>
        public static bool UpdateImageStorage(IImageStorage img)
        {
            ImageStorageService iss = new ImageStorageService();
            return iss.UpdateImageStorage(img.ItemId,
                img.Caption,
                img.Address,
                img.Character,
                img.StartDate,
                img.EndDate,
                img.shotDate,
                img.Keyword,
                img.Description);

        }
        private string UploadImage(Guid userId, string imageType, string filename, byte[] fileBytes, params string[] tags)
        {
            Task <string> op = ImageStorageService.StoreImageAsync(userId.ToString(), imageType.ToLower() + "_" + filename, fileBytes, tags);

            op.Wait();

            if (!op.IsCompletedSuccessfully)
            {
                throw op.Exception;
            }

            string url = op.Result;

            return(url);
        }
Exemple #7
0
        private string DeleteImage(Guid userId, string imageType, string filename)
        {
            Task <string> op = ImageStorageService.DeleteImageAsync(userId.ToString(), imageType.ToLower() + "_" + filename);

            op.Wait();

            if (!op.IsCompletedSuccessfully)
            {
                throw op.Exception;
            }

            string url = op.Result;

            return(url);
        }
Exemple #8
0
        /// <summary>
        /// 根据关键字搜索图片
        /// 获取 ItemSerialNum,Hvsp 属性值
        /// </summary>
        /// <returns></returns>
        public static string AddImageStorage(IImageStorage imgStorage)
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.AddImageStorage(imgStorage.userId,
                                       imgStorage.FileName,
                                       imgStorage.FolderName,
                                       imgStorage.Caption,
                                       imgStorage.Address,
                                       imgStorage.Character,
                                       imgStorage.StartDate,
                                       imgStorage.EndDate,
                                       imgStorage.shotDate,
                                       imgStorage.Keyword,
                                       imgStorage.Description,
                                       imgStorage.ImageType,
                                       imgStorage.Hvsp,
                                       imgStorage.ItemId,
                                       imgStorage.ItemSerialNum,
                                       imgStorage.GroupId));
        }
Exemple #9
0
        /// <summary>
        /// 根据关键字搜索图片 
        /// 获取 ItemSerialNum,Hvsp 属性值
        /// </summary>
        /// <returns></returns>
        public static string AddImageStorage(IImageStorage imgStorage)
        {
            ImageStorageService iss = new ImageStorageService();
            return iss.AddImageStorage(imgStorage.userId,
                imgStorage.FileName,
                imgStorage.FolderName,
                imgStorage.Caption,
                imgStorage.Address,
                imgStorage.Character,
                imgStorage.StartDate,
                imgStorage.EndDate,
                imgStorage.shotDate,
                imgStorage.Keyword,
                imgStorage.Description,
                imgStorage.ImageType,
                imgStorage.Hvsp,
                imgStorage.ItemId,
                imgStorage.ItemSerialNum,
                imgStorage.GroupId);

        }
Exemple #10
0
        private static void CreateProduct(CatalogDbContext context, string name, string description, Category category, decimal price, string image)
        {
            var    service = new ImageStorageService();
            var    file    = System.Web.HttpContext.Current.Server.MapPath(image);
            string imageUrl;

            using (var reader = System.IO.File.OpenRead(file))
            {
                imageUrl = service.SaveImage(file, reader);
            }

            var p = new Product
            {
                Id          = Guid.NewGuid().ToString(),
                Name        = name,
                Description = description,
                Category    = category,
                Price       = price,
                Image       = imageUrl
            };

            context.Products.Add(p);
        }
Exemple #11
0
        public static bool AddAttach(Guid itemId, string fileName)
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.AddAttach(itemId, fileName));
        }
Exemple #12
0
        public static void Production_Hires_Down_Log(string filaName, string fileType, string downusername, string usage, string enduser, string folder, bool Errflag)
        {
            ImageStorageService iss = new ImageStorageService();

            iss.Production_Hires_Down_Log(filaName, fileType, downusername, usage, enduser, folder, Errflag);
        }
Exemple #13
0
 public static bool AddAttach(Guid itemId,string fileName)
 {
     ImageStorageService iss = new ImageStorageService();
     return iss.AddAttach(itemId, fileName);
 }
 public SubmitMarkers(MarkersService markersService, ImageStorageService imageStorageService)
 {
     this.markersService      = markersService;
     this.imageStorageService = imageStorageService;
 }
 public CommonController(SiteSettingService settingService, UserService userService, ImageStorageService imageService) : base(userService)
 {
     _settingService = settingService;
     _imageService   = imageService;
 }
Exemple #16
0
 public static DataTable GetAttachList(Guid itemId)
 {
     ImageStorageService iss = new ImageStorageService();
     return iss.GetAttachList(itemId);
 }
Exemple #17
0
        public static DataSet GetCatalogByItemId(string itemId)
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.GetImageCatalog(itemId));
        }
Exemple #18
0
 public static DataTable GetImageByNum(string imageNum, Guid userId)
 {
     ImageStorageService iss = new ImageStorageService();
     DataTable dt = iss.GetImageByAuthAndNum(imageNum, userId);
     return dt;
     //DataRow dr = dt.Rows[0];
     //return QJVRMS.Business.ImageStorage.ParseImageStorage(dr);
 }
Exemple #19
0
 public void CreateRelationshipImageAndCatalog(Guid Itemid, Guid[] catalogid)
 {
     ImageStorageService iss = new ImageStorageService();
     iss.AddImageToCatalog(catalogid, Itemid);
 }
Exemple #20
0
        public static bool DeleteImageStorage(Guid itemId)
        {
            ImageStorageService iss = new ImageStorageService();
            return iss.DeleteImageStorage(itemId);

        }
Exemple #21
0
 /// <summary>
 /// 统计信息
 /// </summary>
 /// <returns></returns>
 public static DataTable GetStatImages()
 {
     ImageStorageService iss = new ImageStorageService();
     return iss.GetImageStatic();
 }
Exemple #22
0
 public static DataSet GetCatalogByItemId(string itemId)
 {
     ImageStorageService iss = new ImageStorageService();
     return iss.GetImageCatalog(itemId);
 }
Exemple #23
0
        public static void DeleteAttach(Guid attId)
        {
            ImageStorageService iss = new ImageStorageService();

            iss.DeleteAttach(attId);
        }
Exemple #24
0
        public static DataTable GetAttachList(Guid itemId)
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.GetAttachList(itemId));
        }
Exemple #25
0
 public static DataTable GetLightBoxItems(Guid userId)
 {
     ImageStorageService iss = new ImageStorageService();
     return iss.GetLightBoxList(userId);
 }
Exemple #26
0
        public void CreateRelationshipImageAndCatalog(Guid Itemid, Guid[] catalogid)
        {
            ImageStorageService iss = new ImageStorageService();

            iss.AddImageToCatalog(catalogid, Itemid);
        }
Exemple #27
0
 public static void DeleteAttach(Guid attId)
 {
     ImageStorageService iss = new ImageStorageService();
     iss.DeleteAttach(attId);
 }
Exemple #28
0
        public static bool DeleteImageStorage(Guid itemId)
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.DeleteImageStorage(itemId));
        }
Exemple #29
0
 public static bool DeleteItemOfLightBox(Guid userId, Guid itemId)
 {
     ImageStorageService iss = new ImageStorageService();
     return iss.DelItemFromLightBox(userId, itemId);
 }
Exemple #30
0
        //public static IImageStorage GetImageInfoByNum(string serialNum)
        //{
        //    ImageStorageService iss = new ImageStorageService();
        //    string objStr = iss.GetImageInfoByNum(serialNum);

        //    QJVRMS.Common.SerializeObjectFactory sof = new QJVRMS.Common.SerializeObjectFactory();
        //    object o = sof.DesializeFromBase64(objStr);

        //    QJVRMS.Business.ImageStorage oimage = (QJVRMS.Business.ImageStorage)o;

        //    return oimage;
        //}

        public static IImageStorage GetImageInfoByItemId(Guid itemId, Guid userId)
        {

            ImageStorageService iss = new ImageStorageService();
            // string objStr = iss.GetImageInfoByItemId(itemId);
            DataTable dt = iss.GetImageInfoByAuthAndId(itemId, userId);

            return ImageStorage.ParseImageStorage(dt.Rows[0]);

            //QJVRMS.Common.SerializeObjectFactory sof = new QJVRMS.Common.SerializeObjectFactory();
            //object o = sof.DesializeFromBase64(objStr);

            //QJVRMS.Business.ImageStorage oimage = (QJVRMS.Business.ImageStorage)o;

          
        }
Exemple #31
0
        public static DataTable GetLightBoxItems(Guid userId)
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.GetLightBoxList(userId));
        }
Exemple #32
0
        public static bool DeleteItemOfLightBox(Guid userId, Guid itemId)
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.DelItemFromLightBox(userId, itemId));
        }
Exemple #33
0
        /// <summary>
        /// 统计信息
        /// </summary>
        /// <returns></returns>
        public static DataTable GetStatImages()
        {
            ImageStorageService iss = new ImageStorageService();

            return(iss.GetImageStatic());
        }
 public ImagesController()
 {
     _imageStoreService = new ImageStorageService();
 }
Exemple #35
0
        public static void Production_Hires_Down_Log(string filaName, string fileType, string downusername, string usage, string enduser,string folder, bool Errflag)
        {

            ImageStorageService iss = new ImageStorageService();
            iss.Production_Hires_Down_Log(filaName, fileType, downusername, usage, enduser, folder, Errflag);
        }