Commit f30b4986 authored by BARBI HUGO's avatar BARBI HUGO
Browse files

Merge branch 'master' into 'master'

update fmRecap + debug

See merge request !160
parents 5e52f12c 6a7b8d48
......@@ -88,7 +88,7 @@ namespace _20School
//
// lblWelcome
//
this.lblWelcome.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.lblWelcome.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblWelcome.BackColor = System.Drawing.Color.Transparent;
this.lblWelcome.Font = new System.Drawing.Font("Segoe UI", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
......@@ -124,9 +124,6 @@ namespace _20School
this.pnlMain.Name = "pnlMain";
this.pnlMain.Size = new System.Drawing.Size(1373, 33);
this.pnlMain.TabIndex = 14;
this.pnlMain.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlMain_MouseDown);
this.pnlMain.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlMain_MouseMove);
this.pnlMain.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlMain_MouseUp);
//
// btnRed
//
......
......@@ -68,7 +68,7 @@ namespace _20School
{
IsMerged = true,
Title = "Temps",
Labels = new[] { "150", "140", "130", "120", "110", "100", "90", "80", "70", "60", "50", "40", "30", "20", "10", "0" },
Labels = new[] { "120", "110", "100", "90", "80", "70", "60", "50", "40", "30", "20", "10", "0" },
});
// Axe Y du graphique
......@@ -221,8 +221,6 @@ namespace _20School
{
connexion.Close(); //Fermeture de la connexion
}
return moyenne;
}
......@@ -265,39 +263,7 @@ namespace _20School
fmRecap.Show();
}
/// <summary>
/// Evènement permettant de déplacer la fenêtre de jeux dans l'environnement utilisateur.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pnlMain_MouseDown(object sender, MouseEventArgs e)
{
mov = 1;
movX = e.X;
movY = e.Y;
}
/// <summary>
/// Evènement permettant de déplacer la fenêtre de jeux dans l'environnement utilisateur.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pnlMain_MouseMove(object sender, MouseEventArgs e)
{
if (mov == 1)
{
this.SetDesktopLocation(MousePosition.X - movX, MousePosition.Y - movY);
}
}
/// <summary>
/// Evènement permettant de déplacer la fenêtre de jeux dans l'environnement utilisateur.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pnlMain_MouseUp(object sender, MouseEventArgs e)
{
mov = 0;
}
}
}
......@@ -34,10 +34,11 @@ namespace _20School
//Variable a soustraire de l'élève quand il bavarde
double rmEffortBavardage1, rmEffortBavardage2, rmEffortBavardage3, rmEffortBavardage4, rmEffortBavardage5 = 0;
//Variable du timer & de l'effort etudiant
public static int timerTick = 150;
public static int timerTick = 120;
public static double effortEtu;
int repetCoursParticulier = 0;
public static bool bavardageBackground = false;
bool currentPause = false;
......@@ -1120,7 +1121,7 @@ namespace _20School
{
//Initalisation de la BDD
initBDD();
timerTick = 150;
timerTick = 120;
// Vides la liste des valeurs graphiques pour chaque eleves
graph.cleanListes();
// Attribue INE pour valeurs graphiques de chaque eleve
......@@ -1236,14 +1237,14 @@ namespace _20School
}
//Bavardage au bout d'une certaines durée
if (timerTick == 120)
if (timerTick == 90)
{
if (bavardageBackground == false)
{
exeBavardage();
}
}
if (timerTick == 70)
if (timerTick == 40)
{
if (bavardageBackground == false)
{
......@@ -1264,16 +1265,7 @@ namespace _20School
}
//Maj des données pour le graphique toute les 10s
if (timerTick == 149)
graph.remplissageList();
if (timerTick == 140)
graph.remplissageList();
if (timerTick == 130)
graph.remplissageList();
if (timerTick == 120)
if (timerTick == 119)
graph.remplissageList();
if (timerTick == 110)
......
This diff is collapsed.
......@@ -24,6 +24,17 @@ namespace _20School
/// Evenement : Actions ayant lieu au chargement du formulaire
/// </summary>
private void fmRecap_Load(object sender, EventArgs e)
{
initBulletin();
}
/// <summary>
/// Procedure : Initialise la réussite ou l'échec de chaque élèves
/// </summary>
public void initBulletin()
{
OleDbConnection connexion = new OleDbConnection(connectionString);
......@@ -32,88 +43,254 @@ namespace _20School
//Ouverture de la BDD et Lecture des données
connexion.Open();
string eleve1 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve1.Tag.ToString();
string eleve2 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve2.Tag.ToString();
string eleve3 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve3.Tag.ToString();
string eleve4 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve4.Tag.ToString();
string eleve5 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve5.Tag.ToString();
string compTB = "Très bon résultat";
string compB = "Bon résultat";
string compAB = "Résultat satisfaisant";
string compP = "Résultat passable";
string compE = "Insuffisant";
string effortTB = "Très bon effort";
string effortB = "Bon effort";
string effortAB = "Effort satisfaisant";
string effortP = "Effort passable";
string effortE = "Effort Insuffisant";
string comp1 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve1.Tag.ToString();
string comp2 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve2.Tag.ToString();
string comp3 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve3.Tag.ToString();
string comp4 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve4.Tag.ToString();
string comp5 = @"Select echelleCompe From Etudiant WHERE INE=" + pbEleve5.Tag.ToString();
string eff1 = @"Select echelleEffort From Etudiant WHERE INE=" + pbEleve1.Tag.ToString();
string eff2 = @"Select echelleEffort From Etudiant WHERE INE=" + pbEleve2.Tag.ToString();
string eff3 = @"Select echelleEffort From Etudiant WHERE INE=" + pbEleve3.Tag.ToString();
string eff4 = @"Select echelleEffort From Etudiant WHERE INE=" + pbEleve4.Tag.ToString();
string eff5 = @"Select echelleEffort From Etudiant WHERE INE=" + pbEleve5.Tag.ToString();
// Lecture des infos récupérées
OleDbCommand cmd1 = new OleDbCommand(eleve1, connexion);
OleDbCommand cmd1 = new OleDbCommand(comp1, connexion);
OleDbDataReader dr1 = cmd1.ExecuteReader();
dr1.Read();
double compet1= dr1.GetDouble(0);
double compet1 = dr1.GetDouble(0);
OleDbCommand cmdeffort1 = new OleDbCommand(eff1, connexion);
OleDbDataReader dreffort1 = cmdeffort1.ExecuteReader();
dreffort1.Read();
double effort1 = dreffort1.GetDouble(0);
// Lecture des infos récupérées
OleDbCommand cmd2 = new OleDbCommand(eleve2, connexion);
OleDbCommand cmd2 = new OleDbCommand(comp2, connexion);
OleDbDataReader dr2 = cmd2.ExecuteReader();
dr2.Read();
double compet2 = dr2.GetDouble(0);
OleDbCommand cmdeffort2 = new OleDbCommand(eff2, connexion);
OleDbDataReader dreffort2 = cmdeffort2.ExecuteReader();
dreffort2.Read();
double effort2 = dreffort2.GetDouble(0);
// Lecture des infos récupérées
OleDbCommand cmd3 = new OleDbCommand(eleve3, connexion);
OleDbCommand cmd3 = new OleDbCommand(comp3, connexion);
OleDbDataReader dr3 = cmd3.ExecuteReader();
dr3.Read();
double compet3 = dr3.GetDouble(0);
OleDbCommand cmdeffort3 = new OleDbCommand(eff3, connexion);
OleDbDataReader dreffort3 = cmdeffort3.ExecuteReader();
dreffort3.Read();
double effort3 = dreffort3.GetDouble(0);
// Lecture des infos récupérées
OleDbCommand cmd4 = new OleDbCommand(eleve4, connexion);
OleDbCommand cmd4 = new OleDbCommand(comp4, connexion);
OleDbDataReader dr4 = cmd4.ExecuteReader();
dr4.Read();
double compet4 = dr4.GetDouble(0);
OleDbCommand cmdeffort4 = new OleDbCommand(eff4, connexion);
OleDbDataReader dreffort4 = cmdeffort4.ExecuteReader();
dreffort4.Read();
double effort4 = dreffort4.GetDouble(0);
// Lecture des infos récupérées
OleDbCommand cmd5 = new OleDbCommand(eleve5, connexion);
OleDbCommand cmd5 = new OleDbCommand(comp5, connexion);
OleDbDataReader dr5 = cmd5.ExecuteReader();
dr5.Read();
double compet5 = dr5.GetDouble(0);
//Conditions déterminant la réussite ou l'échec de l'élève
OleDbCommand cmdeffort5 = new OleDbCommand(eff5, connexion);
OleDbDataReader dreffort5 = cmdeffort5.ExecuteReader();
dreffort5.Read();
double effort5 = dreffort5.GetDouble(0);
// Ajouts des items dans combobox competences + conditions déterminant la réussite ou l'échec de l'élève
if (compet1 >= 10)
{
pnlCheck1.BackgroundImage = Properties.Resources.check;
cbComp1.Items.Add(compTB);
cbComp1.Items.Add(compB);
cbComp1.Items.Add(compAB);
cbComp1.Items.Add(compP);
cbComp1.Items.Add(compE);
}
else if (compet1 < 10)
{
pnlCheck1.BackColor = Color.Red;
pnlCheck1.BackgroundImage = Properties.Resources._false;
cbComp1.Items.Add(compAB);
cbComp1.Items.Add(compP);
cbComp1.Items.Add(compE);
}
if (compet2 >= 10)
{
pnlCheck2.BackgroundImage = Properties.Resources.check;
cbComp2.Items.Add(compTB);
cbComp2.Items.Add(compB);
cbComp2.Items.Add(compAB);
cbComp2.Items.Add(compP);
cbComp2.Items.Add(compE);
}
else if (compet2 < 10)
{
pnlCheck2.BackgroundImage = Properties.Resources._false;
cbComp2.Items.Add(compAB);
cbComp2.Items.Add(compP);
cbComp2.Items.Add(compE);
}
if (compet3 >= 10)
{
pnlCheck3.BackgroundImage = Properties.Resources.check;
cbComp3.Items.Add(compTB);
cbComp3.Items.Add(compB);
cbComp3.Items.Add(compAB);
cbComp3.Items.Add(compP);
cbComp3.Items.Add(compE);
}
else if (compet3 < 10)
{
pnlCheck3.BackgroundImage = Properties.Resources._false;
cbComp3.Items.Add(compAB);
cbComp3.Items.Add(compP);
cbComp3.Items.Add(compE);
}
if (compet4 >= 10)
{
pnlCheck4.BackgroundImage = Properties.Resources.check;
cbComp4.Items.Add(compTB);
cbComp4.Items.Add(compB);
cbComp4.Items.Add(compAB);
cbComp4.Items.Add(compP);
cbComp4.Items.Add(compE);
}
else if (compet4 < 10)
{
pnlCheck4.BackgroundImage = Properties.Resources._false;
cbComp4.Items.Add(compAB);
cbComp4.Items.Add(compP);
cbComp4.Items.Add(compE);
}
if (compet5 >= 10)
{
pnlCheck5.BackgroundImage = Properties.Resources.check;
cbComp5.Items.Add(compTB);
cbComp5.Items.Add(compB);
cbComp5.Items.Add(compAB);
cbComp5.Items.Add(compP);
cbComp5.Items.Add(compE);
}
else if (compet5 < 10)
{
pnlCheck5.BackgroundImage = Properties.Resources._false;
cbComp5.Items.Add(compAB);
cbComp5.Items.Add(compP);
cbComp5.Items.Add(compE);
}
// Ajouts des items dans combobox efforts
if (effort1 >= 10)
{
cbEffort1.Items.Add(effortTB);
cbEffort1.Items.Add(effortB);
cbEffort1.Items.Add(effortAB);
cbEffort1.Items.Add(effortP);
cbEffort1.Items.Add(effortE);
}
else if (effort1 < 10)
{
cbEffort1.Items.Add(effortAB);
cbEffort1.Items.Add(effortP);
cbEffort1.Items.Add(effortE);
}
if (effort2 >= 10)
{
cbEffort2.Items.Add(effortTB);
cbEffort2.Items.Add(effortB);
cbEffort2.Items.Add(effortAB);
cbEffort2.Items.Add(effortP);
cbEffort2.Items.Add(effortE);
}
else if (effort2 < 10)
{
cbEffort2.Items.Add(effortAB);
cbEffort2.Items.Add(effortP);
cbEffort2.Items.Add(effortE);
}
if (effort3 >= 10)
{
cbEffort3.Items.Add(effortTB);
cbEffort3.Items.Add(effortB);
cbEffort3.Items.Add(effortAB);
cbEffort3.Items.Add(effortP);
cbEffort3.Items.Add(effortE);
}
else if (effort3 < 10)
{
cbEffort3.Items.Add(effortAB);
cbEffort3.Items.Add(effortP);
cbEffort3.Items.Add(effortE);
}
if (effort4 >= 10)
{
cbEffort4.Items.Add(effortTB);
cbEffort4.Items.Add(effortB);
cbEffort4.Items.Add(effortAB);
cbEffort4.Items.Add(effortP);
cbEffort4.Items.Add(effortE);
}
else if (effort4 < 10)
{
cbEffort4.Items.Add(effortAB);
cbEffort4.Items.Add(effortP);
cbEffort4.Items.Add(effortE);
}
if (effort5 >= 10)
{
cbEffort5.Items.Add(effortTB);
cbEffort5.Items.Add(effortB);
cbEffort5.Items.Add(effortAB);
cbEffort5.Items.Add(effortP);
cbEffort5.Items.Add(effortE);
}
else if (effort5 < 10)
{
cbEffort5.Items.Add(effortAB);
cbEffort5.Items.Add(effortP);
cbEffort5.Items.Add(effortE);
}
}
catch (Exception ex) //Affichage du message d'erreur s'il une erreur est présente
......@@ -126,5 +303,24 @@ namespace _20School
connexion.Close(); //Fermeture de la connextion à la BDD (Mode connécté)
}
}
private void btnEnvoyer_Click(object sender, EventArgs e)
{
bool test = true;
foreach (ComboBox cb in this.Controls.OfType<ComboBox>())
{
if(string.IsNullOrEmpty(cb.Text)) {
test = false;
}
}
if(test)
{
//Fermeture du formulaire actuelle et ouverture d'un nouveau
this.Hide();
Menu frmMenu = new Menu();
frmMenu.Closed += (s, args) => this.Close();
frmMenu.Show();
}
}
}
}
cc0d3d311b5f48e3205c6ade40035f5d03cc1518
9b6ead880b3e13caed11e845b9206e1ee0016358
......@@ -102,7 +102,6 @@ C:\Users\okkes\Desktop\cmder\20schoolT3\20School\bin\Debug\LiveCharts.Wpf.xml
C:\Users\okkes\Desktop\cmder\20schoolT3\20School\obj\Debug\20School.csproj.CopyComplete
C:\Users\Hugo\git\20schoolt3\20School\obj\Debug\_20School.fmCoursParticulier.resources
C:\Users\victo\Desktop\DUT\S3\Projet tutoré\20schoolT3\20School\obj\Debug\_20School.fmCoursParticulier.resources
C:\Users\victo\Desktop\DUT\S3\Projet tutoré\20schoolT3\20School\obj\Debug\20School.csprojAssemblyReference.cache
C:\Users\Hugo\git\20schoolt3\20School\bin\Debug\20School.exe.config
C:\Users\Hugo\git\20schoolt3\20School\bin\Debug\20School.exe
C:\Users\Hugo\git\20schoolt3\20School\bin\Debug\20School.pdb
......@@ -123,3 +122,4 @@ C:\Users\victo\Desktop\DUT\S3\Projet tutoré\20schoolT3\20School\obj\Debug\_20Sc
C:\Users\victo\Desktop\DUT\S3\Projet tutoré\20schoolT3\20School\obj\Debug\_20School.fmRecap.resources
C:\Users\Hugo\git\20schoolt3\20School\obj\Debug\_20School.fmRecap.resources
C:\Users\okkes\Desktop\cmder\20schoolT3\20School\obj\Debug\_20School.fmRecap.resources
C:\Users\victo\Desktop\DUT\S3\Projet tutoré\20schoolT3\20School\obj\Debug\20School.csprojAssemblyReference.cache
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment