Пример #1
0
        private void btnprueba_servicio_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            Basico ejecuta = new Basico();
            string error   = ejecuta.ejecuta_proceso_oracle();

            MessageBox.Show(error);
            Cursor.Current = Cursors.Default;
        }
        void tmservicio_ora_data_Elapsed(object sender, ElapsedEventArgs e)
        {
            Int32 _valor = 0;

            try
            {
                if (_valida_ora_data == 0)
                {
                    _valor           = 1;
                    _valida_ora_data = 1;

                    Basico procesar = new Basico();

                    string _error = procesar.ejecuta_proceso_oracle();
                    if (_error.Length > 0)
                    {
                        TextWriter tw = new StreamWriter(ruta_log, true);
                        tw.WriteLine(DateTime.Today.ToString() + " " + DateTime.Now.ToString("HH:mm:ss") + "==>" + _error);
                        tw.Flush();
                        tw.Close();
                        tw.Dispose();
                    }
                    _valida_ora_data = 0;
                }
                //****************************************************************************
            }
            catch (Exception EXC)
            {
                TextWriter tw = new StreamWriter(ruta_log, true);
                tw.WriteLine(DateTime.Today.ToString() + " " + DateTime.Now.ToString("HH:mm:ss") + "==>" + EXC.Message);
                tw.Flush();
                tw.Close();
                tw.Dispose();
                _valida_ora_data = 0;
            }

            if (_valor == 1)
            {
                _valida_ora_data = 0;
            }
        }