Пример #1
0
        private void copiar_archivo_service(string _name)
        {
            try
            {
                //string _ruta_local_service = @"D:\POS\Transmision.net\" + _name;

                string _ruta_local_service = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\" + _name;

                BataTransmision.bata_transaccionSoapClient updateversion = new BataTransmision.bata_transaccionSoapClient();
                BataTransmision.Autenticacion conexion = new BataTransmision.Autenticacion();
                conexion.user_name     = "emcomer";
                conexion.user_password = "******";

                byte[] _archivo = updateversion.ws_dll_service_tda(conexion, _name);
                System.IO.File.WriteAllBytes(_ruta_local_service, _archivo);

                //if (_name == "Transmision.Net.Basico.dll")
                //{
                //    _dbftienda();
                FileInfo infofile_pro = new FileInfo(@_ruta_local_service);
                var      fvi_pro      = FileVersionInfo.GetVersionInfo(@_ruta_local_service);
                var      version_pro  = fvi_pro.FileVersion;

                string _act = updateversion.ws_update_versiondll_net(conexion, _tienda, infofile_pro.Name, version_pro);
                //}
            }
            catch
            {
            }
        }
        //private static string _path_default = @"D:\POS";
        private static void copiar_archivo_service(string _name)
        {
            try
            {
                string _ruta_local_service = @"D:\Transmision.Net.Oracle\" + _name;

                BataTransmision.bata_transaccionSoapClient updateversion = new BataTransmision.bata_transaccionSoapClient();
                BataTransmision.Autenticacion conexion = new BataTransmision.Autenticacion();
                conexion.user_name     = "emcomer";
                conexion.user_password = "******";

                byte[] _archivo = updateversion.ws_dll_service_tda(conexion, _name);
                System.IO.File.WriteAllBytes(_ruta_local_service, _archivo);

                if (_name == "Transmision.Net.Basico.Oracle.dll")
                {
                    //_dbftienda();
                    //if (_tienda == null)
                    //{
                    //    if (Environment.GetEnvironmentVariable("codtda") != null)
                    //        _tienda = "50" + Environment.GetEnvironmentVariable("codtda").ToString();
                    //}
                    FileInfo infofile_pro = new FileInfo(@_ruta_local_service);
                    var      fvi_pro      = FileVersionInfo.GetVersionInfo(@_ruta_local_service);
                    var      version_pro  = fvi_pro.FileVersion;

                    string _act = updateversion.ws_update_versiondll_net(conexion, _tienda, infofile_pro.Name, version_pro);
                }
            }
            catch
            {
                throw;
            }
        }
Пример #3
0
        private void _update_version_serviowin()
        {
            try
            {
                //TextWriter tw = new StreamWriter(@"D:\POS\Transmision.net\ERROR.txt", true);
                //tw.WriteLine("ANTES DE INGRESAR AL SERVICE");
                //tw.Flush();
                //tw.Close();
                //tw.Dispose();
                //vamos a verificar y vemos si hay alguna actualizacion del servicio windows
                //esta respuesta tiene que ser de la web service de archivos de actualizacion
                //var _assembly = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;

                string _assembly = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

                string _exe_servicio = "Transmision.Net.Basico.Oracle.dll";
                string _path_service = _assembly + "\\" + _exe_servicio;
                var    fvi           = FileVersionInfo.GetVersionInfo(_path_service);
                var    version       = fvi.FileVersion;

                BataTransmision.bata_transaccionSoapClient updateversion = new BataTransmision.bata_transaccionSoapClient();
                BataTransmision.Autenticacion conexion = new BataTransmision.Autenticacion();
                conexion.user_name     = "emcomer";
                conexion.user_password = "******";

                Boolean _valida_version = updateversion.ws_existe_serviciowin_version_ORA(conexion, version);

                if (_valida_version)
                {
                    //TextWriter tw1 = new StreamWriter(@"D:\POS\Transmision.net\ERROR.txt", true);
                    //tw1.WriteLine("reintentando");
                    //tw1.Flush();
                    //tw1.Close();
                    //tw1.Dispose();

                    string _exe_name = "Transmision.NetWin.Update.Oracle.exe";
                    string _path     = _assembly + "\\" + _exe_name;
                    System.Diagnostics.Process.Start(@_path);
                }
            }
            catch
            {
                //throw;
            }
        }
Пример #4
0
        private void _update_version_winupdateexe()
        {
            try
            {
                string _assembly     = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                string _exe_servicio = "Transmision.NetWin.Update.Oracle.exe";
                string _path_service = _assembly + "\\" + _exe_servicio;
                var    fvi           = FileVersionInfo.GetVersionInfo(_path_service);
                var    version       = fvi.FileVersion;
                BataTransmision.bata_transaccionSoapClient updateversion = new BataTransmision.bata_transaccionSoapClient();
                BataTransmision.Autenticacion conexion = new BataTransmision.Autenticacion();
                conexion.user_name     = "emcomer";
                conexion.user_password = "******";

                Boolean _valida_version = updateversion.ws_existe_exewinupdate_version_ORA(conexion, version);
                if (_valida_version)
                {
                    copiar_archivo_service(_exe_servicio);
                }
            }
            catch
            {
            }
        }