Exemplo n.º 1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            string query = "SELECT catID FROM Categoria WHERE catNombre LIKE '" + cbCategoria.Text + "'";

            //MessageBox.Show(query);

            conModificar.Open();
            OleDbCommand comando  = new OleDbCommand(query, conModificar);
            string       temporal = Convert.ToString(comando.ExecuteScalar());

            //MessageBox.Show(temporal);

            conModificar.Close();


            string tabla = "Grupo";
            string key   = "grupoID";
            int    id    = Convert.ToInt32(lblID.Text);

            //MessageBox.Show(lblID.Text);
            //MessageBox.Show(id.ToString());

            Metodos guardado = new Metodos();

            guardado.Inicializar();

            string valores = "catID = '" + temporal + "', grupoSocioPpal = '" + txtSocio.Text + "', grupoApellido = '" + txtApellido.Text + "', grupoNombre= '" + txtNombre.Text + "', grupoSocio1 = '" + txtPersona2.Text + "', grupoSocio2 = '" + txtPersona3.Text + "'";

            //MessageBox.Show(valores);

            guardado.Update(tabla, id, valores, key);
        }
Exemplo n.º 2
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            int genero;

            if (rbHombre.Checked)
            {
                genero = 1;
            }
            else
            {
                genero = 0;
            }

            int activo;

            if (cbEstado.Checked)
            {
                activo = 1;
            }
            else
            {
                activo = 0;
            }

            string seters = "socioNombre = '" + txtNombre.Text + "', socioDNI = " + txtDNI.Text + ", socioDireccion = '" + txtDireccion.Text + "', socioMail = '" + txtMail.Text + "', socioNotas = '" + txtNotas.Text + "', socioCategoria = '" + cbCategoria.Text + "', socioTelefono = " + txtTelefono.Text + ", socioCelular = " + txtCelular.Text + ", socioGenero = " + genero + ", socioEstado = " + activo + ", socioNivel = '" + cbNivel.Text + "', socioFechaUltPago = " + dtpPago.Value.ToOADate() + ", socioFechaNac = " + dtpNacimiento.Value.ToOADate() + "";
            string tabla  = "Socio";
            string key    = "socioID";
            int    id     = Convert.ToInt32(lblID.Text);

            Metodos grabar = new Metodos();

            grabar.Inicializar();
            grabar.Update(tabla, id, seters, key);
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int flag;

            if (cbAlergia.Checked)
            {
                flag = 1;
            }
            else
            {
                flag = 0;
            }

            conModificar.Open();

            OleDbCommand cmdchequeo = new OleDbCommand();

            cmdchequeo.CommandText = "SELECT * FROM Salud";
            cmdchequeo.Connection  = conModificar;

            OleDbDataReader lector = cmdchequeo.ExecuteReader();

            while (lector.Read())
            {
                if (lector[1].ToString() == idsocio.ToString())
                {
                    control = true;
                    break;
                }
            }

            if (control == true)
            {
                string seters = "saludAlergia = '" + flag + "', saludAlergiaDesc = '" + txtDescripcion.Text + "', saludSangre = '" + txtSangre.Text + "', saludMed = '" + txtMedicamentos.Text + "', saludObraSoc = '" + txtObrasocial.Text + "', saludTelEm = " + txtEmergencia.Text + ", saludExtra = '" + txtExtra.Text + "'";
                string tabla  = "Salud";
                string key    = "socioID";

                Metodos guardar = new Metodos();
                guardar.Inicializar();
                guardar.Update(tabla, idsocio, seters, key);
            }
            else
            {
                string tabla   = "Salud";
                string seters  = "saludAlergia, saludAlergiaDesc, saludSangre, saludMed, saludObraSoc, saludTelEm, saludExtra, socioID";
                string valores = "'" + flag + "','" + txtDescripcion.Text + "','" + txtSangre.Text + "','" + txtMedicamentos.Text + "','" + txtObrasocial.Text + "','" + txtEmergencia.Text + "','" + txtExtra.Text + "'," + idsocio.ToString() + "";

                Metodos crear = new Metodos();
                crear.Inicializar();
                crear.Insertar(tabla, seters, valores);
            }

            conModificar.Close();
        }
Exemplo n.º 4
0
        private void v_Click(object sender, EventArgs e)
        {
            string tabla  = "Categoria";
            string values = "catNombre ='" + txtNombre.Text + "', catDesc = '" + txtDescripcion.Text + "', catCant = " + cbCant.Text + "";
            int    id     = Convert.ToInt32(lblID.Text);
            string key    = "catID";

            Metodos guardar = new Metodos();

            guardar.Inicializar();
            guardar.Update(tabla, id, values, key);
        }
Exemplo n.º 5
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            string valores = "profNombre = '" + txtNombre.Text + "', profTelefono = '" + txtTelefono.Text + "', profDomicilio = '" + txtDomicilio.Text + "', profMail = '" + txtMail.Text + "'";
            string tabla   = "Profesional";
            string key     = "profId";
            int    id      = Convert.ToInt32(lblID.Text);

            Metodos guardarprof = new Metodos();

            guardarprof.Inicializar();
            guardarprof.Update(tabla, id, valores, key);
        }
Exemplo n.º 6
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            Metodos guardar = new Metodos();

            guardar.Inicializar();

            string valores = "nivelNumero = '" + txtNumero.Text + "', nivelNombre ='" + txtNombre.Text + "'";
            string tabla   = "Niveles";
            string key     = "actID";
            int    id      = Convert.ToInt32(lblID.Text);

            guardar.Update(tabla, id, valores, key);
        }
Exemplo n.º 7
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            Metodos modMetodo = new Metodos();

            modMetodo.Inicializar();

            string valores = "actNombre = '" + txtNombre.Text + "', actDesc = '" + txtDesc.Text + "'";
            string tabla   = "Actividades";
            string key     = "actId";
            int    id      = Convert.ToInt32(lblID.Text);

            //MessageBox.Show(valores);

            modMetodo.Update(tabla, id, valores, key);
        }
Exemplo n.º 8
0
        private void guardar()
        {
            int flag;

            if (rbHombre.Checked)
            {
                flag = 1;
            }
            else
            {
                flag = 0;
            }

            int estado;

            if (cbEstado.Checked)
            {
                estado = 1;
            }
            else
            {
                estado = 0;
            }

            //MessageBox.Show(dtpNacimiento.Value.ToString());
            //MessageBox.Show(dtpNacimiento.Value.ToShortDateString());
            double intermedio = dtpNacimiento.Value.ToOADate();
            string segundo    = intermedio.ToString();

            MessageBox.Show(segundo);


            string seters = "socioNombre = '" + txtNombre.Text + "', socioFechaUltPago = " + dtpPago.Value.ToOADate() + ", socioFechaNac = " + dtpNacimiento.Value.ToOADate() + ", socioDNI = " + txtDNI.Text + ", socioDireccion = '" + txtDireccion.Text + "', socioMail = '" + txtMail.Text + "', socioNotas = '" + txtNotas.Text + "', socioCategoria = '" + cbCategoria.Text + "', socioTelefono = " + txtTelefono.Text + ", socioCelular = " + txtCelular.Text + ", socioGenero = " + flag + ", socioEstado = " + estado + ", socioNivel = '" + cbNivel.Text + "'";
            string tabla  = "Socio";
            string key    = "socioID";
            int    id     = Convert.ToInt32(lblID.Text);

            Metodos modMetodo = new Metodos();

            modMetodo.Inicializar();

            modMetodo.Update(tabla, id, seters, key);

            GuardarFoto();
        }