Пример #1
0
        /// <summary>
        /// Uloží data obálky nebo obsahu na server.
        /// </summary>
        public static bool CancelOcrContents(int scanFileID, string comment = null)
        {
            if (scanFileID == 0) throw new ArgumentException("Nebyl zadán identifikátor obsahu", "scanFileID");

            ScanFileRequest request = new ScanFileRequest();
            request.ScanFileID = scanFileID;
            request.Computer = Environment.MachineName;
            request.Comment = comment;
            ScanFileResponse response = AuthController.GetProxy().Execute(client => client.CancelOcrContents(request));

            return response.Result;
        }
Пример #2
0
        /// <summary>
        /// Stáhne naskenovaný obsah na lokální počítač.
        /// </summary>
        /// <param name="scanFileID">Identifikátor obsahu</param>
        /// <param name="tifPath">Cesta souboru pro uložení naskenovaného TIF souboru</param>
        /// <param name="comment">Komentář</param>
        /// <returns></returns>
        public static bool CheckOutContents(int scanFileID, string tifPath, string comment = null)
        {
            if (scanFileID == 0) throw new ArgumentException("Nebyl zadán identifikátor obsahu", "scanFileID");
            if (String.IsNullOrEmpty(tifPath)) throw new ArgumentException("Nebyla zadána cesta k uložení souboru", "tifPath");
            if (System.IO.File.Exists(tifPath)) System.IO.File.Delete(tifPath);

            bool result = false;

            ScanFileRequest request = new ScanFileRequest();
            request.ScanFileID = scanFileID;
            request.Computer = Environment.MachineName;
            request.Comment = comment;
            ScanImageResponse response = AuthController.GetProxy().Execute(client => client.CheckOutContents(request));

            if (response != null)
            {
                result = ImageFunctions.WriteFile(tifPath, response.Image, true) > 0;
            }

            return result;
        }