Exemple #1
0
        public IHttpActionResult PrintDocument(string tipo, [FromBody] string url)
        {
            pipe = new PipeService();
            string respuesta = pipe.ComponentPipe(url);

            return(Ok(respuesta));
        }
Exemple #2
0
        public IHttpActionResult GenerarCertificado([FromBody] CertificadoModel certificado)
        {
            pipe = new PipeService();
            var    oConfig   = Configuracion.Instancia();
            string respuesta = string.Empty;

            if (certificado != null)
            {
                var fIni = certificado.FechaInicio.Replace('/', '-');
                var fFin = certificado.FechaTermino.Replace('/', '-');

                DateTime fechaInicio  = new DateTime();
                DateTime fechaTermino = new DateTime();

                fechaInicio  = Convert.ToDateTime(fIni);
                fechaTermino = Convert.ToDateTime(fFin);



                string urlCertificado = oConfig.IpEndPoint + ':' + oConfig.PortEndPoint + oConfig.UrlRelativa +
                                        "SaesaCertificados/" +
                                        certificado.idEmp + "/" +
                                        certificado.NumCli + "/" +
                                        fechaInicio.ToString("dd-MM-yyyy") + "/" +
                                        fechaTermino.ToString("dd-MM-yyyy") + '/' +
                                        certificado.TipCert + "/WS";
                respuesta = pipe.ComponentPipeDownLoadFile(urlCertificado);
            }
            return(Ok(respuesta));
        }
Exemple #3
0
        public IHttpActionResult PrintCertificado([FromBody] CertificadoModel certificado)
        {
            pipe = new PipeService();
            var    oConfig   = Configuracion.Instancia();
            string respuesta = string.Empty;

            if (certificado != null)
            {
                DateTime fechaInicio  = new DateTime();
                DateTime fechaTermino = new DateTime();

                fechaInicio  = Convert.ToDateTime(certificado.FechaInicio);
                fechaTermino = Convert.ToDateTime(certificado.FechaTermino);

                string urlCertificado = oConfig.IpEndPoint + ':'
                                        + oConfig.PortEndPoint +
                                        oConfig.UrlRelativa + "SaesaCertificados/" +
                                        certificado.idEmp + "/" +
                                        certificado.NumCli + "/" +
                                        fechaInicio + "/" +
                                        fechaTermino + '/' +
                                        certificado.TipCert + "WS";
                respuesta = pipe.ComponentPipeDownLoadFile(urlCertificado);
            }
            return(Ok(respuesta));
        }
 public static void Terminate()
 {
     MagnitudeService.Teardown();
     PipeService.Teardown();
     ParentHeartbeatService.Teardown();
     Environment.Exit(0);
 }
        private void Dispose(Boolean safeToDisposeManagedObjects)
        {
            if (safeToDisposeManagedObjects == false)
            {
                return;
            }           //we have no unmaaged objects to worry about for purposes of this class

            _ps = null;
        }
Exemple #6
0
        // A basic dispose.
        public void Dispose()
        {
            this.ServiceOff();

            if (_ps != null)
            {
                _ps = null;
            }
        }
        public void Init()
        {
            if ((Application.Current as App)?.OriginalInstance == true)
            {
                _pipeService = new PipeService();
                _pipeService.CommandExecuted += PipeService_CommandExecuted;
                _pipeServer = new PipeServer(Config.PipeEndpoint);
                _pipeServer.StartServer(_pipeService);

                var args = Environment.GetCommandLineArgs();
                if (args.Length > 1 && !_commands.Contains(args[1], StringComparer.OrdinalIgnoreCase))
                {
                    PipeService_CommandExecuted(this, new CommandExecutedEventArgs(CmdlineCommands.Open, args[1]));
                }
            }
        }
        public void Awake()
        {
            DontDestroyOnLoad(this);

            Debugger.WriteLine(LogLevel.Info, $"Starting up Maid Fiddler {Version}");

            service = new MFService(this);
            service.eventServer.ConnectionLost += OnConnectionLost;

            Debugger.WriteLine(LogLevel.Info, "Starting server!");

            pipeServer = new PipeService <MFService>(service, "MaidFiddlerService");
            pipeServer.ConnectionLost += OnConnectionLost;
            pipeServer.Run();

            Debugger.WriteLine(LogLevel.Info, "Started server!");
        }
