コード例 #1
0
 private string listar(Base b)
 {
     if (b.sig == inicio)
     {
         return(b.ToString() + Environment.NewLine);
     }
     else
     {
         return(b.ToString() + Environment.NewLine + listar(b.sig));
     }
 }
コード例 #2
0
        private void bt_AgregarInicio_Click(object sender, EventArgs e)
        {
            Base temp = new Base(tb_Nombre.Text, Convert.ToInt32(tb_Minutos.Text));

            r.AgregarInicio(temp);
            tb_Nombre.Text  = "";
            tb_Minutos.Text = "";
            tb_Reporte.Text = temp.ToString();
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: Juanramoncortes/Rutas
        private void btnEliminarprimero_Click(object sender, EventArgs e)
        {
            Base elimindado = Estructura.EliminarPrimero();

            if (elimindado != null)
            {
                txtList.Text = elimindado.ToString() + "\t//Primero Elimidado";
            }
            Num();
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: Juanramoncortes/Rutas
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            nom = txtNombreBase.Text;
            Base elimindado = Estructura.Eliminar(nom);

            if (elimindado != null)
            {
                txtList.Text = elimindado.ToString() + "\t//Elimidado";
            }
            Num();
        }
コード例 #5
0
ファイル: Ruta.cs プロジェクト: JVazquez38/Rutas
        public string reporte()
        {
            string resultado   = "";
            Base   varTemporal = inicio;

            if (varTemporal != null)
            {
                while (varTemporal.siguiente != inicio)
                {
                    resultado  += varTemporal.ToString();
                    varTemporal = varTemporal.siguiente;
                }
                resultado += varTemporal.ToString();
                return(resultado);
            }
            else
            {
                return("");
            }
        }
コード例 #6
0
        private void bt_InsertarDespuesDe_Click(object sender, EventArgs e)
        {
            Base temp = new Base(tb_Nombre.Text, Convert.ToInt32(tb_Minutos.Text));

            if (r.InsertarDespuesDe(tb_Buscar.Text, temp))
            {
                tb_Reporte.Text = temp.ToString() + Environment.NewLine + "Elemento insertado después de " + tb_Buscar.Text;
            }
            else
            {
                tb_Reporte.Text = "El elemento " + tb_Reporte.Text + " no existe";
            }
        }
コード例 #7
0
        private void bt_Buscar_Click(object sender, EventArgs e)
        {
            Base temp = r.Buscar(tb_Buscar.Text);

            if (temp != null)
            {
                tb_Reporte.Text = temp.ToString();
            }
            else
            {
                tb_Reporte.Text = "Elemento no encontrado";
            }
        }
コード例 #8
0
 public string listar()
 {
     if (inicio == null)
     {
         return(null);
     }
     else if (inicio.sig == inicio)
     {
         return(inicio.ToString());
     }
     else
     {
         return(listar(inicio));
     }
 }
コード例 #9
0
ファイル: Estructura.cs プロジェクト: Juanramoncortes/Rutas
        public string Lista()
        {
            string res  = "";
            Base   temp = inicio;

            if (inicio != null)
            {
                do
                {
                    res += temp.ToString() + "\r\n";
                    temp = temp.siguiente;
                } while (temp != inicio && temp != null);
            }
            return(res);
        }
コード例 #10
0
ファイル: Form1.cs プロジェクト: Juanramoncortes/Rutas
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            nom = txtNombreBase.Text;
            Base encontrado = Estructura.Buscar(nom);

            if (encontrado != null)
            {
                txtList.Text = encontrado.ToString();
            }
            else
            {
                txtList.Text = "/No encontrado/";
            }
            Num();
        }
コード例 #11
0
 public override string ToString()
 {
     if (inicio == null)
     {
         return("");
     }
     else
     {
         String cadena = "Nombre\tMinutos\r\n";
         Base   temp   = inicio;
         do
         {
             cadena += temp.ToString();
             temp    = temp.siguiente;
         }while (temp != inicio);
         return(cadena);
     }
 }
コード例 #12
0
        public string Listar()
        {
            Base   aux    = inicio;
            string cadena = "";

            while (aux != null && aux.Siguiente != inicio)  // Mientras no sea null = vacia, mientras haya mas que una base
            {
                cadena += aux.ToString();
                aux     = aux.Siguiente;
            }
            if (aux == inicio)                              // Si solo hay una base agrega solo inicio a la cadena
            {
                cadena += aux;
            }
            else                                            // Como llega una base antes, le agregamos el ultimo a la cadena
            {
                cadena += ultima.ToString();
            }
            return(cadena);
        }
コード例 #13
0
ファイル: Ruta.cs プロジェクト: ErizO1/Estructura-De-Datos
        public string Reporte()
        {
            string rep  = "Comienza Reporte:" + Environment.NewLine + "-----------------------" + Environment.NewLine;
            Base   temp = Inicio;

            if (temp == null)
            {
                rep += "No hay datos";
            }
            else
            {
                do
                {
                    rep += temp.ToString();
                    rep += Environment.NewLine + Environment.NewLine;
                    temp = temp.Siguiente;
                }while (temp != Inicio);
            }
            return(rep);
        }