Ejemplo n.º 1
0
 public async Task <ScanImageResponse> ScanImageAsync(ScanImageRequest request)
 {
     AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions();
     return(await ScanImageExAsync(request, runtime));
 }
Ejemplo n.º 2
0
 public ScanImageResponse ScanImage(ScanImageRequest request)
 {
     AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions();
     return(ScanImageEx(request, runtime));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Uloží aktualizovanou obálku nebo obsah na server.
        /// </summary>
        /// <param name="scanFile"></param>
        /// <param name="fullName"></param>
        /// <param name="obalkyKnihCZ"></param>
        /// <returns></returns>
        public static bool UpdateScanImage(ScanFile scanFile, string fullName, bool obalkyKnihCZ = false)
        {
            if (scanFile == null) throw new ArgumentNullException("scanFile");
            if (String.IsNullOrEmpty(fullName)) throw new ArgumentNullException("Nebyla zadána cesta k souboru", "fullName");

            ScanImageRequest request = new ScanImageRequest();
            request.ScanFileID = scanFile.ScanFileID;
            request.BookID = scanFile.BookID;
            request.PartOfBook = scanFile.PartOfBook;
            request.UseOCR = scanFile.UseOCR;
            request.Computer = Environment.MachineName;
            request.Image = ImageFunctions.ReadFile(fullName);
            request.Comment = scanFile.Comment;
            request.ObalkyKnihCZ = obalkyKnihCZ;
            ScanFileResponse response = AuthController.GetProxy().Execute(client => client.SaveScanImage(request));

            return response.Result;
        }
Ejemplo n.º 4
0
 public async Task <ScanImageResponse> ScanImageExAsync(ScanImageRequest request, AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime)
 {
     AlibabaCloud.TeaUtil.Common.ValidateModel(request);
     return(TeaModel.ToObject <ScanImageResponse>(await DoRequestAsync("ScanImage", "HTTPS", "POST", "2019-12-30", "AK", null, request.ToMap(), runtime)));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Uloží naskenovanou obálku nebo obsah na server.
        /// </summary>
        public static bool InsertScanImage(int bookID, PartOfBook partOfBook, bool useOCR, string fullName, string comment = null, bool obalkyKnihCZ = false)
        {
            if (bookID == 0) throw new ArgumentException("Nebyl zadán identifikátor knihy", "bookID");
            if (String.IsNullOrEmpty(fullName)) throw new ArgumentNullException("Nebyla zadána cesta k souboru", "fullName");

            ScanImageRequest request = new ScanImageRequest();
            request.BookID = bookID;
            request.PartOfBook = partOfBook;
            request.UseOCR = useOCR;
            request.Computer = Environment.MachineName;
            request.Image = ImageFunctions.ReadFile(fullName);
            request.Comment = comment;
            request.ObalkyKnihCZ = obalkyKnihCZ;
            ScanFileResponse response = AuthController.GetProxy().Execute(client => client.SaveScanImage(request));

            return response.Result;
        }