示例#1
0
文件: Form1.cs 项目: feml/cursoUdemy
        private void main()
        {
            string   LogAplication = string.Empty;
            DateTime fecIni        = DateTime.Now;

            #region Definicion del bloque de seguridad
            string       usuario   = string.Empty;
            string       password  = string.Empty;
            string       usuEmail  = string.Empty;
            string       passEmail = string.Empty;
            string       ambiente  = string.Empty;
            SecurityPrvt security  = new SecurityPrvt();
            try
            {
                usuario = security.Decode("fmontoya");
            }
            catch (System.Exception)
            {
                usuario = security.Decode("usuario");
            }
            try
            {
                password = security.Decode("f935cjm9262");
            }
            catch (System.Exception)
            {
                password = security.Decode("password");
            }
            try
            {
                usuEmail = security.Decode("robotcorreo");
            }
            catch (System.Exception)
            {
                usuEmail = security.Decode("usuEmail");
            }
            try
            {
                passEmail = security.Decode("Tys860504882");
            }
            catch (System.Exception)
            {
                passEmail = security.Decode("passEmail");
            }
            try
            {
                ambiente = security.Decode("produccion");
            }
            catch (System.Exception)
            {
                ambiente = security.Decode("desarrollo");
            }
            #endregion fin de la Definicion del bloque de seguridad

            DataTable dt = new DataTable();

            using (LogicaCaVarios lg = new LogicaCaVarios(usuario, password, usuEmail, passEmail, ambiente))
            {
                try
                {
                    dt = lg.InicioNn(dtFecIni, dtFecFin);
                }
                catch (Exception ex)
                {
                    LogAplication += ex.Message;
                    Console.WriteLine(LogAplication);
                }
            }
            if (dt.Rows.Count > 0)
            {
                dgvConsulta.DataSource = dt;
            }
        }
示例#2
0
        private static void nn(string[] args)
        {
            string   LogAplication = string.Empty;
            DateTime fecIni        = DateTime.Now;

            #region Definicion del bloque de seguridad
            string       usuario   = string.Empty;
            string       password  = string.Empty;
            string       usuEmail  = string.Empty;
            string       passEmail = string.Empty;
            string       ambiente  = string.Empty;
            SecurityPrvt security  = new SecurityPrvt();
            try
            {
                usuario = security.Decode(args[0].ToString());
            }
            catch (System.Exception)
            {
                usuario = security.Decode("usuario");
            }
            try
            {
                password = security.Decode(args[1].ToString());
            }
            catch (System.Exception)
            {
                password = security.Decode("password");
            }
            try
            {
                usuEmail = security.Decode(args[2].ToString());
            }
            catch (System.Exception)
            {
                usuEmail = security.Decode("usuEmail");
            }
            try
            {
                passEmail = security.Decode(args[3].ToString());
            }
            catch (System.Exception)
            {
                passEmail = security.Decode("passEmail");
            }
            try
            {
                ambiente = security.Decode(args[4].ToString());
            }
            catch (System.Exception)
            {
                ambiente = security.Decode("desarrollo");
            }
            #endregion fin de la Definicion del bloque de seguridad

            using (LogicaCaVarios lg = new LogicaCaVarios(usuario, password, usuEmail, passEmail, ambiente))
            {
                DataTable dt = new DataTable();
                try
                {
                    dt = lg.InicioNn(DateTime.Now, DateTime.Now);
                }
                catch (Exception ex)
                {
                    LogAplication += ex.Message;
                    Console.WriteLine(LogAplication);
                }
            }

            /*
             * cicloVida.Append(DateTime.Now.ToLongDateString()+" "+DateTime.Now.ToLongTimeString()+"\r\n");
             * cicloVida.Append("" + "\r\n");
             */
        }