public void InsertProfil(profilDB profl) { using (DataAccesDataContext dbContext = new DataAccesDataContext()) { profil profil = new profil { code_profil = profl.code, description_profil = profl.libelle }; dbContext.profil.InsertOnSubmit(profil); dbContext.SubmitChanges(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["code_utilisateur"] == null) { Response.Redirect("login.aspx"); } if (!this.IsPostBack) { this.BindGrid(); AstreeDonnees a = new AstreeDonnees(); UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString())); profilDB P = a.Getprofil(Convert.ToInt32(user.code_profil)); // if (Session["code_profil"].Equals("505")) if (user.code_profil == 505) { Btnreponse.Visible = true; } } }
public profilDB Getprofil(int code) { try { DataAccesDataContext dbContext = new DataAccesDataContext(); profilDB ls = new profilDB(); var pm = (from c in dbContext.profil join D in dbContext.Utilisateur on c.code_profil equals D.code_profil where D.code_profil == code select new profilDB { code = c.code_profil, libelle = c.description_profil }); return(pm.ToList().FirstOrDefault()); } catch (Exception ex) { string msg = ex.Message; return(null); } }
protected void gvSouscription_SelectedIndexChanged(object sender, EventArgs e) { pnlDerogation.Visible = true; AstreeDonnees a = new AstreeDonnees(); Txtetat.Text = ""; GridViewRow row = gvSouscription.SelectedRow; txtId.Text = row.Cells[1].Text; txttype.Text = row.Cells[2].Text; txtproduit.Text = row.Cells[3].Text; txtsousproduit.Text = row.Cells[4].Text; // txtdatedemande.Text = row.Cells[5].Text; //txtnumcontrat.Text = row.Cells[6].Text; serviceDB serv = a.GetServices().Where(w => w.code_service == Convert.ToInt16(row.Cells[1].Text)).FirstOrDefault(); CheckBox cb = (CheckBox)row.FindControl("AccepterSouscription"); if (cb != null && cb.Checked) { Txtetat.Text = "VALIDEE"; if (serv.etat.Trim() == "V") { Btnreponse.Visible = false; } cb.Enabled = false; notificationDB notif = a.GetNotification().Where(w => w.codeService == Convert.ToInt16(txtId.Text)).FirstOrDefault(); if (notif != null) { if (notif.etatNotif == "N") { UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString())); if (user.code_profil == 101 || user.code_profil == 202) { notif.etatNotif = "L"; a.maj_notification(notif); row.ForeColor = System.Drawing.Color.Black; // Response.Redirect(HttpContext.Current.Request.Url.ToString(), true); Label x = (Label)Master.FindControl("lblNotifSouscription") 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() == "Derogation" && w.idType == 3).Count().ToString(); Label nbNotification = (Label)Master.FindControl("nbNotification") as Label; nbNotification.Text = lsNotification.Count().ToString(); } } } } else { UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString())); profilDB P = a.Getprofil(Convert.ToInt32(user.code_profil)); // if (Session["code_profil"].Equals("505")) if (user.code_profil == 606) { Btnreponse.Visible = true; } cb.Enabled = true; } }
private void BindGrid() { AstreeDonnees a = new AstreeDonnees(); UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString())); List <serviceDB> ls = new List <serviceDB>(); List <serviceDB> lss = new List <serviceDB>(); List <serviceDB> lsss = new List <serviceDB>(); //Gestionnaire if (user.code_profil != 101 && user.code_profil != 202) { ls = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Remise")).OrderBy(w => w.etat).ToList(); lss = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Prorogation")).OrderBy(w => w.etat).ToList(); lsss = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Souscription")).OrderBy(w => w.etat).ToList(); } //Agent et courtier else { ls = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Remise") && (w.codeUtilisateur == user.code_utilisateur)).OrderByDescending(w => w.etatNotif).ToList(); lss = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Prorogation") && (w.codeUtilisateur == user.code_utilisateur)).OrderByDescending(w => w.etatNotif).ToList(); lsss = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Souscription") && (w.codeUtilisateur == user.code_utilisateur)).OrderByDescending(w => w.etatNotif).ToList(); } List <serviceDB> lsServ = new List <serviceDB>(); List <notificationDB> lstNotif = a.GetNotification(); Session["lstremise"] = ls; gvRemise.DataSource = ls; gvRemise.DataBind(); profilDB P = a.Getprofil(Convert.ToInt32(user.code_profil)); //if (P.code== 606) //{ // lss = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "prorogation") ).ToList(); // Session["lstproro"] = lss; // gvProrogation.DataSource = lss; // gvProrogation.DataBind(); //} //else //{ // lss = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "prorogation") && (w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"]))).ToList(); // Session["lstproro"] = lss; // gvProrogation.DataSource = lss; // gvProrogation.DataBind(); //} Session["lstproro"] = lss; gvProrogation.DataSource = lss; gvProrogation.DataBind(); Session["lstsouscrip"] = lsss; gvSouscription.DataSource = lsss; gvSouscription.DataBind(); foreach (GridViewRow row in gvRemise.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox cb = (row.Cells[0].FindControl("Accepter") as CheckBox); serviceDB serv = ls.Where(w => w.code_service == Convert.ToInt16(row.Cells[1].Text.ToString().Trim())).FirstOrDefault(); if (serv != null) { if (serv.etat.ToString().Trim() == "A") { //Gestionnaire if (user.code_profil != 101 && user.code_profil != 202) { row.ForeColor = System.Drawing.Color.Red; } //Agent ou Courtier else { row.ForeColor = System.Drawing.Color.Black; } } if (serv.etat.ToString().Trim() == "V") { cb.Checked = true; //Gestionnaire if (user.code_profil != 101 && user.code_profil != 202) { row.ForeColor = System.Drawing.Color.Black; } //Agent ou Courtier else { if (serv.etatNotif.ToString().Trim() == "N") { row.ForeColor = System.Drawing.Color.Green; } if (serv.etatNotif.ToString().Trim() == "L") { row.ForeColor = System.Drawing.Color.Black; } } } } } } foreach (GridViewRow row in gvProrogation.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox cb = (row.Cells[0].FindControl("AccepterProrogation") as CheckBox); serviceDB serv = lss.Where(w => w.code_service == Convert.ToInt16(row.Cells[1].Text.ToString().Trim())).FirstOrDefault(); if (serv != null) { if (serv.etat.ToString().Trim() == "A") { //Gestionnaire if (user.code_profil != 101 && user.code_profil != 202) { row.ForeColor = System.Drawing.Color.Red; } //Agent ou Courtier else { row.ForeColor = System.Drawing.Color.Black; } } if (serv.etat.ToString().Trim() == "V") { cb.Checked = true; //Gestionnaire if (user.code_profil != 101 && user.code_profil != 202) { row.ForeColor = System.Drawing.Color.Black; } //Agent ou Courtier else { if (serv.etatNotif.ToString().Trim() == "N") { row.ForeColor = System.Drawing.Color.Green; } if (serv.etatNotif.ToString().Trim() == "L") { row.ForeColor = System.Drawing.Color.Black; } } } } } } foreach (GridViewRow row in gvSouscription.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox cb = (row.Cells[0].FindControl("AccepterSouscription") as CheckBox); serviceDB serv = lsss.Where(w => w.code_service == Convert.ToInt16(row.Cells[1].Text.ToString().Trim())).FirstOrDefault(); if (serv != null) { if (serv.etat.ToString().Trim() == "A") { //Gestionnaire if (user.code_profil != 101 && user.code_profil != 202) { row.ForeColor = System.Drawing.Color.Red; } //Agent ou Courtier else { row.ForeColor = System.Drawing.Color.Black; } } if (serv.etat.ToString().Trim() == "V") { cb.Checked = true; //Gestionnaire if (user.code_profil != 101 && user.code_profil != 202) { row.ForeColor = System.Drawing.Color.Black; } //Agent ou Courtier else { if (serv.etatNotif.ToString().Trim() == "N") { row.ForeColor = System.Drawing.Color.Green; } if (serv.etatNotif.ToString().Trim() == "L") { row.ForeColor = System.Drawing.Color.Black; } } } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["code_utilisateur"] == null) { Response.Redirect("login.aspx"); } //ddltype.SelectedIndex = -1; if (!this.IsPostBack) { pnlDerogation.Visible = false; AstreeDonnees a = new AstreeDonnees(); ddltype.DataSource = a.GetTypeService().Where(w => w.famille_type.Trim() == "Derogation").ToList(); ddltype.DataBind(); if (Session["remise"] == null) { } else { if (Session["remise"].ToString() == "0") { ddltype.SelectedIndex = 0; pnlTaux.Visible = true; pnlDuree.Visible = false; gvRemise.Visible = true; gvSouscription.Visible = false; gvProrogation.Visible = false; } } if (Session["prorogation"] == null) { } else { if (Session["prorogation"].ToString() == "1") { ddltype.SelectedIndex = 1; pnlTaux.Visible = false; pnlDuree.Visible = true; gvRemise.Visible = false; gvSouscription.Visible = false; gvProrogation.Visible = true; } } if (Session["souscription"] == null) { } else { if (Session["souscription"].ToString() == "2") { ddltype.SelectedIndex = 2; pnlTaux.Visible = false; pnlDuree.Visible = false; gvRemise.Visible = false; gvSouscription.Visible = true; gvProrogation.Visible = false; } } UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString())); profilDB P = a.Getprofil(Convert.ToInt32(user.code_profil)); // if (Session["code_profil"].Equals("505")) if (user.code_profil == 606) { Btnreponse.Visible = true; } this.BindGrid(); if (ddltype.SelectedIndex == 0) { pnlTaux.Visible = true; pnlDuree.Visible = false; gvRemise.Visible = true; gvSouscription.Visible = false; gvProrogation.Visible = false; } if (ddltype.SelectedIndex == 1) { pnlTaux.Visible = false; pnlDuree.Visible = true; gvRemise.Visible = false; gvSouscription.Visible = false; gvProrogation.Visible = true; } if (ddltype.SelectedIndex == 2) { pnlTaux.Visible = false; pnlDuree.Visible = false; gvRemise.Visible = false; gvSouscription.Visible = true; gvProrogation.Visible = false; } } }
protected void BtnAjoutProfil_Click(object sender, EventArgs e) { // MsgCode.Text = ""; MsgProfil.Text = ""; bool validCode = false; bool validLibelle = false; if (String.IsNullOrEmpty((txtcode.Text))) { MsgCode.Text = "veuillez remplir votre code"; } else if (String.IsNullOrEmpty(txtlibelle.Text)) { MsgCode.Text = ""; MsgProfil.Text = "veuillez remplir votre libelle"; } else { lblMessage1.Visible = false; AstreeDonnees a = new AstreeDonnees(); List <profilDB> lstprofil = a.GetProfil(); try { if (lstprofil.Where(w => w.code == Convert.ToInt16(txtcode.Text.ToString())).Count() > 0) { lblMessage1.Visible = true; lblMessage1.Text = "code existant!"; } else { MsgCode.Text = ""; MsgProfil.Text = ""; lblMessage1.Visible = false; validCode = true; } if (lstprofil.Where(w => w.libelle == txtlibelle.Text).Count() > 0) { lblMessage1.Visible = true; lblMessage1.Text = "Libelle existant"; } else { if (validCode) { lblMessage1.Visible = false; validLibelle = true; } } } catch { MsgCode.Text = "Le code doit étre un entier!"; } } if ((validCode) && (validLibelle)) { AstreeDonnees ad = new AstreeDonnees(); profilDB profl = new profilDB(); try { profl.code = Convert.ToInt16(txtcode.Text.ToString()); profl.libelle = txtlibelle.Text; ad.InsertProfil(profl); lblMessage1.Visible = true; lblMessage1.Text = "Ajout fait avec succés!"; // PnlAffecter.Visible = true; } catch { MsgCode.Text = "Le code doit étre un entier!!"; } // insert affec DataBind(); BindGrid(); } }
protected void Page_Load(object sender, EventArgs e) { //li //li AstreeDonnees a = new AstreeDonnees(); List <serviceDB> lsNotification1 = a.GetServices().Where(w => (w.libelleService != null) && (w.etatNotif.Trim() == "N") && (w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"]))).ToList(); liCommandeInter.Visible = false; liCommande.Visible = false; liCommandeFournisseur.Visible = false; accueil.Visible = false; Commande.Visible = false; EnvoiCommande.Visible = false; liCommandeRepondreInter.Visible = false; liCommandeFour.Visible = false; liCommandeRepondreFour.Visible = false; liCommandeConsultInter.Visible = false; liHistorique.Visible = false; liCommandeConsultFour.Visible = false; liDerogation.Visible = false; liEnvoiDero.Visible = false; liafficherDeroInter.Visible = false; liConsulterDero.Visible = false; liafficherDeroGest.Visible = false; Devis.Visible = false; liDemanderDevis.Visible = false; liafficherDevisInter.Visible = false; liTraiterDevis.Visible = false; liaffixherDevisGest.Visible = false; liReclamation.Visible = false; liEnvoyerReclamation.Visible = false; liaffiherReclamation.Visible = false; liConsulterStatistiques.Visible = false; liGestUser.Visible = false; liGestProfil.Visible = false; liGestPermission.Visible = false; //Notification liDevis.Visible = false; //liRepIndermidiaire.Visible = false; liRemise.Visible = false; liProrogatin.Visible = false; liSouscripton.Visible = false; liCommande.Visible = false; liCompteDesactive.Visible = false; liCommandeInter.Visible = false; liCommandeFournisseur.Visible = false; liCommandeInterFourn.Visible = false; liAfficheReclamation.Visible = false; // yjini erreur ! if (Session["code_utilisateur"] == null) { Response.Redirect("login.aspx"); } UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString())); profilDB P = a.Getprofil(Convert.ToInt32(user.code_profil)); TxtUserProfil.Text = user.Nom_utilisateur; TxtTitre.Text = P.libelle; // if (Session["code_profil"].Equals("101")) //Agent if (user.code_profil == 101) { //Li liConsulterStatistiques.Visible = true; Commande.Visible = true; EnvoiCommande.Visible = true; liCommandeConsultInter.Visible = false; liDerogation.Visible = true; liEnvoiDero.Visible = true; liafficherDeroInter.Visible = false; liReclamation.Visible = true; liEnvoyerReclamation.Visible = true; liDevis.Visible = false; liRemise.Visible = true; liProrogatin.Visible = true; liSouscripton.Visible = true; liConsulterStatistiques.Visible = true; liAfficheReclamation.Visible = true; liCommandeInter.Visible = true; // List<notificationDB> lsNotification = a.GetNotification().Where(w => w.etatNotif == "N" && w.codeUtilisateur== Convert.ToInt16(Session["code_utilisateur"])).ToList(); List <serviceDB> lsNotification = a.GetServices().Where(w => (w.libelleService != null) && (w.etatNotif.Trim() == "N") && (w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"]))).ToList(); //int nb = lsNotification.Count(); //if (nb>0) { nbNotification.Visible = true; } lblNotifRemise.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 1).Count().ToString(); lblNotifProrogation.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 2).Count().ToString(); lblNotifSouscription.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 3).Count().ToString(); lblDevis.Text = lsNotification.Where(w => w.libelleService.Trim() == "Devis").Count().ToString(); lblNotifCommandeInter.Text = lsNotification.Where(w => w.libelleService.Trim() == "Commande" && w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"])).Count().ToString(); List <serviceDB> lstNotifReclamation = a.GetServices().Where(w => w.libelleService.Trim() == "Reclamation" && w.etatNotif.Trim() == "N" && w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"])).ToList(); lblNotifReclamation.Text = lstNotifReclamation.Count().ToString(); nbNotification.Text = (Convert.ToInt16(lblDevis.Text) + Convert.ToInt16(lblNotifRemise.Text) + Convert.ToInt16(lblNotifProrogation.Text) + Convert.ToInt16(lblNotifReclamation.Text) + Convert.ToInt16(lblNotifCommandeInter.Text) + Convert.ToInt16(lblNotifSouscription.Text)).ToString(); } //Courtier else if (user.code_profil == 202) { //LI Commande.Visible = true; EnvoiCommande.Visible = true; liCommandeConsultInter.Visible = false; liDerogation.Visible = true; liEnvoiDero.Visible = true; liafficherDeroInter.Visible = false; Devis.Visible = true; liDemanderDevis.Visible = true; liafficherDevisInter.Visible = false; liReclamation.Visible = true; liEnvoyerReclamation.Visible = true; // notification liCommandeInter.Visible = true; liDevis.Visible = true; liRemise.Visible = true; liProrogatin.Visible = true; liSouscripton.Visible = true; liConsulterStatistiques.Visible = false; liAfficheReclamation.Visible = true; nbNotification.Visible = true; // List<notificationDB> lsNotification = a.GetNotification().Where(w => w.etatNotif == "N" && w.codeUtilisateur== Convert.ToInt16(Session["code_utilisateur"])).ToList(); List <serviceDB> lsNotification = a.GetServices().Where(w => (w.libelleService != null) && (w.etatNotif.Trim() == "N") && (w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"]))).ToList(); //nbNotification.Text = lsNotification.Count().ToString(); int nb = lsNotification.Count(); if (nb <= 0) { nbNotification.Visible = false; } lblNotifRemise.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 1).Count().ToString(); lblNotifProrogation.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 2).Count().ToString(); lblNotifSouscription.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 3).Count().ToString(); lblDevis.Text = lsNotification.Where(w => w.libelleService.Trim() == "Devis").Count().ToString(); lblNotifCommandeInter.Text = lsNotification.Where(w => w.libelleService.Trim() == "Commande").Count().ToString(); List <serviceDB> lstNotifReclamation = a.GetServices().Where(w => w.libelleService.Trim() == "Reclamation" && w.etatNotif.Trim() == "N" && w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"])).ToList(); lblNotifReclamation.Text = lstNotifReclamation.Count().ToString(); nbNotification.Text = (Convert.ToInt16(lblDevis.Text) + Convert.ToInt16(lblNotifRemise.Text) + Convert.ToInt16(lblNotifProrogation.Text) + Convert.ToInt16(lblNotifReclamation.Text) + Convert.ToInt16(lblNotifCommandeInter.Text) + Convert.ToInt16(lblNotifSouscription.Text)).ToString(); } //Fournisseur else if (user.code_profil == 303) { Commande.Visible = true; liCommandeRepondreFour.Visible = true; liCommandeConsultFour.Visible = false; //notification liCommandeFournisseur.Visible = true; liCommandeFournisseur.Visible = true; List <serviceDB> lsNotification = a.GetServices().Where(w => (w.libelleService != null) && (w.codeDest == Convert.ToInt16(Session["code_utilisateur"]))).ToList(); lsNotification = lsNotification.Where(w => w.etat.Trim() == "A").ToList(); lblNotifCommandeFourn.Text = lsNotification.Where(w => w.libelleService.Trim() == "Commande").Count().ToString(); nbNotification.Text = lsNotification.Count().ToString(); } //Gestionnaire Commande else if (user.code_profil == 404) { //Li Commande.Visible = true; liHistorique.Visible = true; liCommandeFour.Visible = true; liCommandeRepondreInter.Visible = true; liReclamation.Visible = true; liaffiherReclamation.Visible = true; //notification liCommandeInterFourn.Visible = true; liCommandeInter.Visible = false; liCommande.Visible = true; liAfficheReclamation.Visible = true; // List<notificationDB> lsNotification = a.GetNotification().Where(w => w.etatNotif == "N" && w.codeUtilisateur== Convert.ToInt16(Session["code_utilisateur"])).ToList(); List <serviceDB> lsNotification = a.GetServices().Where(w => (w.libelleService != null) && (w.etat.Trim() == "A") && w.codeDest == 404).ToList(); lblNotifCommande.Text = lsNotification.Where(w => w.libelleService.Trim() == "Commande" && w.etat.Trim() == "A" && w.codeDest == 404).Count().ToString(); List <serviceDB> lsNotificationFourn = a.GetServices().Where(w => (w.libelleService != null) && (w.etat.Trim() == "V") && w.etatNotif.Trim() != "L" && w.codeDest != 404 && w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"])).ToList(); lblNotifCommandeInterFourn.Text = lsNotificationFourn.Count().ToString(); //lblNotifCommandeInterFourn.Text = lsNotificationFourn.Where(w => w.libelleService.Trim() == "Commande").Count().ToString(); List <destinationDB> lstDestination = a.GetDestination(); List <serviceDB> lstReclamation = a.GetServices().Where(w => w.libelleService.Trim() == "Reclamation" && w.etat.Trim() == "A").ToList(); List <serviceDB> lstReclamationFin = new List <serviceDB>(); foreach (serviceDB recl in lstReclamation) { if (lstDestination.Where(w => w.codeDest == recl.codeDest && w.codeProfil == user.code_profil).Count() > 0) { lstReclamationFin.Add(recl); } } lstReclamation = lstReclamationFin; lblNotifReclamation.Text = lstReclamation.Count().ToString(); nbNotification.Text = (Convert.ToInt16(lblNotifCommandeInterFourn.Text) + Convert.ToInt16(lblNotifCommande.Text) + Convert.ToInt16(lblNotifReclamation.Text)).ToString(); } //Gestionnaire Devis else if (user.code_profil == 505) { //LI Devis.Visible = true; liTraiterDevis.Visible = true; liaffixherDevisGest.Visible = true; liReclamation.Visible = true; liaffiherReclamation.Visible = true; //notification liDevis.Visible = true; liAfficheReclamation.Visible = true; List <serviceDB> lsNotification = a.GetServices().Where(w => (w.libelleService != null) && (w.etat.Trim() == "A")).ToList(); lblDevis.Text = lsNotification.Where(w => w.libelleService.Trim() == "Devis").Count().ToString(); List <destinationDB> lstDestination = a.GetDestination(); List <serviceDB> lstReclamation = a.GetServices().Where(w => w.libelleService.Trim() == "Reclamation" && w.etat.Trim() == "A").ToList(); List <serviceDB> lstReclamationFin = new List <serviceDB>(); foreach (serviceDB recl in lstReclamation) { if (lstDestination.Where(w => w.codeDest == recl.codeDest && w.codeProfil == user.code_profil).Count() > 0) { lstReclamationFin.Add(recl); } } lstReclamation = lstReclamationFin; lblNotifReclamation.Text = lstReclamation.Count().ToString(); nbNotification.Text = (Convert.ToInt16(lblDevis.Text) + Convert.ToInt16(lblNotifReclamation.Text)).ToString(); } //Gestionnaire Dérogations else if (user.code_profil == 606) { //LI liDerogation.Visible = true; liConsulterDero.Visible = true; liafficherDeroGest.Visible = false; liReclamation.Visible = true; liaffiherReclamation.Visible = true; //notification liRemise.Visible = true; liProrogatin.Visible = true; liSouscripton.Visible = true; // IntermidiaireProfil.Visible = true; liRemise.Visible = true; liProrogatin.Visible = true; liSouscripton.Visible = true; liAfficheReclamation.Visible = true; List <serviceDB> lsNotification = a.GetServices().Where(w => (w.libelleService != null) && (w.etat.Trim() == "A")).ToList(); lblNotifRemise.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 1).Count().ToString(); lblNotifProrogation.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 2).Count().ToString(); lblNotifSouscription.Text = lsNotification.Where(w => w.libelleService.Trim() == "Derogation" && w.idType == 3).Count().ToString(); List <destinationDB> lstDestination = a.GetDestination(); List <serviceDB> lstReclamation = a.GetServices().Where(w => w.libelleService.Trim() == "Reclamation" && w.etat.Trim() == "A").ToList(); List <serviceDB> lstReclamationFin = new List <serviceDB>(); foreach (serviceDB recl in lstReclamation) { if (lstDestination.Where(w => w.codeDest == recl.codeDest && w.codeProfil == user.code_profil).Count() > 0) { lstReclamationFin.Add(recl); } } lstReclamation = lstReclamationFin; lblNotifReclamation.Text = lstReclamation.Count().ToString(); nbNotification.Text = (Convert.ToInt16(lblNotifReclamation.Text) + Convert.ToInt16(lblNotifRemise.Text) + Convert.ToInt16(lblNotifProrogation.Text) + Convert.ToInt16(lblNotifSouscription.Text)).ToString(); } //Admin else if (user.code_profil == 808) { //LI accueil.Visible = true; liGestUser.Visible = true; liGestProfil.Visible = true; liGestPermission.Visible = true; // IntermidiaireProfil.Visible = true; //notification liCompteDesactive.Visible = true; liGestUser.Visible = true; liGestProfil.Visible = true; List <UtilisateurDB> lsNotification = a.GetUser().Where(w => w.Etat.Trim() == "N").ToList(); nbNotification.Text = lsNotification.Count().ToString(); lblNotifCompteDesactive.Text = lsNotification.Count().ToString(); } }