Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Clientes_agr clie = new Clientes_agr();

            clie.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            Clientes_agr clie = new Clientes_agr();

            if (dataGridView1.SelectedRows.Count > 0)
            {
                ////registro externo
                //clie.textBox1.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
                //clie.textBox9.Text = dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
                //clie.textBox2.Text = dataGridView1.SelectedRows[0].Cells[3].Value.ToString();
                //clie.textBox3.Text = dataGridView1.SelectedRows[0].Cells[4].Value.ToString();
                //clie.textBox10.Text = dataGridView1.SelectedRows[0].Cells[5].Value.ToString();
                //clie.textBox11.Text = dataGridView1.SelectedRows[0].Cells[7].Value.ToString();
                //clie.textBox4.Text = dataGridView1.SelectedRows[0].Cells[6].Value.ToString();
                //clie.textBox5.Text = dataGridView1.SelectedRows[0].Cells[8].Value.ToString();
                //clie.textBox6.Text = dataGridView1.SelectedRows[0].Cells[9].Value.ToString();
                //registro interno
                textBox1.Text  = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
                textBox9.Text  = dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
                textBox2.Text  = dataGridView1.SelectedRows[0].Cells[3].Value.ToString();
                textBox3.Text  = dataGridView1.SelectedRows[0].Cells[4].Value.ToString();
                textBox10.Text = dataGridView1.SelectedRows[0].Cells[5].Value.ToString();
                textBox11.Text = dataGridView1.SelectedRows[0].Cells[7].Value.ToString();
                textBox4.Text  = dataGridView1.SelectedRows[0].Cells[6].Value.ToString();
                textBox5.Text  = dataGridView1.SelectedRows[0].Cells[8].Value.ToString();
                textBox6.Text  = dataGridView1.SelectedRows[0].Cells[9].Value.ToString();
            }
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            textBox7.Enabled = true;;
            sqlconn.Open();
            Clientes_agr clie = new Clientes_agr();

            sqlcomm = new SqlCommand();
            string    sql;
            DataTable dt = new DataTable();

            sql = selec +
                  " where" + " ID_CLIENTE = " + textBox8.Text;
            sqlcomm.Connection  = sqlconn;
            sqlcomm.CommandText = sql;
            sqlcomm.CommandType = CommandType.Text;
            sqlcomm.ExecuteNonQuery();
            sqlda = new SqlDataAdapter(sql, sqlconn);
            sqlda.Fill(dt);
            sqlconn.Close();
            textBox7.Text    = textBox8.Text;
            textBox7.Enabled = false;
            textBox1.Text    = dt.Rows[0][1].ToString();
            textBox9.Text    = dt.Rows[0][2].ToString();
            textBox2.Text    = dt.Rows[0][3].ToString();
            textBox3.Text    = dt.Rows[0][4].ToString();
            textBox10.Text   = dt.Rows[0][5].ToString();
            textBox4.Text    = dt.Rows[0][6].ToString();
            textBox11.Text   = dt.Rows[0][7].ToString();
            textBox5.Text    = dt.Rows[0][8].ToString();
            textBox6.Text    = dt.Rows[0][9].ToString();

            dataGridView1.DataSource = dt;
        }
Ejemplo n.º 4
0
        private void button3_Click(object sender, EventArgs e)
        {
            sqlconn.Open();
            sqlcomm = new SqlCommand();
            string       sql;
            DataTable    dt   = new DataTable();
            Clientes_agr clie = new Clientes_agr();

            sql = "update" +
                  " CLIENTE " +
                  "set " +
                  "CL_NOMBRE  = '" + clie.textBox1.Text + "', " +
                  "CL_CEDULA = '" + clie.textBox9.Text + "', " +
                  "CL_APELLIDO = '" + clie.textBox2.Text + "'," +
                  "CL_APELLIDO_MATERNO = '" + clie.textBox3.Text + "'," +
                  "CL_EMAIL = '" + clie.textBox10.Text + "'," +
                  "CL_TELEFONO = '" + clie.textBox4.Text + "'," +
                  "CL_EDAD = '" + clie.textBox11.Text + "'," +
                  "CL_USUARIO = '" + clie.textBox5.Text + "'," +
                  "CL_PASSWORD = '******'" +

                  " where" + " ID_CLIENTE  =  " + textBox8.Text;

            sqlcomm.Connection  = sqlconn;
            sqlcomm.CommandText = sql;
            sqlcomm.CommandType = CommandType.Text;
            sqlcomm.ExecuteNonQuery();
            sqlconn.Close();
            sql = selec;
            sqlconn.Open();
            sqlda = new SqlDataAdapter(sql, sqlconn);
            sqlda.Fill(dt);
            sqlconn.Close();
            dataGridView1.DataSource = dt;
            textBox8.Text            = "";
        }
Ejemplo n.º 5
0
        private void registroToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Clientes_agr agr = new Clientes_agr();

            agr.Show();
        }