private void ExecuteProcess()
        {
            try
            {
                hilos = new List <System.Threading.Thread>();

                ProcesosMasivosAplicacion procesoMasivo = new ProcesosMasivosAplicacion();
                Proceso proceso = new Proceso("ClientSignalVolvo.Procesos.HubVolvo");

                System.Threading.Thread hilo = new System.Threading.Thread(procesoMasivo.EjecutarProceso);
                hilo.Start(proceso);
                hilos.Add(hilo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            try
            {
                List <System.Threading.Thread> hilos = new List <System.Threading.Thread>();

                ProcesosMasivosAplicacion procesoMasivo = new ProcesosMasivosAplicacion();
                Proceso proceso = new Proceso("ClientSignalVolvo.Procesos.HubVolvo");

                System.Threading.Thread hilo = new System.Threading.Thread(procesoMasivo.EjecutarProceso);
                hilo.Start(proceso);
                hilos.Add(hilo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            try
            {
                List <System.Threading.Thread> hilos = new List <System.Threading.Thread>();

                ProcesosMasivosAplicacion procesoMasivo = new ProcesosMasivosAplicacion();
                Proceso proceso = new Proceso("ServicioRobotMSA.Procesos.PosicionamientoLogUsaquen");

                System.Threading.Thread hilo = new System.Threading.Thread(procesoMasivo.EjecutarProceso);
                hilo.Start(proceso);
                hilos.Add(hilo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void ExecuteProcess()
        {
            try
            {
                ProcesosMasivosAplicacion procesoMasivo = new ProcesosMasivosAplicacion();
                Proceso proceso = null;

                if (hilos.Count(x => x.Name == "ServicioRobotMSA.Procesos.PosicionamientoLogUsaquen") == 0 && DateTime.Now.Hour > 0 && DateTime.Now.Hour < 8)
                {
                    proceso = new Proceso("ServicioRobotMSA.Procesos.PosicionamientoLogUsaquen");
                    System.Threading.Thread hilo = new System.Threading.Thread(procesoMasivo.EjecutarProceso);
                    hilo.Name = "ServicioRobotMSA.Procesos.PosicionamientoLogUsaquen";
                    hilo.Start(proceso);
                    hilos.Add(hilo);
                }

                if (hilos.Count(x => x.Name == "ServicioRobotMSA.Procesos.PosicionamientoLogSanCristobal") == 0 && DateTime.Now.Hour > 0 && DateTime.Now.Hour < 8)
                {
                    proceso = new Proceso("ServicioRobotMSA.Procesos.PosicionamientoLogSanCristobal");
                    System.Threading.Thread hilo = new System.Threading.Thread(procesoMasivo.EjecutarProceso);
                    hilo.Name = "ServicioRobotMSA.Procesos.PosicionamientoLogSanCristobal";
                    hilo.Start(proceso);
                    hilos.Add(hilo);
                }
            }
            catch (Exception ex)
            {
                // Get normal filepath of this assembly's permanent directory
                string dir = System.Configuration.ConfigurationManager.AppSettings["dirlog"];

                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }

                string clase = this.GetType().Name;
                string path  = dir + clase + DateTime.Now.ToString("yyyyMMddHHmmss") + "Error.txt";
                if (!File.Exists(path))
                {
                    // Create a file to write to.
                    using (StreamWriter sw = File.CreateText(path))
                    {
                        sw.WriteLine("------------------------Message-------------------------------------");
                        sw.WriteLine(ex.Message);
                        sw.WriteLine("------------------------Message-------------------------------------");
                        if (ex.InnerException != null)
                        {
                            sw.WriteLine("------------------------InnerException-------------------------------------");
                            sw.WriteLine(ex.InnerException.Message);
                            sw.WriteLine("------------------------InnerException-------------------------------------");
                            sw.WriteLine("------------------------InnerException-StackTrace-------------------------------------");
                            sw.WriteLine(ex.InnerException.StackTrace);
                            sw.WriteLine("------------------------InnerException-StackTrace-------------------------------------");
                        }
                        sw.WriteLine("------------------------StackTrace-------------------------------------");
                        sw.WriteLine(ex.StackTrace);
                        sw.WriteLine("------------------------StackTrace-------------------------------------");
                    }
                }
            }
        }