示例#1
0
        public PPal()
        {
            try
            {
                aux     = false;
                Pulsado = false;
                InitializeComponent();
                Botones.BackColor     = Color.Transparent;
                pictureBox1.BackColor = Color.Transparent;
                pictureBox2.BackColor = Color.Transparent;
                pictureBox3.BackColor = Color.Transparent;
                pictureBox4.BackColor = Color.Transparent;
                Botones.Parent        = pictureBox5;
                pictureBox1.Parent    = pictureBox5;
                pictureBox2.Parent    = pictureBox5;
                pictureBox3.Parent    = pictureBox5;
                pictureBox4.Parent    = pictureBox5;

                xml       = new XmlElementoSer();
                BD        = new BDS();
                Variables = new Globales();
                xml.Open(true, ref aux);
                Variables.VVIP = aux;
                BD.Open(xml.VConex, true, xml.VTablas);
                BD.BD("DELETE FROM Noticias WHERE Fecha<'" + string.Format("{0:yyyy/MM/dd HH:mm}", FechNY2()) + "'");
                System.Threading.Thread.Sleep(200);
                BD.Open(xml.VConex, true, xml.VTablas);
                BS                            = new BindingSource();
                BS.DataSource                 = BD.Tabla("Usuarios");
                BS.Filter                     = "VIP='" + Variables.VVIP + "'";
                Clientes                      = new CUsuarios();
                SP                            = new System.Media.SoundPlayer("Sonido.wav");
                pictureBox2.Visible           = false;
                DGNot.DataSource              = BD.Tabla("Noticias");
                DGNot.Columns[0].Visible      = false;
                DGNot.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                DGNot.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                DocConf.Load("Config.xml");
                n = DocConf.SelectSingleNode("Config");
                if (n != null)
                {
                    version = Convert.ToInt16(n.ChildNodes.Item(3).InnerText);
                }
            }
            catch (Exception ex)
            {
                Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11));
            }
        }
示例#2
0
        public Login(BDS B, XmlElementoSer C, Globales V)
        {
            try
            {
                InitializeComponent();
                label1.BackColor      = Color.Transparent;
                label2.BackColor      = Color.Transparent;
                pictureBox1.BackColor = Color.Transparent;
                label1.Parent         = pictureBox2;
                label2.Parent         = pictureBox2;
                pictureBox1.Parent    = pictureBox2;

                BD        = B;
                XmlConfig = C;
                Cr        = V;
                BS        = new BindingSource();

                BS.DataSource = BD.Tabla("Usuarios");
                BS.Filter     = "Administrador=true AND VIP='" + V.VVIP + "'";

                CUsuarios.DataSource    = BS;
                CUsuarios.ValueMember   = "Usuario";
                CUsuarios.DisplayMember = "Usuario";
            }
            catch (Exception ex)
            {
                Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11));
            }
        }
示例#3
0
        public static int Login(CUsuarios Us, BDS Base, string txt, ref string Nom, ref string cl)
        {
            string[] res;

            res = Captura(txt);

            if (res.Length == 2)
            {
                Nom = res[0];
                cl  = res[1];
            }
            else
            {
                return(0);
            }

            DataRow[] DRC;
            try
            {
                if (Us.Exist(Nom))
                {
                    return(4);
                }
                DRC = Base.Tabla("Usuarios").Select("Usuario='" + Nom + "' AND VIP='false'");
                if (DRC.Length > 0)
                {
                    TimeSpan duracion = DateTime.Parse(DRC[0].ItemArray[8].ToString()) - DateTime.Today;
                    if (duracion.Days < 0)
                    {
                        return(1);
                    }
                    if (DRC[0].ItemArray[2].ToString() == Encriptar(cl))
                    {
                        return(2);
                    }
                }
                else
                {
                    return(0);
                }
                return(0);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
示例#4
0
        public Usuarios(BDS B, bool VVIP, XmlElementoSer X)
        {
            try
            {
                InitializeComponent();
                toolStrip1.BackColor = Color.Transparent;
                groupBox2.BackColor  = Color.Transparent;
                groupBox1.BackColor  = Color.Transparent;
                groupBox2.Location   = new Point(13, 155);

                toolStrip1.Parent = pictureBox1;
                groupBox2.Parent  = pictureBox1;
                groupBox1.Parent  = pictureBox1;


                Xl                    = X;
                Vp                    = VVIP;
                BD                    = B;
                BS                    = new BindingSource();
                BS.DataSource         = BD.Tabla("Usuarios");
                BS.Filter             = "VIP='" + VVIP + "'";
                DG.DataSource         = BS;
                DG.Columns[0].Visible = DG.Columns[2].Visible = DG.Columns[4].Visible = DG.Columns[5].Visible = DG.Columns[7].Visible = false;

                TUsuario.DataBindings.Add(new Binding("Text", BS, "Usuario"));
                TUsuario.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.Never;

                TMail.DataBindings.Add(new Binding("Text", BS, "Correo"));
                TMail.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.Never;

                CHAdmin.DataBindings.Add(new Binding("Checked", BS, "Administrador"));
                CHAdmin.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.Never;
            }
            catch (Exception ex)
            {
                Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11));
            }
        }
