Example #1
0
 private void manejador_de_evento_botones_generados(object sender, EventArgs e)
 {
     Button fuente = (Button)sender;
     nro = fuente.Name;
     nombre12 = fuente.Text;
     int d = nombre12.LastIndexOf(" ");
     string nombre13;
     if (d != -1)
     {
         nombre13 = nombre12.Substring(0, d);
         if (nombre13 == "PADEL")
         {
             Turno frm = new Turno(nro, nombre12, nombre13, caja,fecha);
             frm.ShowDialog();
         }
         else
         {
             adicion1 frm = new adicion1(nro, nombre12, nombre13, "", "",fecha);
             frm.ShowDialog();
         }
     }
     else
     {
         Consumo_Interno frm = new Consumo_Interno(nro,fecha);
         frm.ShowDialog();
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            DataTable dt = oacceso.leerDatos("select idempleados from empleados where empleado = '" + comboBox1.Text + "' and contrasena = '" + textBox1.Text + "'");
            int x = 0;
            foreach(DataRow dr in dt.Rows)
            {
                string i = Convert.ToString(dr["idempleados"]);

                    Consumo_Interno frm = new Consumo_Interno(nro, fecha, Convert.ToInt32(i));
                    frm.Show();
                    this.Close();
                    x = 1;
            }
            if (x == 0)
            {
                MessageBox.Show("La contraseƱa no coincide con el empleado");
            }
        }