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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
| using System;
using System.Data;
using System.Collections;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//trouver le nom de l'utilisateur
String TestLogin = System.Web.HttpContext.Current.User.Identity.Name.ToString();
Response.Write(TestLogin);
}
protected void nomprofDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void okButton_Click(object sender, EventArgs e)
{
resultatLabel.Text = "Emploi du temps de " + nomprofDropDownList.Text + " pour la classe des " + classeDropDownList.Text + " en " + matiereDropDownList.Text;
calendrier.Visible = true;
//nomprofDropDownList.Visible = false;
//classeDropDownList.Visible = false;
//matiereDropDownList.Visible = false;
//nbsemaineTextBox.Visible = false;
//nbheureTextBox.Visible = false;
nbheureTextBox.Enabled = false;
nbsemaineTextBox.Enabled = false;
matiereDropDownList.Enabled = false;
classeDropDownList.Enabled = false;
nomprofDropDownList.Enabled = false;
}
protected void calendrier_SelectionChanged(object sender, EventArgs e)
{
dateLabel.Text = "Semaine du " + calendrier.SelectedDate.ToLongDateString();
}
protected void nbheureTextBox_TextChanged(object sender, EventArgs e)
//Affichage des TextBox
{
ArrayList liste_nom = new ArrayList();
for (int i = 0; i <= Convert.ToInt64(nbheureTextBox.Text) - 1; i++) //initialise le tableau des noms des textbox réclamées
{
liste_nom.Add("text_box_child" + i);
}
for (int j = 0; j <= liste_nom.Count - 1; j++)
{
TextBox modele = new TextBox();
//modele.Attributes.Add("onclick", "this.value = '';");
//modele.Attributes.Add("onchange", "this.disabled = true;");
modele.ID = liste_nom[j].ToString();
modele.Text = "Heure n° " + Convert.ToInt64(j + 1);
modele.Width = 500;
modele.Height = 30;
modele.AutoPostBack = true ;
//modele.Name = String.Format("txbHeure{0}", j++);
form1.Controls.Add(modele);
}
}
protected void nonRadioButton_CheckedChanged(object sender, EventArgs e)
{
if
(nonRadioButton.Checked = true)
{
refLabel.Visible = false;
refDropDownList.Visible = false;
refnewLabel.Visible = true;
refnewTextBox.Visible = true;
}
}
protected void ouiRadioButton_CheckedChanged(object sender, EventArgs e)
{
if
(ouiRadioButton.Checked = true)
{
refLabel.Visible = true;
refDropDownList.Visible = true;
refnewLabel.Visible = false;
refnewTextBox.Visible = false;
}
}
} |