コード例 #1
0
ファイル: DozpService.cs プロジェクト: ppucik/DOZP
        public ScanFileResponse CancelOcrContents(ScanFileRequest request)
        {
            try
            {
                string userName = GetUserName();
                ScanFileComponent.Instance.CancelOcrContents(request.ScanFileID, userName, request.Computer, request.Comment);

                return new ScanFileResponse(request.ScanFileID, true);
            }
            catch (Exception ex)
            {
                string message = String.Format("Chyba při ukládání dát záznamu (ID={0})", request.ScanFileID);
                throw new FaultException<DozpServiceFault>(new DozpServiceFault(message), ex.Message);
            }
        }
コード例 #2
0
ファイル: DozpService.cs プロジェクト: ppucik/DOZP
        public ScanFileResponse UndoContents(ScanFileRequest request)
        {
            if (request == null) throw new ArgumentException("Request parameter is null.");

            try
            {
                string userName = GetUserName();
                ScanFileComponent.Instance.UndoCheckOut(request.ScanFileID, userName, request.Computer, request.Comment);

                return new ScanFileResponse(request.ScanFileID, true);
            }
            catch (Exception ex)
            {
                string message = String.Format("Nepodařilo se vrátit zpět předcházející operaraci záznamu (ID={0}).", request.ScanFileID);
                throw new FaultException<DozpServiceFault>(new DozpServiceFault(message), ex.Message);
            }
        }
コード例 #3
0
ファイル: DozpService.cs プロジェクト: ppucik/DOZP
        public ScanImageResponse GetScanImage(ScanFileRequest request)
        {
            try
            {
                ScanImageResponse response = null;

                byte[] image = null;
                ScanFile scanFile = ScanFileComponent.Instance.GetScanImage(request.ScanFileID, ref image);

                if (scanFile != null)
                {
                    response = new ScanImageResponse();
                    response.ScanFileID = scanFile.ScanFileID;
                    response.Image = image;
                }

                return response;
            }
            catch (Exception ex)
            {
                string message = String.Format("Nepodařilo se stáhnout naskenovaný soubor (ID={0}) na lokální počítač.", request.ScanFileID);
                throw new FaultException<DozpServiceFault>(new DozpServiceFault(message), ex.Message);
            }
        }
コード例 #4
0
ファイル: DozpService.cs プロジェクト: ppucik/DOZP
        public ScanFileResponse DiscardContents(ScanFileRequest request)
        {
            if (request == null) throw new ArgumentException("Request parameter is null.");

            try
            {
                string userName = GetUserName();
                ScanFileComponent.Instance.Discard(request.ScanFileID, userName, request.Computer, request.Comment);

                return new ScanFileResponse(request.ScanFileID, true);
            }
            catch (Exception ex)
            {
                string message = String.Format("Nepodařilo vyřadit záznam (ID={0}) ze zpracování.", request.ScanFileID);
                throw new FaultException<DozpServiceFault>(new DozpServiceFault(message), ex.Message);
            }
        }
コード例 #5
0
ファイル: DozpService.cs プロジェクト: ppucik/DOZP
        public ScanFileResponse DeleteScanFile(ScanFileRequest request)
        {
            if (request == null) throw new ArgumentException("Request parameter is null.");

            try
            {
                string userName = GetUserName();
                ScanFileComponent.Instance.Delete(request.ScanFileID, userName);

                return new ScanFileResponse(request.ScanFileID, true);
            }
            catch (Exception ex)
            {
                string message = String.Format("Nepodařilo se vymazat záznam (ID={0}).", request.ScanFileID);
                throw new FaultException<DozpServiceFault>(new DozpServiceFault(message), ex.Message);
            }
        }
コード例 #6
0
ファイル: DozpService.cs プロジェクト: ppucik/DOZP
        public ScanImageResponse CheckOutContents(ScanFileRequest request)
        {
            if (request == null) throw new ArgumentException("Request parameter is null.");

            try
            {
                string userName = GetUserName();
                byte[] image = ScanFileComponent.Instance.CheckOut(request.ScanFileID, userName, request.Computer, request.Comment);

                return new ScanImageResponse(request.ScanFileID, image);
            }
            catch (Exception ex)
            {
                string message = String.Format("Nepodařilo se stáhnout naskenovaný obsah (ID={0}) na lokální počítač.", request.ScanFileID);
                throw new FaultException<DozpServiceFault>(new DozpServiceFault(message), ex.Message);
            }
        }