protected void Navigation_Click(object sender, EventArgs e) { int page_index = 0; Button b = sender as Button; DS.groupeDataTable grp = new groupeTableAdapter().GetData(); switch (b.CommandName) { case "Fin": ViewState["PageIndex"] = 0; this.ChargerGroupe(grp.First()); break; case "Suivant": page_index = (int)ViewState["PageIndex"]; page_index = Math.Min(grp.Count - 1, ++page_index); ViewState["PageIndex"] = page_index; this.ChargerGroupe((DS.groupeRow)grp.Rows[page_index]); break; case "Precedent": page_index = (int)ViewState["PageIndex"]; page_index = Math.Max(0, --page_index); ViewState["PageIndex"] = page_index; this.ChargerGroupe((DS.groupeRow)grp.Rows[page_index]); break; case "Debut": ViewState["PageIndex"] = grp.Count - 1; this.ChargerGroupe(grp.Last()); break; } }
protected void Butenreg_Click(object sender, EventArgs e) { groupeTableAdapter q = new groupeTableAdapter(); q.Insert(TextNom.Text, DateTime.Now, DateTime.Now); actualiser(); }
public void modifier(string nom, int id) { DS.groupeRow s = new groupeTableAdapter().GetData().FindByidg(id); s.nomg = nom; s.datecreation = DateTime.Now; s.datemodification = DateTime.Now; new groupeTableAdapter().Update(s); }
protected void Butmodi_Click(object sender, EventArgs e) { // NB : int.Parse(ViewState["idg"].ToString()) = LabelId.Text DS.groupeRow g = new groupeTableAdapter().GetData().FindByidg(Convert.ToInt32(LabelId.Text)); g.nomg = TextNom.Text; g.datecreation = DateTime.Now; g.datemodification = DateTime.Now; new groupeTableAdapter().Update(g); this.actualiser(); }
protected void Butsup_Click(object sender, EventArgs e) { if (LabelId.Text != null) { DS.groupeRow s = new groupeTableAdapter().GetData().FindByidg(Convert.ToInt32(LabelId.Text)); s.Delete(); new groupeTableAdapter().Update(s); this.actualiser(); } else { Response.Write("<script> alert(aucune stagiaire selectionnée )</script>"); } }
public void supprimer(int id) { DS.groupeRow s = new groupeTableAdapter().GetData().FindByidg(id); s.Delete(); new groupeTableAdapter().Update(s); }
public void ajouter(string nom) { groupeTableAdapter a = new groupeTableAdapter(); a.Insert(nom, DateTime.Now, DateTime.Now); }
public string HelloWorld() { int idg = new groupeTableAdapter().GetData().Count(); return("le nombre de groupes est : " + idg); }