Matière : Application Web avec C#
Effectué par :
Copyright © 2010-2011,
eliematta.com
. All rights reserved
NOM Prénom
INF#
MATTA Elie
et al.
Privacy
applied
Miss Lebanon Contest
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 1
On va introduire dans ce rapport les
différentes étapes quâon a suivi avec des
exemples et des images :
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 2
Dans cette page on a mis un contentplaceholder dans lequel vont ouvrir les pages
secondaires du website. Lâautre partie ne change pas de page en page. Elle contient
des links vers des pages contenant :
ï
Des informations sur les professeurs ;
ï
Des conseils pour la beauté ;
ï
Les sponsors ;
ï
Des informations concernant les concurrentes avec un gallery ;
ï
Le box du login et logout ;
ï
Des informations a propos des jurées ;
ï
Un bouton home menant a la page principale ;
ï
Un contact us pour nous donner tous les commentaires.
Deux panels servent a la démarche dâauthentification :
La première contient le username et le password avec un login button qui est
visible par défaut. Si lâauthentification est correcte ce dernier panel sera invisible et
un autre contenant le logout button apparait.
MasterPage.master.cs :
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;public partial class MasterPage : System.Web.UI.MasterPage
{
string userid;
protected void Page_Load(object sender, EventArgs e) {
if (Session["user"] == null) {
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 3
Panel1.Visible = true; Panel2.Visible = false; } else { Panel1.Visible = false; Panel2.Visible = true; } }protected void LinkButton1_Click1(object sender, EventArgs e) {
user u = new user();
u.username = TextBox1.Text; u.password = TextBox2.Text; if (u.login()) { Panel1.Visible = false; Panel2.Visible = true; Session.Add("user", u);
Response.Redirect("Juree_Login.aspx"); }
}
protected void TextBox2_TextChanged(object sender, EventArgs e) {
}
protected void TextBox1_TextChanged(object sender, EventArgs e) {
}
protected void LinkButton3_Click(object sender, EventArgs e) { Panel1.Visible = true; Panel2.Visible = false; Session.Remove("user"); Response.Redirect("Default.aspx"); }
protected void LinkButton2_Click(object sender, EventArgs e) {
Response.Redirect("Juree_Login.aspx"); }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 4
MasterPage.master.aspx
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>.:: Miss Lebanon 2009 ::.</title>
<link href="style.css" rel="stylesheet" type="text/css" /> <script language="javascript" type="text/javascript">
// <!CDATA[ function P1_onclick() { } function Text1_onclick() { } // ]]> </script> </head> <body>
<form id="form1" runat="server"> <div id="topheader">
<div class="topmenu_area"><a href="Default.aspx" class="home">Home</a> <a href="Aboutus.aspx" class="about">About</a> <a href="jurylist.aspx" class="search">Jury</a> </div>
<div class="banner_textarea" style="width: 494px">
<p class="banner_head">A lucky girl will be wearing a crown and the title of Miss Lebanon 2009 this Year!
Who will this beauty be? </p>
<p>Miss Lebanon is the only national beauty contest that awards prizes worth more than half a million US dollars to its winners. Keep on joining this website to vote for your favorite participant.</p>
</div>
<div class="search_menu_banner">
<div class="menu_area"><a href="gallery.aspx"
class="addidea">Gallery</a> <a href="news.aspx" class="loginhere">News</a> <a href="comments.aspx" class="comments">Comments</a> <a
href="Contactus.aspx" class="contact">Contact Us </a></div>
</div> </div>
<div id="body_area">
<div class="left">
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 5
<div class="morelinks_area">
<div class="morelinks_head">More Links </div>
<div class="links_morearea"><a href="Default.aspx" class="morelink">Home<span class="links_text">
</span></a>
<a href="Contest.aspx" class="morelink">The contest <span class="links_text">
</span></a> <a href="Beautytip.aspx" class="morelink">Beauty Tips<span class="links_text"></span></a>
<a href="Membersarea.aspx" class="morelink">Teachers<span class="links_text"></span></a> <br />
<a href="sponsors.aspx" class="morelink">Other Sponsors<span class="links_text"></span></a>
<br /> <br /> <table> <tr><td></td> <td></td> <td>
<asp:Image ID="Image1" runat="server"
ImageUrl="~/images/image11.jpg" Height="45px" Width="32px" /><br />
</td>
<td style="width: 30px">
<asp:Image ID="Image2" runat="server"
ImageUrl="~/images/image12.jpg" Height="45px" Width="32px" /><br />
</td>
<td>
<asp:Image ID="Image3" runat="server"
ImageUrl="~/images/image13.jpg" Height="45px" Width="32px" /></td>
<td>
<asp:Image ID="Image4" runat="server"
ImageUrl="~/images/image14.jpg" Height="45px" Width="32px" /></td>
<td>
<asp:Image ID="Image5" runat="server"
ImageUrl="~/images/image15.jpg" Height="45px" Width="32px" /></td>
</tr>
<tr>
<td></td><td></td>
<td>
<asp:Image ID="Image6" runat="server"
ImageUrl="~/images/image16.jpg" Height="45px" Width="32px" /></td>
<td style="width: 30px">
<asp:Image ID="Image7" runat="server"
ImageUrl="~/images/image17.jpg" Height="45px" Width="32px" /></td>
<td>
<asp:Image ID="Image8" runat="server"
ImageUrl="~/images/image18.jpg" Height="45px" Width="32px" /></td>
<td>
<asp:Image ID="Image9" runat="server"
ImageUrl="~/images/image19.jpg" Height="45px" Width="32px" /></td>
<td>
<asp:Image ID="Image10" runat="server"
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 6
</tr>
<tr>
<td></td><td></td>
<td>
<asp:Image ID="Image11" runat="server"
ImageUrl="~/images/image8.jpg" Height="45px" Width="32px" /></td>
<td style="width: 30px">
<asp:Image ID="Image12" runat="server"
ImageUrl="~/images/image4.jpg" Height="45px" Width="32px" /></td>
<td>
<asp:Image ID="Image13" runat="server"
ImageUrl="~/images/image21.jpg" Height="45px" Width="32px" /></td>
<td>
<asp:Image ID="Image14" runat="server"
ImageUrl="~/images/image22.jpg" Height="45px" Width="32px" /></td>
<td>
<asp:Image ID="Image15" runat="server"
ImageUrl="~/images/image23.jpg" Height="45px" Width="32px" /></td>
</tr>
</table>
</div>
</div>
<div class="morelinks_bottom"></div>
</div>
<div class="body_area1">
<div class="mid">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="right">
<div class="right_area">
<div class="right_top"></div>
<div class="right_head">
<div class="morelinks_head">Sponsors </div>
</div>
<asp:Image ID="Image16" runat="server" ImageUrl="~/images/sponsors.gif" Height="210px" Width="195px" />
</div>
<div class="right_bottom"></div>
</div>
</div>
</div>
<div class="body_areabackground"> <div id="body_area1">
<div class="inner_tabarea">
<div class="inner_menu">
<div align="center"><a href="#" class="innermenu_hover">Features</a> </div>
</div>
<div class="tab_text">
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 7
<p><a href="gabriellebourached.aspx" ><span class="tab_head1">Gabrielle Bou Rached</span></a><br />
<a href="gabriellebourached.aspx" class="tablink">Gabrielle Bou Rached</a> was crowned Miss Campus of USJ University Beirut, she represented ...</p>
</div>
<div class="tab_readmore">
<p align="right" class="tab_head"><a href="gabriellebourached.aspx" class="readmore">Read More </a></p>
</div>
<div class="tab_text">
<p><a href="georginarizk.aspx" ><span class="tab_head1">Georgina Rizk</span></a><br />
In the 1972 Miss Universe pageant in Dorado, Puerto Rico, the 1971 winner, <a href="georginarizk.aspx" class="tablink">Georgina Rizk</a>, was not allowed to attend...</p>
</div>
<div class="tab_readmore">
<p align="right" class="tab_head"><a href="georginarizk.aspx" class="readmore">Read More </a></p>
</div>
</div>
<div class="login_area">
<asp:Panel ID="Panel2" runat="server" Visible="False" Height="33px" Width="288px">
<div class="login_head" style="height: 27px">Welcome Jury</div> <br /> We present to you the voting for the <br /> official Miss Lebanon 2009! You are ready <br /> to start voting.
<br /><br /> <a href="Juree_Login.aspx"><asp:LinkButton ID="LinkButton2" runat="server">Click here</asp:LinkButton></a> to see your information<br /><br />
<div class="login_textarea" style="height: 17px">
<asp:LinkButton ID="LinkButton3" CssClass="login" runat="server" Height="20px" OnClick="LinkButton3_Click"
Width="70px">Logout</asp:LinkButton>
</div>
</asp:Panel>
<asp:Panel ID="Panel1" runat="server" Height="1px" Width="286px">
<div class="login_head" style="height: 27px">Already a Member ?</div>
<div class="login_textarea" style="height: 33px">
<div class="login_name">Your Name </div>
<div class="login_box">
<label>
<asp:TextBox ID="TextBox1" runat="server" Width="160px"
OnTextChanged="TextBox1_TextChanged"></asp:TextBox></label></div>
</div>
<div class="login_textarea" style="height: 33px">
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 8
<div class="login_box">
<label>
<asp:TextBox ID="TextBox2" runat="server" Width="160px" OnTextChanged="TextBox2_TextChanged"
TextMode="Password"></asp:TextBox></label></div>
</div>
<div class="login_textarea" style="height: 17px">
<asp:LinkButton ID="LinkButton1" CssClass="login" runat="server" Height="20px" OnClick="LinkButton1_Click1"
Width="50px">Login</asp:LinkButton></div>
</asp:Panel>
</div>
<div class="toolfree_area">
<div class="facing"></div>
<div class="bookmark">For more information</div>
<div class="call_free"><span class="callus">Call Us</span>
<span class="callno">+01-444-333<br /><font size="1"> P.O.Box 14-5225 Adma, Lebanon</font></span></div>
</div> </div></div>
<div id="fotter">
<div id="fotter_1">
<div class="fotter_leftarea">
<div class="fotter_links">
<a href="Default.aspx" class="fotterlink">Home</a> | <a href="Aboutus.aspx" class="fotterlink">About Us</a> | <a
href="sponsors.aspx" class="fotterlink">Sponsors</a> | <a href="Contactus.aspx" class="fotterlink">Contact</a> </div>
<div class="fotter_designed">Designed by: Elie Matta et al.</div>
</div>
<div class="fotter_rightarea">
<div class="fotter_copyrights">Copyright © Miss Lebanon 2009. All rights reserved. Managed by E.K & E.M S.A.R.L<br /></div>
</div> </div> </div> </form> </body> </html>
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 9
Default :
Default est la page principale du site et qui est la première a être ouverte lors de
lâexécution du programme.
Elle contient un texte qui nous explique a propos du site.
Default.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 10
<div class="tick_head">Welcome to <span class="tick_head1">"Miss Lebanon on line"</span> competition!</div>
<p dir="ltr"><font face="Arial" color ="#3b3b3b" size="3">To participate please send us
your application with some revealing photos and if acceptable we will arrange for professional photos to be taken at our expense.<br/><br/>
We provide a total of more than one Million dollars in cash prizes, modeling contacts and scholarships for winners. Also we provide free accommodation for all our contestants as well as spending money when they arrive to the actual live competition following the online competition.</font></p>
</asp:Content>
Default.apx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) {
} }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 11
Jurelogin
Suite a lâauthentification on aboutit a une page nommée Juree_Login où apparait la
photo du jure qui est logged in avec des informations de ce dernier qui sont
présents suite a une connexion a la data base.
Un bouton liste des concurrents est présent au-dessous de ces informations menant
a la page concurrents
Juree_Login.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Juree_Login.aspx.cs" Inherits="Juree_Login" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p dir="ltr"><font face="Arial" color ="#3b3b3b" size="3">
<asp:Image ID="Image1" runat="server" Width="150" Height="180" /></font></p>
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 12
<font color="#3b3b3b" face="Arial" size="3">
<asp:Label ID="Label1" runat="server" Text=""></asp:Label><br />
<asp:Label ID="Label2" runat="server" Text=""></asp:Label><br />
<asp:Label ID="Label3" runat="server" Text=""></asp:Label><br />
<asp:Label ID="Label4" runat="server" Text=""></asp:Label><br />
<asp:Label ID="Label5" runat="server" Text=""></asp:Label><br />
<asp:Label ID="Label6" runat="server" Text=""></asp:Label><br />
<asp:Label ID="Label7" runat="server" Text=""></asp:Label><br />
</font> </p>
<asp:Button ID="Button1" runat="server" Text="List of the contestants" OnClick="Button1_Click" /> </asp:Content>
Juree_Login.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;public partial class Juree_Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) {
if (Session["user"] == null) {
Response.Redirect("Error_Login.aspx"); }
user u = (user)Session["user"]; Label1.Text = "Nom: " + u.nom + " ";
Label2.Text = "Prenom: " + u.prenom + " "; Label3.Text = "Sexe: " + u.sexe + " ";
Label4.Text = "Profession: " + u.profession + " "; Label5.Text = "Telephone: " + u.telephone + " "; Label6.Text = "E-Mail: " + u.mail + " ";
Label7.Text = "Adresse: " + u.adresse + " "; Image1.ImageUrl = u.image;
}
protected void Button1_Click(object sender, EventArgs e) {
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 13
Response.Redirect("concurrent.aspx"); //Response.Redirect("concurrents.aspx?conid=" + id); } }Concurrents :
Cette page contient un grid view qui amène de la data base toutes les concurrentes
présentes avec les informations sélectionnées de chacune. Le link select nous mène
a une page nommée miss qui contient des informations de chaque concurrentes
selon le link sélectionné.
Concurrent.aspx:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="concurrent.aspx.cs" Inherits="concurent" Title="Untitled Page" %>
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 14
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:GridView ID="GridView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" AutoGenerateSelectButton="True"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="500px" AllowSorting="True" Height="212px" >
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" /> </asp:GridView> </asp:Content>
Concurrent.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic;public partial class concurent : System.Web.UI.Page
{
string conid;
protected void Page_Load(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); string query = "Select * from Concurrent"; DataSet ds = db.select(query);
DataTable dt = ds.Tables[0];
string queryEtape = "Select DISTINCT(etapeID) from Resultat"; DataSet dsEtape = db.select(queryEtape);
DataTable dtEtape = dsEtape.Tables[0];
string queryEtape2 = "Select etapeID from Resultat"; DataSet dsEtape2 = db.select(queryEtape2);
DataTable dtEtape2 = dsEtape2.Tables[0]; ArrayList arOne = new ArrayList();
List<ArrayList> listAll = new List<ArrayList>(); string etapIDForResult = "";
if (dtEtape.Rows.Count > 1 || dtEtape2.Rows.Count == 30) {
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 15
if (dtEtape2.Rows.Count != 30 && dtEtape2.Rows.Count != 51 && dtEtape2.Rows.Count != 66)
{
etapIDForResult = dtEtape.Rows[0][0].ToString(); for (int i = 0; i < dtEtape.Rows.Count; i++) {
if
(dtEtape.Rows[i][0].ToString().CompareTo(etapIDForResult) == 1)
etapIDForResult = dtEtape.Rows[i][0].ToString(); }
if (etapIDForResult == "3- Mesure et poids") etapIDForResult = "2 -Beaute";
else if (etapIDForResult == "4 -Questions generales") etapIDForResult = "3- Mesure et poids";
} else if (dtEtape2.Rows.Count == 30) { etapIDForResult = "2 -Beaute"; } else if (dtEtape2.Rows.Count == 51) {
etapIDForResult = "3- Mesure et poids"; }
else if (dtEtape2.Rows.Count == 66) {
etapIDForResult = "4 -Questions generales"; }
for (int i = 0; i < dt.Rows.Count; i++) {
int finalnote = getConNoteByID(dt.Rows[i][0].ToString(), etapIDForResult);
ArrayList listOne = new ArrayList(); listOne.Add(finalnote.ToString()); listOne.Add(dt.Rows[i][0].ToString()); listAll.Add(listOne);
}
List<ArrayList> listAllSorted = listAll; for (int i = 0; i < listAll.Count; i++) {
for (int j = i + 1; j < listAll.Count; j++) {
if (Convert.ToInt32(listAll[j][0]) >
Convert.ToInt32(listAllSorted[i][0])) {
ArrayList tempList = listAllSorted[i]; listAllSorted[i] = listAll[j];
listAllSorted[j] = tempList; }
} }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 16
string qFinal = "Select conid, nom, prenom, lieu_naiss, date_naiss from Concurrent where ";
if (Convert.ToInt32(etapIDForResult.Substring(0, 1).ToString()) == 2)
{
for (int i = 0; i < listAllSorted.Count - 3; i++) {
if (i == 0) {
qFinal = qFinal + "conid = '" + listAllSorted[i][1].ToString() + "' ";
} else
{
qFinal = qFinal + "or conid = '" + listAllSorted[i][1].ToString() + "' ";
} } }
else if (Convert.ToInt32(etapIDForResult.Substring(0, 1).ToString()) == 3)
{
for (int i = 0; i < listAllSorted.Count - 5; i++) {
if (i == 0) {
qFinal = qFinal + "conid = '" + listAllSorted[i][1].ToString() + "' ";
} else
{
qFinal = qFinal + "or conid = '" + listAllSorted[i][1].ToString() + "' ";
} } }
else if (Convert.ToInt32(etapIDForResult.Substring(0, 1).ToString()) == 4)
{
for (int i = 0; i < listAllSorted.Count - 7; i++) {
if (i == 0) {
qFinal = qFinal + "conid = '" + listAllSorted[i][1].ToString() + "' ";
} else
{
qFinal = qFinal + "or conid = '" + listAllSorted[i][1].ToString() + "' ";
} }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 17
}
DataSet dss = db.select(qFinal); DataTable dtt = dss.Tables[0]; int aaa = dtt.Rows.Count; GridView1.DataSource = dtt; GridView1.DataBind(); GridView1.Visible = true; } else {
DataSet ds2 = db.select("SELECT conid, nom, prenom, lieu_naiss, date_naiss FROM Concurrent");
DataTable dt2 = ds2.Tables[0]; GridView1.DataSource = dt2; GridView1.DataBind();
}
}
private int getConNoteByID(string conId, string etapeID) {
Database db = new Database("Enquete.mdb");
string q = "Select Notes from Resultat where conId = '" + conId + "' and etapeID = '" + etapeID + "'";
DataSet ds = db.select(q); DataTable dt = ds.Tables[0]; int finalNote = 0;
if (dt.Rows.Count > 0) {
for (int i = 0; i < dt.Rows.Count; i++) {
finalNote = finalNote +
Convert.ToInt32(dt.Rows[i][0].ToString()); }
finalNote = finalNote / dt.Rows.Count; }
return finalNote; }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) {
Session["conid"] = GridView1.SelectedRow.Cells[1].Text; if (Session["conid"] != null)
{
user connecteduser = (user)Session["user"]; Database db = new Database("Enquete.mdb");
DataSet ds1 = db.select("SELECT DISTINCT(etapeID) FROM Resultat");
DataTable dt1 = ds1.Tables[0];
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 18
DataTable dt2 = ds2.Tables[0]; string etapeID = "2 -Beaute"; if (dt2.Rows.Count == 30) {
etapeID = "3- Mesure et poids"; Session["etapeID"] = etapeID; }
else if (dt2.Rows.Count == 51) {
etapeID = "4 -Questions generales"; Session["etapeID"] = etapeID;
} else if (dt2.Rows.Count == 66) { return; } else if (dt1.Rows.Count > 0) { etapeID = dt1.Rows[0][0].ToString(); for (int i = 0; i < dt1.Rows.Count; i++) {
if (dt1.Rows[i][0].ToString().CompareTo(etapeID) == 1) etapeID = dt1.Rows[i][0].ToString();
}
Session["etapeID"] = etapeID;
string a = "SELECT * FROM Resultat WHERE etapeID= '" +
etapeID + "' and conID = '" + Session["conid"].ToString() + "' and userid = "
+ connecteduser.userid; DataSet ds3 = db.select(a); DataTable dt3 = ds3.Tables[0]; if (dt3.Rows.Count > 0) { Panel1.Visible = true; return; } }
Response.Redirect("miss.aspx?conid" + conid);
} } }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 19
Miss :
Cette page permet de voire une photo de la concurrentes sélectionnée avec toutes
les informations nécessaires pour le vote suivies dâun bouton vote menant à la page
dédiée au vote.
Miss.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="miss.aspx.cs" Inherits="miss1" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript">
// <!CDATA[
function TABLE1_onclick() {
} // ]]>
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 20
<br /><br />
<asp:Image ID="Image1" runat="server" width="163px" Height="172px" />
<table id="TABLE1" onclick="return TABLE1_onclick()">
<tr>
<td>
<asp:Label ID="Label9" runat="server" Text="First Name"></asp:Label></td>
<td><asp:Label ID="Label1" runat="server"></asp:Label><br />
</td></tr>
<tr><td>
<asp:Label ID="Label10" runat="server" Text="Last Name"></asp:Label></td>
<td>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</td></tr>
<tr><td>
<asp:Label ID="Label11" runat="server" Text="Place of birth"></asp:Label></td>
<td>
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
</td></tr> <tr><td>
<asp:Label ID="Label12" runat="server" Text="Date of birth"></asp:Label></td>
<td>
<asp:Label ID="Label4" runat="server"></asp:Label>
</td> </tr>
<tr><td>
<asp:Label ID="Label13" runat="server" Text="Profession"></asp:Label></td>
<td>
<asp:Label ID="Label5" runat="server" Text="Label"></asp:Label></td>
</tr>
<tr><td>
<asp:Label ID="Label14" runat="server" Text="Height"></asp:Label></td>
<td>
<asp:Label ID="Label6" runat="server" Text="Label"></asp:Label>
</td></tr>
<tr><td>
<asp:Label ID="Label15" runat="server" Text="Hair Color"></asp:Label></td>
<td>
<asp:Label ID="Label7" runat="server" Text="Label"></asp:Label>
</td></tr>
<tr><td>
<asp:Label ID="Label16" runat="server" Text="Eye Color"></asp:Label></td>
<td>
<asp:Label ID="Label8" runat="server" Text="Label"></asp:Label>
</td></tr>
</table>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Vote" Width="65px" />
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 21
Miss.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;public partial class miss1 : System.Web.UI.Page
{
string conid; string aaa;
protected void Page_Load(object sender, EventArgs e) {
this.Button1.Enabled = true; if (Session["user"] == null) {
this.Button1.Visible = false; }
aaa = Request.Params.Get("id"); if (aaa == null)
{
conid = Session["conid"].ToString();
Database db = new Database("Enquete.mdb");
DataSet ds = db.select("SELECT * FROM Concurrent where conid='" + conid + "'"); Label1.Text = ds.Tables[0].Rows[0][1].ToString(); Label2.Text = ds.Tables[0].Rows[0][2].ToString(); Label3.Text = ds.Tables[0].Rows[0][3].ToString(); Label4.Text = ds.Tables[0].Rows[0][4].ToString(); Label5.Text = ds.Tables[0].Rows[0][6].ToString(); Label6.Text = ds.Tables[0].Rows[0][10].ToString(); Label7.Text = ds.Tables[0].Rows[0][11].ToString(); Label8.Text = ds.Tables[0].Rows[0][12].ToString(); Image1.ImageUrl = ds.Tables[0].Rows[0][7].ToString(); } else {
Database db = new Database("Enquete.mdb"); if (aaa == "x0010")
{
DataSet ds = db.select("SELECT * FROM Concurrent where conid='x010'");
Label1.Text = ds.Tables[0].Rows[0][1].ToString(); Label2.Text = ds.Tables[0].Rows[0][2].ToString();
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 22
Label3.Text = ds.Tables[0].Rows[0][3].ToString(); Label4.Text = ds.Tables[0].Rows[0][4].ToString(); Label5.Text = ds.Tables[0].Rows[0][6].ToString(); Label6.Text = ds.Tables[0].Rows[0][10].ToString(); Label7.Text = ds.Tables[0].Rows[0][11].ToString(); Label8.Text = ds.Tables[0].Rows[0][12].ToString(); Image1.ImageUrl = ds.Tables[0].Rows[0][7].ToString(); } else {DataSet ds = db.select("SELECT * FROM Concurrent where conid='" + aaa + "'"); Label1.Text = ds.Tables[0].Rows[0][1].ToString(); Label2.Text = ds.Tables[0].Rows[0][2].ToString(); Label3.Text = ds.Tables[0].Rows[0][3].ToString(); Label4.Text = ds.Tables[0].Rows[0][4].ToString(); Label5.Text = ds.Tables[0].Rows[0][6].ToString(); Label6.Text = ds.Tables[0].Rows[0][10].ToString(); Label7.Text = ds.Tables[0].Rows[0][11].ToString(); Label8.Text = ds.Tables[0].Rows[0][12].ToString(); Image1.ImageUrl = ds.Tables[0].Rows[0][7].ToString(); } } }
protected void Button1_Click(object sender, EventArgs e) {
Response.Redirect("vote.aspx?conid=" + conid); }
protected void Button2_Click(object sender, EventArgs e) {
if (aaa == null) {
Database ao = new Database("Enquete.mdb");
DataSet ds = ao.select("select * from Concurrent where conid='" + conid + "'");
DataTable dt = ds.Tables[0]; int i = 2;
if (dt.Rows[0]["Image"].ToString() == "images/image1.jpg") { while (i < 3) { Image1.ImageUrl = "images/nadinenjeim/image" + i; i++; }
this.Button1.Enabled = false; }
} else
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 23
Database ao = new Database("Enquete.mdb");
DataSet ds = ao.select("select * from Concurrent where conid='" + aaa + "'");
DataTable dt = ds.Tables[0]; int i = 1;
if (dt.Rows[0]["Image"].ToString() == "images/image1.jpg") {
while (i < 3) {
Image1.ImageUrl = "images/nadinenjeim/image"+i; }
this.Button1.Enabled = false; } } } }
Vote :
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 24
La page vote permet au user de voter pour chaque concurrente selon chaque critère.
Trois critères sont présents permettant lâélimination de quelques filles suite a la
présentation du résultat.
Un bouton submit permet la disposition des données dans la data base et mène a
une page étape voting.
Vote.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="vote.aspx.cs" Inherits="vote" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="tick_head">Voting: <span class="tick_head1">Steps and Criterias</span></div><br /><br /><br /><br />
<table style="width: 241px; height: 137px" border="0"> <tr>
<td style="width: 3px; height: 150px; vertical-align: top;" align="left" valign="top"><asp:Label ID="lblCrit1" runat="server" />
<asp:Label ID="lblCrit1Id" runat="server" Visible="False" /></td> <td style="width: 3px; height: 150px;" valign="top">
<asp:RadioButton ID="RadioButton1" runat="server" GroupName="1" Text="excellent" /><br />
<asp:RadioButton ID="RadioButton3" runat="server" GroupName="1" Text="tresbien" />
<asp:RadioButton ID="RadioButton4" runat="server" GroupName="1" Text="bien" />
<asp:RadioButton ID="RadioButton5" runat="server" GroupName="1" Text="moyen" />
<asp:RadioButton ID="RadioButton6" runat="server" GroupName="1" Text="mauvais" />
<asp:RadioButton ID="RadioButton2" runat="server" GroupName="1" Text="nonreponse" />
</td>
<td style="width: 3px; height: 150px;" align="left" valign="top"><asp:Label ID="lblCrit2" runat="server" />
<asp:Label ID="lblCrit2Id" runat="server" Text="Label" Width="54px" Visible="False"></asp:Label></td>
<td style="width: 3px; height: 150px;" valign="top"><asp:RadioButton ID="RadioButton7" runat="server" GroupName="2" Text="excellent" OnCheckedChanged="RadioButton7_CheckedChanged" /><asp:RadioButton ID="RadioButton8" runat="server" GroupName="2" Text="tresbien" OnCheckedChanged="RadioButton8_CheckedChanged" /><br />
<asp:RadioButton ID="RadioButton9" runat="server" GroupName="2" Text="bien" OnCheckedChanged="RadioButton9_CheckedChanged" /><br />
<asp:RadioButton ID="RadioButton10" runat="server" GroupName="2" Text="moyen" OnCheckedChanged="RadioButton10_CheckedChanged" /><br />
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 25
<asp:RadioButton ID="RadioButton11" runat="server" GroupName="2" Text="mauvais" OnCheckedChanged="RadioButton11_CheckedChanged"
/><asp:RadioButton ID="RadioButton12" runat="server" GroupName="2"
Text="nonreponse" OnCheckedChanged="RadioButton12_CheckedChanged" /><br />
</td>
<td style="width: 3px; height: 150px;" valign="top">
<asp:Label ID="lblCrit4" runat="server" Text="Label" Width="57px"></asp:Label>
<br />
<asp:Label ID="lblCrit4Id" runat="server" Text="Label" Visible="False"></asp:Label><br />
</td>
<td style="width: 3px; height: 150px;" valign="top">
<asp:RadioButton ID="RadioButton13" runat="server" OnCheckedChanged="RadioButton13_CheckedChanged"
Text="excellent" GroupName="3" /><br />
<asp:RadioButton ID="RadioButton14" runat="server" OnCheckedChanged="RadioButton14_CheckedChanged"
Text="tresbien" GroupName="3" /><br />
<asp:RadioButton ID="RadioButton15" runat="server" OnCheckedChanged="RadioButton15_CheckedChanged"
Text="bien" GroupName="3" /><br />
<asp:RadioButton ID="RadioButton16" runat="server" OnCheckedChanged="RadioButton16_CheckedChanged"
Text="moyen" GroupName="3" /><br />
<asp:RadioButton ID="RadioButton17" runat="server" OnCheckedChanged="RadioButton17_CheckedChanged"
Text="mauvais" GroupName="3" /><br />
<asp:RadioButton ID="RadioButton18" runat="server" OnCheckedChanged="RadioButton18_CheckedChanged"
Text="nonreponse" GroupName="3" /> </td> </tr> </table>   ; &nbs p; &nb sp; <asp:Button ID="Button1"
runat="server" OnClick="Button1_Click" Text="Submit" /><br /> </asp:Content>
Vote.aspx.cs
using System;using System.Data;
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 26
using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;public partial class vote : System.Web.UI.Page
{
string etapeID = "";
protected void Page_Load(object sender, EventArgs e) {
if (Session["etapeID"] != null) {
etapeID = Session["etapeID"].ToString(); }
else
{
etapeID = "2 -Beaute"; }
user u = (user)Session["user"];
Database db = new Database("Enquete.mdb");
DataSet ds = db.select("SELECT etapeID FROM Resultat"); DataSet ds1 = db.select("SELECT userid FROM Resultat"); DataSet ds3 = db.select("SELECT userid FROM [user]"); DataTable dt = ds.Tables[0];
DataTable dt1 = ds1.Tables[0]; DataTable dt3 = ds3.Tables[0];
int b = Convert.ToInt32(dt1.Rows.Count); if (dt.Rows.Count <= 30)
{
DataSet ds2 = db.select("SELECT* FROM critere where etapeID='" + etapeID + "'");//like ('2%')"); DataTable dt2 = ds2.Tables[0]; lblCrit1.Text = dt2.Rows[0][2].ToString(); lblCrit1Id.Text = dt2.Rows[0][0].ToString(); lblCrit2.Text = dt2.Rows[1][2].ToString(); lblCrit2Id.Text = dt2.Rows[1][2].ToString(); lblCrit4.Text = dt2.Rows[2][2].ToString(); lblCrit4Id.Text = dt2.Rows[2][2].ToString(); }
else if ((dt.Rows.Count > 30) && (dt.Rows.Count < 51)) {
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 27
DataSet ds2 = db.select("SELECT* FROM critere where etapeID ='" + etapeID + "'");//like ('3%')"); DataTable dt2 = ds2.Tables[0]; int a = dt2.Rows.Count; lblCrit1.Text = dt2.Rows[0][2].ToString(); lblCrit1Id.Text = dt2.Rows[0][0].ToString(); lblCrit2.Text = dt2.Rows[1][2].ToString(); lblCrit2Id.Text = dt2.Rows[1][2].ToString(); lblCrit4.Text = dt2.Rows[2][2].ToString(); lblCrit4Id.Text = dt2.Rows[2][2].ToString(); } else if ((dt.Rows.Count > 51)) {
DataSet ds2 = db.select("SELECT* FROM critere where etapeID ='" + etapeID + "'"); //like ('4%')"); DataTable dt2 = ds2.Tables[0]; lblCrit1.Text = dt2.Rows[1][2].ToString(); lblCrit1Id.Text = dt2.Rows[0][0].ToString(); lblCrit2.Text = dt2.Rows[0][2].ToString(); lblCrit2Id.Text = dt2.Rows[1][2].ToString(); lblCrit4.Text = dt2.Rows[2][2].ToString(); lblCrit4Id.Text = dt2.Rows[2][2].ToString(); } else { Response.Redirect("etapevoting.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) {
if (RadioButton1.Checked) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,excellent,userid,etapeID,conID, Notes) values('" +
lblCrit1Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 10)";
db.insert(query); }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 28
else if (RadioButton2.Checked) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,nonreponse,userid,etapeID,conID, Notes) values('" +
lblCrit1Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 0)";
db.insert(query); }
else if (RadioButton3.Checked) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,tresbien,userid,etapeID,conID, Notes) values('" +
lblCrit1Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 8)";
db.insert(query); }
else if (RadioButton4.Checked) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,bien,userid,etapeID,conID, Notes) values('" +
lblCrit1Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 6)";
db.insert(query); }
else if (RadioButton5.Checked) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,moyen,userid,etapeID,conID, Notes) values('" +
lblCrit1Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 4)";
db.insert(query); }
else if (RadioButton6.Checked) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,mauvais,userid,etapeID,conID, Notes) values('" +
lblCrit1Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 2)";
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 29
db.insert(query); }
Server.Transfer("etapevoting.aspx"); }
protected void RadioButton7_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,excellent,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 10)";
db.insert(query); }
protected void RadioButton8_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,tresbien,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 8)";
db.insert(query); }
protected void RadioButton9_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,bien,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 6)";
db.insert(query); }
protected void RadioButton10_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,moyen,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 4)";
db.insert(query); }
protected void RadioButton11_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 30
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,mauvais,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 2)";
db.insert(query); }
protected void RadioButton12_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,nonreponse,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 0)";
db.insert(query); }
protected void RadioButton13_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,excellent,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 10)";
db.insert(query); }
protected void RadioButton14_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,tresbien,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 8)";
db.insert(query); }
protected void RadioButton15_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,bien,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 6)";
db.insert(query); }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 31
protected void RadioButton16_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,moyen,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 4)";
db.insert(query); }
protected void RadioButton17_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,mauvais,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 2)";
db.insert(query); }
protected void RadioButton18_CheckedChanged(object sender, EventArgs e) {
Database db = new Database("Enquete.mdb"); user u = (user)Session["user"];
string conID = Session["conid"].ToString(); string query = "insert into resultat
(criId,nonreponse,userid,etapeID,conID, Notes) values('" +
lblCrit2Id.Text.ToString() + "',1," + u.userid + ",'" + etapeID + "', '" + conID + "', 0)";
db.insert(query); }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 32
E
tape voting :
Cette page est une page de séparation entre la page du vote et celle du résultat dans
laquelle un message se présente pour informer lâutilisateur quâil attende le vote des
autre utilisateurs afin de pouvoir afficher le résultat final et un link vers la page
concurrent pour pouvoir voter aux autres concurrentes. Suite au vote de tous les
users pour toutes les concurrentes, un bouton résultat initialement invisible apparait
menant a la page des résultats.
Etapevoting.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 33
public partial class erreurlogin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) {
user u = (user)Session["user"];
Database db = new Database("Enquete.mdb");
DataSet ds1 = db.select("SELECT * FROM Resultat");
DataSet ds2 = db.select("SELECT * FROM Resultat WHERE etapeID ='3- Mesure et poids'");
DataSet ds3 = db.select("SELECT * FROM Resultat WHERE etapeID ='4 -Questions generales'"); DataTable dt1 = ds1.Tables[0]; DataTable dt2 = ds3.Tables[0]; DataTable dt3 = ds3.Tables[0]; if (dt1.Rows.Count < 30) { Button1.Visible = false; Label1.Visible = true; }
else if ((dt1.Rows.Count > 30) && (dt1.Rows.Count < 51)) {
Button1.Visible = false; Label1.Visible = true;
}
else if ((dt3.Rows.Count > 51) && (dt1.Rows.Count < 66)) { Button1.Visible = false; Label1.Visible = true; } else { Button1.Visible = true; Label1.Visible = false; } }
protected void Button1_Click(object sender, EventArgs e) {
Response.Redirect("resultat.aspx");
}
protected void LinkButton1_Click(object sender, EventArgs e) {
} }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 34
Etapevoting.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="etapevoting.aspx.cs" Inherits="erreurlogin" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="tick_head">Voting:<span
class="tick_head1">Results</span></div><br /><br /><br />
<asp:Label ID="Label1" runat="server" Height="50px" Text="Your vote has been casted, please wait while the other juries give their vote"
Width="514px">
</asp:Label>
<br /><br /><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Results!" />
<br /><br /><a href="concurrent.aspx">Click here</a> at any time to see the contestants.
</asp:Content>
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 35
Cette page représente un grid view dans lequel sont affichées les sept filles
restantes dans ce concours. En cliquant sur select on aboutit a la page miss qui
nous permet dâaboutir de nouveau a la page du vote mais cette fois pour lâétape 2.
Et ainsi de suite jusqu'à lâannonce des trois premières gagnantes du concours.
Resultat.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="resultat.aspx.cs" Inherits="resultat" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:GridView ID="GridView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" AutoGenerateSelectButton="True"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="500px" AllowSorting="True" Height="212px" >
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" /> </asp:GridView> </asp:Content>
Resultat.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections; using System.Web.UI.MobileControls; using System.Collections.Generic;public partial class resultat : System.Web.UI.Page
{
DataTable dt5 = new DataTable();
protected void Page_Load(object sender, EventArgs e) {
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 36
Database db = new Database("Enquete.mdb"); string query = "Select * from Concurrent"; DataSet ds = db.select(query);
DataTable dt = ds.Tables[0];
string queryEtape = "Select DISTINCT(etapeID) from Resultat"; DataSet dsEtape = db.select(queryEtape);
DataTable dtEtape = dsEtape.Tables[0]; ArrayList arOne = new ArrayList();
List<ArrayList> listAll = new List<ArrayList>(); string etapIDForResult = "";
if (dtEtape.Rows.Count > 0) {
etapIDForResult = dtEtape.Rows[0][0].ToString(); for (int i = 0; i < dtEtape.Rows.Count; i++) { if (dtEtape.Rows[i][0].ToString().CompareTo(etapIDForResult) == 1) etapIDForResult = dtEtape.Rows[i][0].ToString(); } if (etapIDForResult == "2 -Beaute")
Session["etapeID"] = "3- Mesure et poids"; else if (etapIDForResult == "3- Mesure et poids") Session["etapeID"] = "4 -Questions generales"; for (int i = 0; i < dt.Rows.Count; i++)
{
int finalnote = getConNoteByID(dt.Rows[i][0].ToString(), etapIDForResult);
ArrayList listOne = new ArrayList(); listOne.Add(finalnote.ToString()); listOne.Add(dt.Rows[i][0].ToString()); listAll.Add(listOne);
} }
List<ArrayList> listAllSorted = listAll; for (int i = 0; i < listAll.Count; i++) {
for (int j = i + 1; j < listAll.Count; j++) {
if (Convert.ToInt32(listAll[j][0]) >
Convert.ToInt32(listAllSorted[i][0])) {
ArrayList tempList = listAllSorted[i]; listAllSorted[i] = listAll[j];
listAllSorted[j] = tempList; }
} }
string qFinal = "Select conid, nom, prenom, lieu_naiss, date_naiss from Concurrent where ";
if (Convert.ToInt32(etapIDForResult.Substring(0, 1).ToString()) == 2) {
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 37
for (int i = 0; i < listAllSorted.Count - 3; i++) {
if (i == 0) {
qFinal = qFinal + "conid = '" + listAllSorted[i][1].ToString() + "' ";
} else
{
qFinal = qFinal + "or conid = '" + listAllSorted[i][1].ToString() + "' ";
} } }
else if (Convert.ToInt32(etapIDForResult.Substring(0, 1).ToString()) == 3)
{
for (int i = 0; i < listAllSorted.Count - 5; i++) {
if (i == 0) {
qFinal = qFinal + "conid = '" + listAllSorted[i][1].ToString() + "' ";
} else
{
qFinal = qFinal + "or conid = '" + listAllSorted[i][1].ToString() + "' ";
} } }
else if (Convert.ToInt32(etapIDForResult.Substring(0, 1).ToString()) == 4)
{
for (int i = 0; i < listAllSorted.Count - 7; i++) {
if (i == 0) {
qFinal = qFinal + "conid = '" + listAllSorted[i][1].ToString() + "' ";
} else
{
qFinal = qFinal + "or conid = '" + listAllSorted[i][1].ToString() + "' "; } } } DataSet dss = db.select(qFinal); DataTable dtt = dss.Tables[0]; int aaa = dtt.Rows.Count; GridView1.DataSource = dtt; GridView1.DataBind();
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 38
GridView1.Visible = true;
if (Convert.ToInt32(etapIDForResult.Substring(0, 1).ToString()) == 4) {
string qMiss = "Select conid, nom, prenom, lieu_naiss, date_naiss from Concurrent where conid ='" + listAllSorted[0][1].ToString() + "'"; DataSet dsMiss = db.select(qFinal);
DataTable dtMiss = dsMiss.Tables[0];
string missName = dt.Rows[0][2].ToString();
} }
private int getConNoteByID(string conId, string etapeID) {
Database db = new Database("Enquete.mdb");
string q = "Select Notes from Resultat where conId = '" + conId + "' and etapeID = '" + etapeID + "'";
DataSet ds = db.select(q); DataTable dt = ds.Tables[0]; int finalNote = 0;
if (dt.Rows.Count > 0) {
for (int i = 0; i < dt.Rows.Count; i++) {
finalNote = finalNote +
Convert.ToInt32(dt.Rows[i][0].ToString()); }
finalNote = finalNote / dt.Rows.Count; }
return finalNote; }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) {
Session["conid"] = GridView1.SelectedRow.Cells[1].Text;
Response.Redirect("miss.aspx?conid" + Session["conid"].ToString()); }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 39
About us :
Aboutus.aspx:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Aboutus.aspx.cs" Inherits="Aboutus" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="tick_head">Welcome to <span class="tick_head1">"Miss Lebanon on line"</span> competition!</div>
<p dir="ltr"><font face="Arial" color ="#3b3b3b" size="3">
For over 30 years, Miss Lebanon Committee has been devoted to bringing you everything that you need in relation to the world of Beauty Pageants.<br /> Lebanon has won many International Beauty Titles in the past. To name but a few, Miss Universe in 1972, Ms Globe in 2000, Miss International in 2002, Miss Model of the World in 2005, Mr. Teen of The World in 2005, Mr.
International in 2006â¦.<br />
Miss Lebanon is the only national beauty contest that awards big prizes worth over half a million US dollars to its winners. <br />
We Strictly DENY any relation to other fake websites pretending to represent any beauty contests taking place in Lebanon such as Miss Lebanon, Miss
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 40
Surf our site, choose the section of your interest, submit your application and let your journey in the world of fame and beauty begins!
To know more about us, you can contact us at any time you want just <asp:LinkButton ID="LinkButton1" runat="server"
OnClick="LinkButton1_Click">click here</asp:LinkButton>!<br /> </font></p></asp:Content>
Aboutus.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;public partial class Aboutus : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) {
}
protected void LinkButton1_Click(object sender, EventArgs e) {
Response.Redirect("Contactus.aspx"); }
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 41
Beautytip.aspx:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Beautytip.aspx.cs" Inherits="Beautytip" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<br />
<br />
<br />
<asp:LinkButton ID="LinkButton1" runat="server"
OnClick="LinkButton1_Click" Font-Bold="True" Font-Size="Large">Body care</asp:LinkButton> ||
<asp:LinkButton ID="LinkButton2" runat="server"
OnClick="LinkButton2_Click" Font-Bold="True" Font-Size="Large">Eye care</asp:LinkButton> ||
<asp:LinkButton ID="LinkButton3" runat="server"
OnClick="LinkButton3_Click" Font-Bold="True" Font-Size="Large">Lip care</asp:LinkButton><br />
<asp:Panel ID="Panel1" runat="server" Visible="False" Width="691px">
<br /><br />
<div class="tick_head">Body care<br /><br /><br />
</div>
<br /><br /><br /><br />
-Mix six-teaspoon petroleum jelly, two-teaspoon glycerin and two-teaspoon lemon juice.<br />
Copyright © 2010-2011,
eliematta.com
. All rights reserved
Page 42
Apply this moisturizing lotion at least twice a week if you have dry and flaky,
arms and legs<br />
-Peel and grate a cucumber. Squeeze the juice to this, mix half-a-teaspoon glycerin and half-a-teaspoon rose water.<br />
Apply this on sunburns, leave it for some time.<br />
-If you have cracked heels, melt paraffin wax; mix it with little mustard oil and
apply on the affected area. Leave it overnight.<br />
After 10 or 15 days, your heels will become smooth.
-Massage your body with a mixture of coconut oil and any of your favourite scented oils like lavender or rosemary. <br />
-For rough palms, use a mixture of glycerin and limejuice in equal proportion.<br />
-For cracked heals, massage the foot with coconut oil and keep the foot in warm water for some time. Wipe the water off the feet and apply a mixture of hibiscus flower(10), Henna (1 handful) and juice of half a lemon. when dry wash it off.<br />
-Remove scars on your hands and feet by rubbing them with lemon peel.<br />
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" Visible="False" Width="690px">
<br /><br />
<div class="tick_head"> Eye care<br /><br />
</div>
<br /><br /><br /><br />
-Dip wads of cotton in a chilled mixture of cucumber and potato juice. Keep this on your eyelids for 15 to 20 minutes and gently wash it off. Apply a little baby oil.
-For long eyelashes .., apply a thin coat of castor oil every night. It strengthens lashes and cools your eyes.<br />
-Massage a few drops of coconut oil around the eyes to get rid off dark circles. <br />
-To reduce puffiness of your eyes, grate a potato; tie in a cloth and place the cloth over your eyes for about 15 minutes.<br />
-Add a small pinch of salt in water and wash for bright and sparkling eyes.<br />
-Mix tomato juice and lemon juice in equal quantity and apply around the eyes. After 30 minutes wash it off with cold and hot water alternatively.<br />
-Make a paste of sandal wood and nutmeg. Apply the paste around the eyes before sleeping and wash it off in the morning.<br />
-Crush a cucumber and take the juice. Add a little rose water and apply around the eyes and wash it after 30 minutes.<br />
-Place cotton wool swabs dipped in cold milk on closed eyes for removing dark circles. <br />
</asp:Panel>
<asp:Panel ID="Panel3" runat="server" Visible="False" Width="690px">
<br /><br />
<div class="tick_head"> Lip Care <br /><br /><br />
</div>