Professional Documents
Culture Documents
Login
Login
namespace Mini_projet_test
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
Connexion.Connect();
}
conn.Open();
int result = (int)command.ExecuteScalar();
if (result == 1)
{
Acceuil form = new Acceuil();
form.Show();
}
else
{
MessageBox.Show("Nom d'utilisateur ou mot de passe incorrect. Réessayez.");
}
}
}
}
using System;
Form
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Projet;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
namespace Mini_projet_test
{
public partial class GestionDesEtudiant : Form
{
public GestionDesEtudiant()
{
InitializeComponent();
}
private void dataGridView1_CellContentClick(object sender,
DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];
el.save();
if (string.IsNullOrEmpty(dbConnection))
{
MessageBox.Show("The DB_CONNECTION environment variable is not set.");
}
else
{
MessageBox.Show("The value of the DB_CONNECTION environment variable is:
" + dbConnection);
MessageBox.Show("Ajout réussit");
dataGridView1.DataSource = Eleve.all<Eleve>();
}
Eleve el = Eleve.findByCode<Eleve>(txtCode.Text);
if (checkBoxNom.Checked == true) el.Nom = txtName.Text;
if (checkBoxPrenom.Checked == true) el.Prenom = txtPrenom.Text;
if (checkBoxNiv.Checked == true) el.Niveau = txtNiveau.Text;
if (checkBoxFil.Checked == true) el.Code_fil = txtFiliere.Text;
el.save();
dataGridView1.DataSource = Eleve.all<Eleve>();
}
if (res == DialogResult.OK)
{
el.delete();
}
dataGridView1.DataSource = Eleve.all<Eleve>();
}
}