Ejemplo n.º 1
0
        public IPrintResult Print(IPrintData printData)
        {
            AutoResetEvent autoResetEvent = this.printServiceNotificationProvider.AddNotification(printData.PrintJobIInfo);
            IPrintManager  printManager   = this.printManagerChannelFactory.CreateManager(printData.PrintJobIInfo.Key);

            try
            {
                printManager.Print(printData.PrintJobIInfo, printData.Source, printData.Settings, printData.GetDatasource());
                if (autoResetEvent.WaitOne(printData.Settings.Timeout))
                {
                    return(this.printServiceNotificationProvider.GetResponse(printData.PrintJobIInfo));
                }
                else
                {
                    return(new PrintErrorResult(printData.PrintJobIInfo)
                    {
                        Reason = FailReason.Timeout, ReasonCode = "Service Timeout. No Response returned after given time"
                    });
                }
            }
            catch (CommunicationException communicationException)
            {
                return(new PrintErrorResult(printData.PrintJobIInfo)
                {
                    Reason = FailReason.ServiceUnavailable, ReasonCode = communicationException.GetExceptionMessage()
                });
            }
        }
Ejemplo n.º 2
0
 public ProductsController(IAppUserManager user, IProductManager product, IPurchaseManager purchase, IPrintManager print, ICartManager cart)
 {
     _user     = user;
     _product  = product;
     _purchase = purchase;
     _print    = print;
     _cart     = cart;
 }
Ejemplo n.º 3
0
 public DummyViewModel(
     IScreen screen,
     IUnitOfWorkFactory unitOfWorkFactory,
     IPrintManager printManager,
     IFilterViewModelFactory filterViewModelFactory)
 {
     HostScreen              = screen;
     _unitOfWorkFactory      = unitOfWorkFactory;
     _printManager           = printManager;
     _filterViewModelFactory = filterViewModelFactory;
 }
Ejemplo n.º 4
0
        public PrintTheDemandViewModel(
            IFilterViewModelFactory filterViewModelFactory,
            IRoutableViewModelManager routableViewModelManager,
            IPrintManager printManager,
            IMessageBus messageBus)
        {
            messageBus.Listen <WarehouseQualityCertificateLiteDto>()
            .Subscribe(selectedCertificate => SelectedWarehouseQualityCertificate = selectedCertificate);

            _filterViewModelFactory   = filterViewModelFactory;
            _routableViewModelManager = routableViewModelManager;
            _printManager             = printManager;
        }
Ejemplo n.º 5
0
 public EditableActSelectionOfProbeDepartmentViewModel(
     IScreen screen,
     IMessageBus messageBus,
     IPrintManager printManager,
     IUnitOfWorkFactory unitOfWork,
     IFilterViewModelFactory filterViewModelFactory,
     IValidatorFactory validatorFactory)
     : base(screen, messageBus, validatorFactory)
 {
     _filterViewModelFactory = filterViewModelFactory;
     _unitOfWorkFactory      = unitOfWork;
     _printManager           = printManager;
     StaffingDivisionMakingSample.InvokeCommand.Execute(null);
     StaffingDivisionReceiver.InvokeCommand.Execute(null);
 }
 public ActSelectionOfProbeViewModel(
     IScreen screen,
     IFilterViewModelFactory filterViewModelFactory,
     IUnitOfWorkFactory unitOfWorkFactory,
     IRoutableViewModelManager routableViewModelManager,
     IPrintManager printManager,
     IMessenger messenger)
 {
     _messenger                = messenger;
     _printManager             = printManager;
     _filterViewModelFactory   = filterViewModelFactory;
     HostScreen                = screen;
     _filterViewModelFactory   = filterViewModelFactory;
     _unitOfWorkFactory        = unitOfWorkFactory;
     _routableViewModelManager = routableViewModelManager;
     _Filter = _filterViewModelFactory.Create <CertificateQualityFilter, CertificateQualityLiteDto>();
 }
Ejemplo n.º 7
0
        public IPrintResult Print(IPrintData printData)
        {
            this.printServiceNotificationProvider.AddSubscription(printData.PrintJobIInfo, this.printManagerNotificationHandler);
            IPrintManager printManager = this.printManagerChannelFactory.CreateManager(printData.PrintJobIInfo.Key);

            try
            {
                printManager.Print(printData.PrintJobIInfo, printData.Source, printData.Settings, printData.GetDatasource());
                return(null);
            }
            catch (CommunicationException communicationException)
            {
                this.printServiceNotificationProvider.RemoveSubscription(printData.PrintJobIInfo);
                return(new PrintErrorResult(printData.PrintJobIInfo)
                {
                    Reason = FailReason.ServiceUnavailable, ReasonCode = communicationException.GetExceptionMessage()
                });
            }
        }
Ejemplo n.º 8
0
 public Converter(IWorkbookFactory wf, IPrintManager pm)
 {
     this.printManager    = pm;
     this.workbookFactory = wf;
     this.logger          = NLog.LogManager.GetCurrentClassLogger();
 }