Exemple #9
0
        public IHttpActionResult PrintDctoTbk([FromBody] DetallePagoClienteModel detalle)
        {
            string msg = string.Empty;

            int    ret;
            long   jid;
            string aux;
            string printerName = "NII ExD NP-K205";

            pipe = new PipeService();

            var respuesta = pipe.ComponentPipePrintVoutcher(printerName, detalle.ResumenPago);

            Log.Write("Usabilidad", msg, Evento.Response, ServicioPago.Comandos.PagoTbk);
            return(Ok(new ApiResponse()
            {
                Code = 0, Message = "OK".ToString()
            }));
        }
        public IHttpActionResult CierreTbk()
        {
            Movimiento movimiento = null;
            string     msg        = string.Empty;

            movimiento = new Movimiento();
            msg        = movimiento.ValidarTbk(ServicioPago.Comandos.CierreTbk, oConfig.IdKiosko);
            PipeService pipe = new PipeService();

            var algo = msg.Split('~');

            var respuesta = pipe.ComponentPipePrintVoutcher("", algo[2]);

            Log.Write("Usabilidad", msg, Evento.Response, ServicioPago.Comandos.PagoTbk);
            return(Ok(new ApiResponse()
            {
                Code = 0, Message = "OK".ToString()
            }));
        }
Exemple #11
0
        /// <summary>
        /// 初始化
        /// </summary>
        static async Task <bool> Init()
        {
            var cmdParse = new CmdParseService("HmiPro", GlobalConfig.StartupArgs.HmiProPath);

            UnityIocService.RegisterGlobalDepend(cmdParse);
            UnityIocService.RegisterGlobalDepend <HttpParse>();
            UnityIocService.RegisterGlobalDepend <AsylumService>();

            UnityIocService.ResolveDepend <AsylumService>().Init();
            if (!await UnityIocService.ResolveDepend <HttpParse>().Start("http://+:9988/"))
            {
                Logger.Error("Http 服务启动失败");
                return(false);
            }
            var pipeService = new PipeService("Asylum");

            UnityIocService.RegisterGlobalDepend(pipeService);
            return(pipeService.Start());
        }
Exemple #12
0
        public IHttpActionResult PrintDctoPago([FromBody] DetallePagoClienteModel detalle)
        {
            pipe = new PipeService();

            DetallePagoClienteDao cuponPago = new DetallePagoClienteDao();

            cuponPago.NroCliente     = detalle.NroCliente;
            cuponPago.Empresa        = detalle.Empresa;
            cuponPago.NombreCliente  = detalle.NombreCliente;
            cuponPago.RutCliente     = detalle.RutCliente;
            cuponPago.DvCliente      = detalle.DvCliente;
            cuponPago.Direccion      = detalle.Direccion;
            cuponPago.Comuna         = detalle.Comuna;
            cuponPago.Tarifa         = detalle.Tarifa;
            cuponPago.TipoDocumento  = Convert.ToInt32(detalle.TipoDocumento);
            cuponPago.TotalDoc       = detalle.TotalDoc;
            cuponPago.TotalCancelado = detalle.TotalCancelado;

            if (detalle.DetallePagos.Count > 0)
            {
                var i = 0;
                cuponPago.DetallePagos = new List <DetallePagoDao>();
                foreach (var d in detalle.DetallePagos)
                {
                    var det = new DetallePagoDao();
                    det.FechaEmision = d.FechaEmision;
                    det.Monto        = d.Monto;
                    det.NumDoc       = d.NumDoc;
                    det.TipoDoc      = d.TipoDoc;
                    cuponPago.DetallePagos.Add(det);

                    string respuesta = pipe.ComponentPipe(cuponPago);
                    i++;
                }
            }


            // string respuesta = pipe.ComponentPipe(cuponPago);

            return(Ok());
        }
Exemple #13
0
        public IHttpActionResult PrintDctoPago(int idEmp, long idServ, [FromBody] DetallePagoClienteModel detalle)
        {
            string arreglo        = string.Empty;
            string respuesta      = string.Empty;
            string detalleCliente = string.Empty;

            var pagging = new PaginParameterModel()
            {
                _pageSize = 30
            };
            IHttpActionResult httpResp = new DocumentoController().DocumentoPago(idEmp, idServ, pagging);

            var items = ((OkNegotiatedContentResult <ResponseClient <DocumentoObj> >)httpResp).Content;

            if (detalle != null)
            {
                detalleCliente = detalle.NroCliente + ";" +
                                 detalle.Empresa + ";" +
                                 detalle.NombreCliente + ";" +
                                 detalle.RutCliente + ";" +
                                 detalle.DvCliente + ";" +
                                 detalle.Direccion + ";" +
                                 detalle.Comuna + ";" +
                                 detalle.Tarifa;
            }
            if (items.Items.Count > 0)
            {
                for (var i = 0; i < items.Items.Count; i++)
                {
                    arreglo += items.Items[i].NroDocto.ToString() + ";" + items.Items[i].MontoPago.ToString() + ";" + items.Items[i].FechaPago.ToString() + ";" + items.Items[i].MedioPago.ToString() + "@";
                }
            }
            pipe      = new PipeService();
            arreglo   = arreglo.Substring(0, arreglo.Length - 1);
            arreglo   = detalleCliente + "#" + arreglo;
            respuesta = pipe.ComponentPipe(arreglo, "historial");

            return(Ok(respuesta));
        }
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            Console.WriteLine("starting");
            Store.Data = new StoreInstance();

            if (args.Length > 0)
            {
                int processId = -1;
                if (int.TryParse(args[0], out processId))
                {
                    Store.Data.App.ParentProcessId = processId;
                }
                else
                {
                    Loggers.CliLogger.Error("No parent process ID argument detected.");
                }
            }

            ParentHeartbeatService.Monitor();
            PipeService.Listen();
        }
