Code Source Gestion Des Etudiants (Inscription)
Code Source Gestion Des Etudiants (Inscription)
Code Source Gestion Des Etudiants (Inscription)
(INSCRIPTION)********************
Imports System.IO
Imports MySql.Data.MySqlClient
End Sub
Private Sub Inscription_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
'Dat_modif.Visible = True
Try
DataGridView1.RowTemplate.Height = 100
Panel_modif.Visible = False
panel_inscrip.Visible = False
panel_supp.Visible = False
DataGridView1.DataSource = dt.getallstudent
DataGridView_supp.DataSource = dt.getallstudent
panel_inscrip.Visible = False
pannel_btns.Visible = False
Guna2ComboBox1.DataSource = dt.getallfiliere()
Guna2ComboBox1.DisplayMember = "LIB_FILIERE"
Guna2ComboBox1.ValueMember = "LIB_FILIERE"
fil_etu_cb.DataSource = dt.getallfiliere()
fil_etu_cb.DisplayMember = "LIB_FILIERE"
fil_etu_cb.ValueMember = "LIB_FILIERE"
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Guna2GradientButton1_Click(sender As Object, e As EventArgs)
Handles Guna2GradientButton1.Click
Me.Close()
Principale.Show()
End Sub
If choix.ShowDialog = 1 Then
PictureBox1.Image = Image.FromFile(choix.FileName)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Try
Try
Dim aujordat As Integer = Date.Now.Year
Dim datnai As Integer = Guna2DateTimePicker1.Value.Year
If aujordat - datnai < 16 Then
MessageBox.Show("Vous etes en dessous de l'age minimum autorisé
")
Else
PictureBox1.Image.Save(Photo, PictureBox1.Image.RawFormat)
If dt.addstudent(nom, prenoms, sexe, email, Telephones,
datenaiss, adresse, Filiere, semestre, Photo) Then
MessageBox.Show("Enregistrement effectué avec succès")
panel_inscrip.Hide()
DataGridView1.DataSource = dt.getallstudent
End If
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub btn_decaler_Click(sender As Object, e As EventArgs) Handles
btn_decaler.Click
panel_inscrip.Visible = False
panel_supp.Visible = False
Panel_modif.Visible = False
If pannel_btns.Visible = True Then
pannel_btns.Visible = False
DataGridView1.Visible = True
Else
pannel_btns.Visible = True
DataGridView1.Visible = False
End If
End Sub
End Sub
End Sub
Try
Else
Try
If nom_etu_tb.Text.Trim().Equals("") Then
MessageBox.Show("Entrez l'ID ou le NOM ou le prenom de
l'etudiant à modifier", "ID non selectionné ", MessageBoxButtons.OK,
MessageBoxIcon.Error)
Else
If prenom_etu_tb.Text.Trim().Equals("") Or
email_etu_tb.Text.Trim().Equals("") Or num_etu_tb.Text.Trim().Equals("") Or
datenaiss_etu_pk.Text.Trim().Equals("") Or fil_etu_cb.Text.Trim().Equals("") Or
semestre_etu_tb.Text.Trim().Equals("") Or adresse_etu_tb.Text.Trim().Equals("") Or
pic_etu_pb.Image Is BackgroundImage Then
MessageBox.Show(" information manquante", "Information
manquante", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
rech_etu_tb.Text = ""
ID_TB.Text = ""
nom_etu_tb.Text = ""
prenom_etu_tb.Text = ""
email_etu_tb.Text = ""
num_etu_tb.Text = ""
datenaiss_etu_pk.Text = ""
fil_etu_cb.Text = ""
semestre_etu_tb.Text = ""
adresse_etu_tb.Text = ""
pic_etu_pb.Image = BackgroundImage
Else
MessageBox.Show("Echec de modification ", "Modifier
etu ", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
'Else
' MessageBox.Show("La filière saisi n'exite pas ou
est mal saisi ", "saisi filiere", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
'End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
DataGridView1.DataSource = dt.getAllmat(command)
panel_inscrip.Visible = False
DataGridView1.Visible = True
End If
' Dat_modif.Visible = True
panel_supp.Visible = False
Panel_modif.Visible = True
MessageBox.Show(ex.Message)
End Try
End Sub
Try
Else
Dim command As New MySqlCommand("SELECT * FROM inscription WHERE
CONCAT(ID_ETUDIANT,NOM,PRENOMS) LIKE '%" & supp_rech.Text & "%'")
DataGridView_supp.DataSource = dt.getAllmat(command)
panel_inscrip.Visible = False
DataGridView1.Visible = False
supp_items.Visible = False
Panel_modif.Visible = False
DataGridView_supp.Visible = True
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Try
ID_TB.Text = DataGridView1.CurrentRow.Cells(0).Value.ToString
nom_etu_tb.Text = DataGridView1.CurrentRow.Cells(1).Value.ToString
prenom_etu_tb.Text = DataGridView1.CurrentRow.Cells(2).Value.ToString
Guna2CustomRadioButton4.Checked = True
Else
Guna2CustomRadioButton3.Checked = True
End If
email_etu_tb.Text = DataGridView1.CurrentRow.Cells(4).Value.ToString
num_etu_tb.Text = DataGridView1.CurrentRow.Cells(5).Value.ToString
datenaiss_etu_pk.Value =
DataGridView1.CurrentRow.Cells(6).Value.ToString
adresse_etu_tb.Text = DataGridView1.CurrentRow.Cells(7).Value.ToString
fil_etu_cb.Text = DataGridView1.CurrentRow.Cells(8).Value.ToString
semestre_etu_tb.Text = DataGridView1.CurrentRow.Cells(9).Value.ToString
Getim = DataGridView1.CurrentRow.Cells(10).Value
Dim picget As New MemoryStream(Getim)
pic_etu_pb.Image = Image.FromStream(picget)
DataGridView1.Visible = False
Panel_modif.Visible = True
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Try
If choix.ShowDialog = 1 Then
pic_etu_pb.Image = Image.FromFile(choix.FileName)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Try
Getim = DataGridView_supp.CurrentRow.Cells(10).Value
Dim picget As New MemoryStream(Getim)
pic_etu_pb.Image = Image.FromStream(picget)
DataGridView_supp.Visible = False
Panel_modif.Visible = False
supp_items.Visible = True
panel_inscrip.Visible = False
supp_nm.Text = DataGridView_supp.CurrentRow.Cells(1).Value.ToString
supp_pr.Text = DataGridView_supp.CurrentRow.Cells(2).Value.ToString
supp_sex.Text = DataGridView_supp.CurrentRow.Cells(3).Value.ToString
supp_sem.Text = DataGridView_supp.CurrentRow.Cells(9).Value.ToString
supp_fil.Text = DataGridView_supp.CurrentRow.Cells(8).Value.ToString
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Try
supp_nm.Text = ""
supp_pr.Text = ""
supp_sem.Text = ""
supp_sex.Text = ""
supp_fil.Text = ""
DataGridView1.Visible = False
panel_inscrip.Visible = False
Panel_modif.Visible = False
panel_supp.Visible = True
DataGridView_supp.Visible = False
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Sub
' Try
' MessageBox.Show(ex.Message)