예제 #1
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            frmOperacion ca = new frmOperacion(roll, colums, "Agregar");

            ca.ShowDialog();
            dgv.Hide();
            SetupDataGridView();
            PopulateDataGridView("");
            actualiza();
        }
예제 #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();
     }
 }
예제 #3
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            frmOperacion b = new frmOperacion(roll, colums, "Buscar");

            b.ShowDialog();
            String[] c = new String[6];
            for (int i = 0; i < 6; i++)
            {
                c[i] = "";
            }
            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] + "'";
            }
            if (Sval[3] != "")
            {
                if (c[1] != "" || c[2] != "" || c[3] != "")
                {
                    c[4] = " and ";
                }
                else
                {
                    c[0] = " where";
                }
                c[4] += " " + cam[3] + " = '" + Sval[3] + "'";
            }
            if (Sval[4] != "")
            {
                if (c[1] != "" || c[2] != "" || c[3] != "" || c[4] != "")
                {
                    c[5] = " and ";
                }
                else
                {
                    c[0] = " where";
                }
                c[5] += " " + cam[4] + " = '" + Sval[4] + "'";
            }
            dgv.Hide();
            SetupDataGridView();
            PopulateDataGridView(c[0] + c[1] + c[2] + c[3] + c[4]);
            actualiza();
        }