protected void gv_Commande_SelectedIndexChanged(object sender, EventArgs e) { AstreeDonnees a = new AstreeDonnees(); GridViewRow row = gv_Commande.SelectedRow; produitDB prod = a.GetProduit().Where(w => w.LibelleProduit.Trim() == row.Cells[3].Text.ToString().Trim()).FirstOrDefault(); Txtcode.Text = row.Cells[2].Text; TxtQte.Text = row.Cells[4].Text; ddlProduit.SelectedValue = prod.IdProduit.ToString();//; //Session["CodeServ"] //MessageLabel.Text = "You selected Devis numéro " + row.Cells[1].Text + "."; BtnEnvoyer.Visible = false; notificationDB notif = a.GetNotification().Where(w => w.codeService == Convert.ToInt16(row.Cells[1].Text)).FirstOrDefault(); if (notif != null) { notif.etatNotif = "L"; a.maj_notification(notif); row.ForeColor = System.Drawing.Color.Black; Label x = (Label)Master.FindControl("lblNotifCommandeInter") as Label; List <serviceDB> lsNotification = a.GetServices().Where(w => (w.libelleService != null) && (w.etatNotif.Trim() == "N") && (w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"]))).ToList(); x.Text = lsNotification.Where(w => w.libelleService.Trim() == "Commande").Count().ToString(); Label nbNotification = (Label)Master.FindControl("nbNotification") as Label; nbNotification.Text = lsNotification.Count().ToString(); //Response.Redirect(HttpContext.Current.Request.Url.ToString(), true); } }