示例#5
0
        private void BAceptar_Click(object sender, EventArgs e)
        {
            DataRow[] DRC;
            string    c1, c2;

            try
            {
                DRC = BD.Tabla("Usuarios").Select("Usuario='" + CUsuarios.Text + "'");

                TimeSpan duracion = DateTime.Parse(DRC[0].ItemArray[8].ToString()) - DateTime.Today;
                if (duracion.Days < 0)
                {
                    MessageBox.Show("Su licencia a Expirado");
                    Cr.VCerrar = true;
                    Close();
                    return;
                }

                c1 = DRC[0].ItemArray[2].ToString();
                c2 = Funciones.Encriptar(TClave.Text);

                if (c1 != c2)
                {
                    MessageBox.Show("Clave Incorrecta!!!");
                    return;
                }
                Cr.VNombre = CUsuarios.Text;

                Cr.VCerrar = false;
                Close();
            }
            catch (Exception ex)
            {
                Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11));
            }
        }
示例#6
0
        private void Tim_Tick(object sender, EventArgs e)
        {
            TimeSpan ts;

            try
            {
                Hora.Text = HoraNY();

                Global++;
                if (Global >= 150)
                {
                    Global = 0;
                    Send(Sc, "$" + (char)25 + "\r", true);
                    BD.BD("SELECT * FROM Noticias ORDER BY fecha ASC");
                    DTN = BD.Tabla("Noticias");
                    //DTN = BD.Tabla("Noticias","SELECT * FROM Noticias ORDER BY ");
                    if (DTN.Rows.Count > 0)
                    {
                        if (TNotP.Text != DTN.Rows[0].ItemArray[1].ToString())
                        {
                            notn     = true;
                            Tm       = false;
                            Um       = false;
                            NT       = false;
                            compvent = false;
                        }
                        TNotP.Text = DTN.Rows[0].ItemArray[1].ToString();
                        HN         = Convert.ToDateTime(DTN.Rows[0].ItemArray[2].ToString());
                        ts         = HN - FechNY2();
                        if (ts.TotalSeconds < 0)
                        {
                            BD.BD("DELETE FROM Noticias WHERE Fecha<'" + string.Format("{0:yyyy/MM/dd HH:mm}", FechNY2()) + "'");
                            System.Threading.Thread.Sleep(200);
                            BD.Open(xml.VConex, true, xml.VTablas);
                            DGNot.DataSource = BD.Tabla("Noticias");
                        }
                    }
                    else
                    {
                        TNotP.Text = "No Hay noticia";
                    }
                }
                if (notn)
                {
                    ts = HN - FechNY2();
                    if (ts.Hours == 0 && ts.Minutes == 3 && ts.Seconds == 0 && !Tm)
                    {
                        B3Min_Click(null, null);
                        Tm = true;
                    }
                    if (ts.Hours == 0 && ts.Minutes == 1 && ts.Seconds == 0 && !Um)
                    {
                        B1Min_Click(null, null);
                        Um = true;
                    }
                    if (ts.Hours == 0 && ts.Minutes == 0 && ts.Seconds == -15 && !NT)
                    {
                        notn = false;
                        NT   = true;
                        if (!compvent)
                        {
                            BNoTrade_Click(null, null);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11));
            }
        }
示例#7
0
        private void BAceptar_Click(object sender, EventArgs e)
        {
            DataRow[] DRC;
            DataRow   DR;
            string    Clave, espira;

            System.Threading.Thread TR = new System.Threading.Thread(Enviar);

            Clave = Funciones.Contra(6);

            if (TUsuario.TextLength <= 0)
            {
                MessageBox.Show("Escriba Usuario!!!");
                return;
            }
            if (TMail.TextLength <= 0)
            {
                MessageBox.Show("Escriba el correo!!!");
                return;
            }

            if (Convert.ToInt32(TDias.Text) <= 0)
            {
                MessageBox.Show("Escriba los días!!!");
                return;
            }

            if (!Funciones.validarEmail(TMail.Text))
            {
                MessageBox.Show("Escriba un correo válido!!!");
                return;
            }


            Tex  = "Hola,\n\r¡¡FELICITACIONES!! el acceso a AutoclickNews está listo.\n\rUsuario: " + TUsuario.Text + "\n\rContraseña: " + Clave + "\n\rBienvenido a bordo y que generes miles de dólares!\n\rLender & Jorge\n\rPD. No responder este correo ya que no lo revisamos.\n\r*****************************\n\r";
            Tex += "Hello,\n\r¡¡CONGRATULATIONS!! access to AutoClickNews is ready.\n\rUser: "******"\n\rPassword: "******"\n\rWelcome and generate thousands of dollars!\n\rLender & Jorge\n\rPD. Não responda este e-mail porque não revisado.\n\r*****************************\n\r";
            Tex += "Olá,\n\r¡¡PARABÉNS! acesso a AutoClickNews está pronto..\n\rUsuário: " + TUsuario.Text + "\n\rSenha: " + Clave + "\n\rBem-vindo e gerar milhares de dólares!\n\rLender & Jorge\n\rPD. Do not reply this email because will not review.\n\r*****************************\n\r";

            espira = DTFecha.Value.AddDays(Convert.ToInt32(TDias.Text)).ToString("yyyy/MM/dd");

            try
            {
                DRC = BD.Tabla("Usuarios").Select("Usuario='" + TUsuario.Text + "' AND VIP='" + Vp + "'");
                if (DRC.Length > 0)
                {
                    if (MessageBox.Show("Usuario ya existe, ¿Desea Modificarlo?", "¡ADVERTENCIA!", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (!(BD.BD("UPDATE Usuarios SET Correo='" + TMail.Text + "', Clave='" + Funciones.Encriptar(Clave) + "', Administrador=" + CHAdmin.Checked + ", VIP=" + Vp + ", Expira='" + espira + "' WHERE Usuario='" + TUsuario.Text + "'")))
                        {
                            MessageBox.Show("Revise los datos, el registro no puede ser guardado");
                            return;
                        }
                        DR                  = BD.NuevoR("Usuarios");
                        DR["Usuario"]       = TUsuario.Text;
                        DR["Clave"]         = Funciones.Encriptar(Clave);
                        DR["Correo"]        = TMail.Text;
                        DR["Administrador"] = CHAdmin.Checked;
                        DR["Expira"]        = espira;
                        DR["VIP"]           = Vp;
                        BD.Eliminar("Usuarios", DRC[0]);
                        BD.Agregar("Usuarios", DR);
                        Mailto = DR["Correo"].ToString();
                        Tit    = "AutoClickNews Access / Acceso AutoclickNews / Acesso AutoClickNews";
                        TR.Start();
                    }
                    return;
                }
                if (!(BD.BD(string.Format("INSERT INTO Usuarios (Usuario,Clave,Administrador,VIP,Correo,Expira) values ('{0}','{1}',{2},{3},'{4}','{5}')", TUsuario.Text, Funciones.Encriptar(Clave), CHAdmin.Checked, Vp, TMail.Text, espira))))
                {
                    MessageBox.Show("Revise los datos, el registro no puede ser guardado");
                    return;
                }
                DR                  = BD.NuevoR("Usuarios");
                DR["Usuario"]       = TUsuario.Text;
                DR["Clave"]         = Funciones.Encriptar(Clave);
                DR["Administrador"] = CHAdmin.Checked;
                DR["Correo"]        = TMail.Text;
                DR["Expira"]        = espira;
                DR["VIP"]           = Vp;
                BD.Agregar("Usuarios", DR);
                Mailto = DR["Correo"].ToString();
                Tit    = "AutoClickNews Access / Acceso AutoclickNews / Acesso AutoClickNews";
                TR.Start();
            }
            catch (Exception ex)
            {
                Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11));
            }
        }