Example #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));
            }
        }
Example #2
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));
            }
        }