示例#1
0
        public bool GetPrinterConfiguration(RequestBase request)
        {
            FindFiscalPrinterQuery findFiscalPrinter = new FindFiscalPrinterQuery(request.Document.Header.PrinterName, request.Document.Header.Channel);
            var printers = _queryProcessor.Handler <FindFiscalPrinterQuery, IEnumerable <Entities.FiscalPrinter> >(findFiscalPrinter);

            if (printers.Count() != 1)
            {
                return(false);
            }
            else
            {
                var printer = printers.FirstOrDefault();
                request.Document.Header.Ip           = printer.Ip;
                request.Document.Header.Port         = int.Parse(printer.Port);
                request.Document.Header.PrinterModel = printer.Model;
            }
            return(true);
        }