コード例 #1
0
ファイル: Form1.cs プロジェクト: ErizO1/Estructura-De-Datos
        private void bt_Reporte_Click(object sender, EventArgs e)
        {
            ReporteTxt r = new ReporteTxt(inv.ToString());

            r.ShowDialog();

            string[] row = new string[4];
            dgv_Reporte.Rows.Clear();

            for (int i = 0; i < inv._inventario.Length; i++)
            {
                if (inv._inventario[i] != null)
                {
                    row[0] = inv._inventario[i].Articulo.ID.ToString();
                    row[1] = inv._inventario[i].Articulo.Nombre;
                    row[2] = inv._inventario[i].Cantidad.ToString();
                    row[3] = inv._inventario[i].Articulo.Precio.ToString("c2");
                }
                else
                {
                    row[0] = "";
                    row[1] = "";
                    row[2] = "";
                    row[3] = "";
                }
                dgv_Reporte.Rows.Add(row);
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: ErizO1/Estructura-De-Datos
        private void bt_Reporte_Click(object sender, EventArgs e)
        {
            ReporteTxt r = new ReporteTxt(inv.ToString());

            r.ShowDialog();

            string[] row = new string[4];
            dgv_Reporte.Rows.Clear();

            EntradaInv temp = inv.Primero;

            while (temp != null)
            {
                row[0] = temp.Articulo.ID.ToString();
                row[1] = temp.Articulo.Nombre;
                row[2] = temp.Cantidad.ToString();
                row[3] = temp.Articulo.Precio.ToString("c2");
                dgv_Reporte.Rows.Add(row);
                temp = temp.Siguiente;
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: ErizO1/Estructura-De-Datos
        private void bt_Reporte_Inverso_Click(object sender, EventArgs e)
        {
            ReporteTxt r = new ReporteTxt(inv.ReporteInverso());

            r.ShowDialog();

            EntradaInv temp = inv.Ultimo;

            dgv_Reporte.Rows.Clear();
            while (temp != null)
            {
                dgv_Reporte.Rows.Add(new string[]
                {
                    temp.Articulo.ID.ToString(),
                    temp.Articulo.Nombre,
                    temp.Cantidad.ToString(),
                    temp.Articulo.Precio.ToString("c2")
                });
                temp = temp.Anterior;
            }
        }