Esempio n. 1
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            frmOperacion ca = new frmOperacion(roll, colums, "Agregar");

            ca.ShowDialog();
            dgv.Hide();
            SetupDataGridView();
            PopulateDataGridView("");
            actualiza();
        }
Esempio n. 2
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     if (sel >= 0)
     {
         frmOperacion cm = new frmOperacion(roll, colums, val, "Modificar");
         cm.ShowDialog();
         dgv.Hide();
         SetupDataGridView();
         PopulateDataGridView("");
         actualiza();
     }
 }
Esempio n. 3
0
 private void btnVender_Click(object sender, EventArgs e)
 {
     if (sel >= 0)
     {
         frmOperacion cm = new frmOperacion("Acciones", 1, val, "Vender");
         cm.ShowDialog();
         dgv.Hide();
         SetupDataGridView();
         PopulateDataGridView("");
         actualiza();
     }
     else
     {
         MessageBox.Show("Selecciona o realiza una Compra");
     }
 }
Esempio n. 4
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            frmOperacion b = new frmOperacion(roll, colums, "Buscar");

            b.ShowDialog();
            String[] c = new String[4];
            for (int i = 0; i < 4; i++)
            {
                c[i] = "";
            }
            if (roll == "Reporte" || roll == "ventasReporte")
            {
                int i;
                for (i = 0; i < 3; i++)
                {
                    if (Sval[i] != "")
                    {
                        c[i] = " and " + cam[i] + " = '" + Sval[i] + "'";
                    }
                }
                if (Sval[i] != "")
                {
                    c[i] = " and " + cam[i + 1] + " = '" + Sval[i] + "'";
                }
            }
            else
            {
                if (Sval[0] != "")
                {
                    c[0] = " where";
                    c[1] = " " + cam[0] + " = '" + Sval[0] + "'";
                }
                if (Sval[1] != "")
                {
                    if (c[1] != "")
                    {
                        c[2] = " and ";
                    }
                    else
                    {
                        c[0] = " where";
                    }
                    c[2] += " " + cam[1] + " = '" + Sval[1] + "'";
                }
                if (Sval[2] != "")
                {
                    if (c[1] != "" || c[2] != "")
                    {
                        c[3] = " and ";
                    }
                    else
                    {
                        c[0] = " where";
                    }
                    c[3] += " " + cam[2] + " = '" + Sval[2] + "'";
                }
            }
            dgv.Hide();
            SetupDataGridView();
            PopulateDataGridView(c[0] + c[1] + c[2] + c[3]);
            actualiza();
        }