1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Text;
using System.Security.Cryptography;
public partial class Images_Default : System.Web.UI.Page
{
protected void Page_Init(object sender, EventArgs e)
{
SqlConnection oConnection = new SqlConnection("Server=.\\SQL2K8;Initial Catalog=SUPINFO-PROJECTS;uid=sa;password=remy2501");
oConnection.Open();
SqlConnection oConnection2 = new SqlConnection("Server=.\\SQL2K8;Initial Catalog=SUPINFO-PROJECTS;uid=sa;password=remy2501");
oConnection2.Open();
SqlCommand mysqlcommand = new SqlCommand("select prj.*, usr.ID_User, usr.Prenom, usr.Nom from projets prj left join users usr on usr.ID_User = prj.ID_Chef_Projet", oConnection);
SqlDataReader reader = mysqlcommand.ExecuteReader();
while (reader.Read())
{
SqlCommand mysqlcommand2 = new SqlCommand("select usr.ID_User, usr.Prenom, usr.Nom from AssoUserProjet asso left join USERS usr on usr.ID_User = asso.ID_User where asso.ID_Projet =" + (reader.IsDBNull(1) ? "0" : reader["ID_Projet"]), oConnection2);
SqlDataReader reader2 = mysqlcommand2.ExecuteReader();
Global.InnerHtml += "<div class=\"arrondi\">" +
"<div>" +
"<h3>Titre : " + reader["Titre"] + "</h3>" +
"<h4>Description : " + reader["Description"] + "</h4>" +
"<h4>Chef de Projet : " + (reader.IsDBNull(3) ? "Aucun chef de projet" : (reader["Prenom"] + " " + reader["Nom"])) +
"</h4>" +
"<h4>Membre(s) du projet : </h4>" +
"<ul>";
while(reader2.Read())
{
Global.InnerHtml += "<li>" + reader2["Prenom"] + " " + reader2["Nom"] +
"<sapn id=\"" + reader["ID_Projet"] + "_" + reader2["ID_User"] + "\"></span> </li>";
/* Ne Fonctionne Pas
Button tempbutton = new Button();
Control tempobject = FindControl("BodyContent");
tempobject.Controls.Add(tempbutton);*/
}
Global.InnerHtml += "</ul>" +
" </div>" +
"</div>";
reader2.Close();
}
oConnection.Close();
oConnection2.Close();
}
protected void ccco_Click(object sender, EventArgs e)
{
}
} |
Partager