using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp3
{
public partial class Form1 : Form
{
public struct cabina
{
public string nombre;
public int sector;
public int velocidadR;
public int velocidadL;
public int dia;
public int mes;
public int año;
public double multa;
public string registro;
public cabina(string n, int e, int c, int p, int q, int w, int g, double m, string r)
{
nombre = n;
sector = e;
velocidadR = c;
velocidadL = p;
dia = q;
mes = w;
año = g;
multa = m;
registro = r;
}
}//ESTRUCTURA1
//////////////////////////////////////////////////
public Form1()
{
InitializeComponent();
}//FORM1
//////////////////////////////////////////////////
public cabina[] vector = new cabina[100]; //
public int x = 1, y, v3, v4, v5, v6, v7, v8; // DECLARACION
public bool flag = false; // DE VARIABLES
public string v1, v2; //
///////////////////////////////////////////////////////
private void Form1_Load(object sender, EventArgs e)//CARGA DE FORM1
{
label9.Text = x.ToString();
}
///////////////////////////////////////////////////////
public void Button1_Click_1(object sender, EventArgs e)//PRESIONADO DE BOTON1
{
vector[x].nombre = textBox1.Text.TrimEnd();
vector[x].registro = textBox2.Text.TrimEnd();
vector[x].velocidadR = int.Parse(textBox3.Text);
vector[x].velocidadL = int.Parse(textBox4.Text); //PRESIONADO DE BOTON1
vector[x].dia = int.Parse(textBox5.Text); //CARGA
vector[x].mes = int.Parse(textBox6.Text);
vector[x].año = int.Parse(textBox7.Text);
vector[x].sector = int.Parse(comboBox1.Text);
x++;
label9.Text = x.ToString();
}
///////////////////////////////////////////////////////
//private void Timer1_Tick(object sender, EventArgs e)//TICK CADA 1 SEGUNDO DE TIMER1
//{
//x++;
//label9.Text = x.ToString();
//if (flag == true)//PRESIONNDO DE EL BOTON DEL FORM2
//{
//for (x=2;x<x;x++)
//{
//}
//}
//}
///////////////////////////////////////////////////////
public void activarC()//METODO ACTIVAR BOOLEAN
{
x++;
MessageBox.Show("" + x.ToString());
Form2 f2 = new Form2();
v1 = vector[x].nombre;
v2 = vector[x].registro;
v3 = vector[x].velocidadR;
v4 = vector[x].velocidadL;
v5 = vector[x].dia;
v6 = vector[x].mes;
v7 = vector[x].año;
v8 = vector[x].sector;
f2.recibirDatos(v1, v2, v3, v4, v5, v6, v7, v8);
f2.Show(); //APERTURA DE FORM2
}
public void Button2_Click(object sender, EventArgs e)//PRESIONADO DE BOTON2
{
x = 1;
v1 = vector[x].nombre;
v2 = vector[x].registro;
v3 = vector[x].velocidadR;
v4 = vector[x].velocidadL;
v5 = vector[x].dia;
v6 = vector[x].mes;
v7 = vector[x].año;
v8 = vector[x].sector;
Form2 f2 = new Form2();
f2.recibirDatos(v1, v2, v3, v4, v5, v6, v7, v8);
MessageBox.Show("" + x.ToString());
f2.Show();
}
}
}