using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GestionPersonnel
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void Form3_Load(object sender, EventArgs e)
{
private void button4_Click(object sender, EventArgs e)
{
dataGridView1.Rows.Add(textBox1.Text, textBox2.Text,
textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, textBox7.Text,
textBox8.Text,textBox9.Text);
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
textBox6.Clear();
textBox7.Clear();
textBox8.Clear();
textBox9.Clear();
MessageBox.Show("ENREGISTREMENT EFFECTUER AVEC SUCCE");
}
private void button2_Click(object sender, EventArgs e)
{
}
int a;
private void dataGridView1_CellClick(object sender,
DataGridViewCellEventArgs e)
{
a = e.RowIndex;
DataGridViewRow row = dataGridView1.Rows[a];
textBox1.Text = row.Cells[0].Value.ToString();
textBox2.Text = row.Cells[1].Value.ToString();
textBox3.Text = row.Cells[2].Value.ToString();
textBox4.Text = row.Cells[3].Value.ToString();
textBox5.Text = row.Cells[4].Value.ToString();
textBox6.Text = row.Cells[5].Value.ToString();
textBox7.Text = row.Cells[6].Value.ToString();
textBox8.Text = row.Cells[7].Value.ToString();
private void Modifier_Click(object sender, EventArgs e)
{
DataGridViewRow newdata = dataGridView1.Rows[a];
newdata.Cells[0].Value = textBox1.Text;
newdata.Cells[1].Value = textBox2.Text;
newdata.Cells[2].Value = textBox3.Text;
newdata.Cells[3].Value = textBox4.Text;
newdata.Cells[4].Value = textBox5.Text;
newdata.Cells[5].Value = textBox6.Text;
newdata.Cells[6].Value = textBox7.Text;
newdata.Cells[7].Value = textBox8.Text;
MessageBox.Show("Votre Modification à été realiser avec succés");
}
}
}