Exemple #15
0
 /// <summary>
 /// Creates a new pipe controller.
 /// </summary>
 /// <param name="pipeService">The pipe service.</param>
 public PipeController(PipeService pipeService) => _pipeService = pipeService;
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            BringToForeground();
            NotificationsWin.AutoOpen = true;
            positionManager.RestoreSizeAndLocation(Config);

            Config.PropertyChanged += Config_PropertyChanged;
            Config.FilterSettings.PropertyChanged += FilterSettings_PropertyChanged;

            gamesStats = new GamesStats(GameDatabase.Instance);
            MenuMainMenu.DataContext     = this;
            MenuViewSettings.DataContext = Config;
            FilterSelector.DataContext   = new FilterSelectorConfig(gamesStats, Config.FilterSettings);
            CheckFilterView.DataContext  = Config.FilterSettings;
            GridGamesView.AppSettings    = Config;

            if (!Config.FirstTimeWizardComplete)
            {
                var window = new FirstTimeStartupWindow()
                {
                    Owner = this
                };

                if (window.ShowDialog() == true)
                {
                    config.SteamSettings.IdSource                = window.SteamImportLibByName ? SteamIdSource.Name : SteamIdSource.LocalUser;
                    Config.SteamSettings.AccountId               = window.SteamIdLibImport;
                    Config.SteamSettings.IntegrationEnabled      = window.SteamEnabled;
                    Config.SteamSettings.LibraryDownloadEnabled  = window.SteamImportLibrary;
                    Config.SteamSettings.AccountName             = window.SteamAccountName;
                    Config.GOGSettings.IntegrationEnabled        = window.GOGEnabled;
                    Config.GOGSettings.LibraryDownloadEnabled    = window.GogImportLibrary;
                    Config.OriginSettings.IntegrationEnabled     = window.OriginEnabled;
                    Config.OriginSettings.LibraryDownloadEnabled = window.OriginImportLibrary;
                    Config.UplaySettings.IntegrationEnabled      = window.UplayEnabled;
                    importSteamCatWizard   = window.SteamImportCategories;
                    importSteamCatWizardId = window.SteamIdCategoryImport;

                    if (window.DatabaseLocation == FirstTimeStartupWindow.DbLocation.Custom)
                    {
                        Config.DatabasePath = window.DatabasePath;
                    }
                    else
                    {
                        FileSystem.CreateFolder(Paths.UserProgramDataPath);
                        Config.DatabasePath = System.IO.Path.Combine(Paths.UserProgramDataPath, "games.db");
                    }

                    GameDatabase.Instance.OpenDatabase(Config.DatabasePath);
                    AddInstalledGames(window.ImportedGames);

                    Config.FirstTimeWizardComplete = true;
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Config"));
                }
            }

            if (!Config.EmulatorWizardComplete)
            {
                GameDatabase.Instance.OpenDatabase(Config.DatabasePath);
                var window = new EmulatorImportWindow(DialogType.Wizard)
                {
                    Owner = this
                };

                if (window.ShowDialog() == true)
                {
                    Config.EmulatorWizardComplete = true;
                }
            }

            if (!Config.MigrationV2PcPlatformAdded)
            {
                GameDatabase.Instance.OpenDatabase(Config.DatabasePath);
                var db = GameDatabase.Instance;
                foreach (var game in db.GamesCollection.Find(a => a.Provider != Provider.Custom).ToList())
                {
                    db.AssignPcPlatform(game);
                    db.UpdateGameInDatabase(game);
                }

                Config.MigrationV2PcPlatformAdded = true;
            }

            LoadGames(Config.UpdateLibStartup);
            CheckUpdate();
            SendUsageData();
            Focus();

            pipeService = new PipeService();
            pipeService.CommandExecuted += PipeService_CommandExecuted;
            pipeServer = new PipeServer(Settings.GetAppConfigValue("PipeEndpoint"));
            pipeServer.StartServer(pipeService);

            var args = Environment.GetCommandLineArgs();

            if (args.Count() > 0 && args.Contains("-command"))
            {
                var commandArgs = args[2].Split(new char[] { ':' });
                var command     = commandArgs[0];
                var cmdArgs     = commandArgs.Count() > 1 ? commandArgs[1] : string.Empty;
                PipeService_CommandExecuted(this, new CommandExecutedEventArgs(command, cmdArgs));
            }
        }
Exemple #17
0
 protected override void Initialize()
 {
     this.discovery   = netPeerGroup.DiscoveryService;
     this.pipeservice = netPeerGroup.PipeService;
 }