Correction Developpement Dapplications Informatiques 2014
Correction Developpement Dapplications Informatiques 2014
Correction Developpement Dapplications Informatiques 2014
Code : xxx , la tache intitulée : xxx , Date de début : xxx, Date de fin : xxx, DelaiMax :xxx
3-
a- Cette classe contient une collection pour traduire le lien logique : pour chaque projet on a
plusieurs taches.
5-
Sub listerTaches()
Me.DGV.DataSource = dst.Tables("tache")
EndSub
6-
Function CodeTache_existe(Byval code As String) As Boolean
Dim L() As DataRow
L = dst.Tables("tache").Select("codetache='" + code + "'")
If L.Length <> 0 Then
Return True
EndIf
Return False
End Function
7-
PrivateSub Ajouter_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Ajouter.Click
If cbProjets.Text.Trim.Equals("") OrMe.codetache.Text.Equals("") Then
MessageBox.Show("Formulaire incomplet")
Exit Sub
EndIf
If CodeTache_existe(Me.codeTache.text) then
MessageBox.Show("Code éxistant")
Exit Sub
EndIf
Dim A As DataRow
A = dst.Tables("tache").NewRow
A(0) = Me.codetache.Text
A(1) = Me.NomTache.Text
A(2) = Me.debut.Value
A(3) = Me.fin.Value
A(4) = Me.cbProjets.SelectedValue
1-
<html>
<head>
</head>
<body>
<h1 align="center"> Gestion des projets</h1>
<?php
$c=mysql_connect("localhost","root","") or die("Erreur de
connexion au serveur");
mysql_select_db("Base",$c) or die("Erreur de connexion au
serveur");
$rs=mysql_query("select * from projet");
while($row=mysql_fetch_row($rs))
echo "<option value='$row[0]'>$row[1]</option>";
?>
</select>
</td></tr>
<tr><td colspan="2"><input type="submit" value =" Afficher
details " name="Afficher"></td></tr>
</form>
</table>
2-
<hr>
<h2 align="center">Liste des taches du projet : Gestion de
stock</h2>
<table align="center" width="60%" border="2">
<tr><th width="20%">CodeTache</th><th width="20%">nomTache</th><th
width="20%">Date Début</th><th width="20%">Date
Fin</th><th>Supprimer</th></tr>
<?php
if(isset($_POST) and !empty($_POST))
{
$c=mysql_connect("localhost","root","") or die("Erreur
de connexion au serveur");
mysql_select_db("Base",$c) or die("Erreur de connexion
au serveur");
$a = $_POST["ListeProjets"];
$rs=mysql_query("select * from Tache where code =
‘$a’");
while($row=mysql_fetch_row($rs))
echo
"<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td><td>$row
[3]</td><th><a href='#?n=\"$row[0]\"'>sup</a></th></option>";
}
2- Programme Client :
3- Programme Serveur :
public class Serveur {
private ServerSocket socketserver
private Socket sc=null;
private DataInputStream in = null;
private PrintStream out= null;
a-
public boolean acceptConnexion (int Port)
{
Try {
socketserver = new ServerSocket(Port) ;
sc = serversocket.accept() ;
in = new DataInputStream(new
BufferInputStream(sc.getinputStream()));
out = new PrintStream(new
BufferedOutputStream(sc.getoutputStream()));
return true;
} catch ( Exception e) { return false;}
}
b-
public void EnvoiTaches()
{String code ;
If ((code = in.readLine()) != null) { int pos = PFE.indexOf(new
Projet(code,null));
If (pos = = -1) out.println(“Projet introuvable”);
Else out.println(PFE.get(pos));
}