-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
77 lines (64 loc) · 2.29 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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 Bases_Rutas
{
public partial class Form1 : Form
{
Bases bases;
Rutas rutas = new Rutas();
public Form1()
{
InitializeComponent();
}
private void btnAgregar_Click(object sender, EventArgs e)
{
rutas.Agregar(bases = new Bases(txtNombreAgregInicio.Text, Convert.ToInt32(txtAgregTiempIni.Text)));
txtNombreAgregInicio.Clear(); txtAgregTiempIni.Clear();
}
private void btnAgregInicio_Click(object sender, EventArgs e)
{
rutas.AgregarInicio(bases = new Bases(txtNombreAgregInicio.Text, Convert.ToInt32(txtAgregTiempIni.Text)));
txtNombreAgregInicio.Clear(); txtAgregTiempIni.Clear();
}
private void btnBuscar_Click(object sender, EventArgs e)
{
Bases busqueda = rutas.Buscar(txtBuscar.Text);
if (busqueda != null)
{
txtReportOpe.Text = "Nombre: " + Convert.ToString(busqueda.nombre) + Environment.NewLine;
txtReportOpe.Text += "Tiempo: " + Convert.ToString(busqueda.minutos) + Environment.NewLine;
}
}
private void btnEliminar_Click(object sender, EventArgs e)
{
rutas.Eliminar(txtEliminar.Text);
}
private void btnEliminarIn_Click(object sender, EventArgs e)
{
rutas.EliminarInicio();
}
private void btnEliminarF_Click(object sender, EventArgs e)
{
rutas.EliminarFinal();
}
private void btnReporte_Click(object sender, EventArgs e)
{
txtReportOpe.Text = rutas.Reporte();
}
private void btnInsertar_Click(object sender, EventArgs e)
{
rutas.Insertar(txtInsertar.Text, bases = new Bases(txtInsertar.Text, Convert.ToInt32(txtAgregTiempIni.Text)));
}
private void btnRecorrido_Click(object sender, EventArgs e)
{
txtReportOpe.Text = rutas.Recorrido(txtRecoNombre.Text, Convert.ToInt32(txtTI.Text), Convert.ToInt32(txtTF.Text));
}
}
}