Esempio n. 1
0
        private void BindGrid()
        {
            AstreeDonnees a = new AstreeDonnees();

            gv_User.DataSource = a.GetUser();
            gv_User.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["code_utilisateur"] == null)
            {
                Response.Redirect("login.aspx");
            }
            if (!IsPostBack)
            {
                if (Session["code_utilisateur"] != null)
                {
                    AstreeDonnees a    = new AstreeDonnees();
                    UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString()));
                    adresseDB     adr  = a.GetAdresse(user).FirstOrDefault();
                    //img=ConvertbyteToImage(user.Image);
                    Txttel.Text = adr.tel;

                    Txtgouvernerat.Text = adr.gouvernerat;
                    TxtVille.Text       = adr.ville;
                    TxTUserProfil.Text  = user.description_profil;
                }
                else
                {
                    Response.Redirect("login.aspx");
                }
            }
            importerF.Attributes.Add("onclick", "document.getElementById('" + FileUpload1.ClientID + "').click();return false;");
        }
        private void BindGrid()
        {
            AstreeDonnees a = new AstreeDonnees();

            gv_Profil.DataSource = a.GetProfil().Where(w => w.code != 0);
            gv_Profil.DataBind();
        }
Esempio n. 4
0
        private void BindGrid()
        {
            AstreeDonnees a = new AstreeDonnees();

            gv_Permission.DataSource = a.GetPermission();
            gv_Permission.DataBind();
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["code_utilisateur"] == null)
            {
                Response.Redirect("login.aspx");
            }


            if (!IsPostBack)
            {
                // bind chart type names to ddl

                ddlChartType.DataSource = Enum.GetNames(typeof(SeriesChartType));
                ddlChartType.DataBind();

                foreach (ListItem ite in ddlChartType.Items)
                {
                    if (ite.Text == "Column")
                    {
                        ite.Selected = true;
                    }
                }

                AstreeDonnees         a      = new AstreeDonnees();
                UtilisateurDB         user   = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString()));
                List <statistiquesDB> lsStat = a.GetStatistiques().Where(w => w.Agence == user.code_partenaire.ToString()).ToList();
                Session["lstStat"]         = lsStat;
                gv_statistiques.DataSource = lsStat;
                gv_statistiques.DataBind();
                //DataBind();
                getAnnee();
                getBranche();
                getCharte();
            }
        }
        protected void gv_Devis_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gv_Devis.PageIndex  = e.NewPageIndex;
            gv_Devis.DataSource = Session["lstDevis"];
            gv_Devis.DataBind();
            gv_Devis.SelectedIndex = -1;


            AstreeDonnees    a  = new AstreeDonnees();
            List <serviceDB> ls = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Devis")).ToList();

            foreach (GridViewRow row in gv_Devis.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() == "V")
                        {
                            cb.Checked = true;
                        }
                    }
                }
            }
        }
Esempio n. 7
0
        protected void gv_Commande_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                try
                {
                    AstreeDonnees a = new AstreeDonnees();

                    GridViewRow row  = e.Row;
                    serviceDB   serv = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Commande") && (w.code_service == Convert.ToInt32(row.Cells[1].Text))).FirstOrDefault();


                    if (serv != null)
                    {
                        if (serv.etatNotif == "N")
                        {
                            //e.Row.BackColor = System.Drawing.Color.Red;
                            e.Row.ForeColor = System.Drawing.Color.Red;
                        }
                    }
                }
                catch (Exception ex)
                { }
            }
        }
        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);
            }
        }
Esempio n. 9
0
        protected void gv_Detail_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow row = gv_Detail.SelectedRow;
            //txtNum.Text = row.Cells[1].Text;
            //lblMessage.Text = "You selected Commande numéro " + row.Cells[1].Text + ".";
            Txtcode.Text = row.Cells[2].Text;
            txtQte.Text = row.Cells[6].Text;
            txtPrix.Text = row.Cells[5].Text;
            TxtBesoin.Text = row.Cells[7].Text;

            ddlListeP.SelectedItem.Text= row.Cells[4].Text;
            BtnEnvoyer.Visible = false;

            AstreeDonnees a = new AstreeDonnees();
            serviceDB serv = a.GetServices().Where(w=>w.code_service == Convert.ToInt16(row.Cells[1].Text)).FirstOrDefault();

            if (serv.etatNotif == "N")
            {
                List<notificationDB> lstNotif = new List<notificationDB>();
                lstNotif = a.GetNotification();
                notificationDB notif = lstNotif.Where(w=>w.codeService==serv.code_service).FirstOrDefault();             
                notif.etatNotif = "L";//  LU
                a.maj_notification(notif);
                foreach (GridViewRow grvRow in gv_Detail.Rows)
                {
                    if(row.Cells[1].Text== grvRow.Cells[1].Text)
                    {
                        grvRow.ForeColor = System.Drawing.Color.Black;
                    }
                    
                }
                
            }
        }
        protected void btnAffecter_Click(object sender, EventArgs e)
        {
            AstreeDonnees     ad        = new AstreeDonnees();
            affecterDB        aff       = new affecterDB();
            List <affecterDB> lstAffect = ad.GetAffecter();
            affecterDB        z         = new affecterDB();

            if (txtcode.Text != "")
            {
                List <affecterDB> lstAff = new List <affecterDB>();
                foreach (ListItem x in lstChoisies.Items)
                {
                    aff = new affecterDB();
                    aff.codePermission = Convert.ToInt16(x.Value);
                    aff.codeProfil     = Convert.ToInt16(txtcode.Text);
                    z = lstAffect.Where(w => (w.codeProfil == aff.codeProfil) && (w.codePermission == aff.codePermission)).FirstOrDefault();

                    if (z == null)
                    {
                        lstAff.Add(aff);
                    }
                }
                if (lstAff.Count > 0)
                {
                    ad.InsertAffecter(lstAff);
                    txtcode.Text    = "";
                    txtlibelle.Text = "";
                }
            }
        }
Esempio n. 11
0
        private void BindGrid()
        {
            AstreeDonnees         a        = new AstreeDonnees();
            List <serviceDB>      ls       = a.GetServices().Where(w => w.libelleService == "Commande" && w.codeDest == 404 && w.etat.Trim() == "A").ToList();
            List <serviceDB>      lsServ   = new List <serviceDB>();
            List <notificationDB> lstNotif = a.GetNotification();

            gv_Commande.DataSource = ls;
            gv_Commande.DataBind();
            foreach (GridViewRow row in gv_Commande.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")
                        {
                            row.ForeColor = System.Drawing.Color.Red;
                        }

                        if (serv.etat.ToString().Trim() == "V")
                        {
                            cb.Checked    = true;
                            row.ForeColor = System.Drawing.Color.Black;
                        }
                    }
                }
            }
        }
        private void BindGrid()
        {
            AstreeDonnees           a  = new AstreeDonnees();
            List <DetailCommandeDB> ls = a.GetDetailCommande().Where(w => (w.LibelleService != null) && (w.LibelleService.Trim() == "Commande") && (w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"]))).OrderBy(w => w.etat).ThenByDescending(w => w.code_service).ToList();

            Session["lstCommande"] = ls;
            gv_Commande.DataSource = ls;
            gv_Commande.DataBind();
        }
Esempio n. 13
0
        private void BindGrid()
        {

            AstreeDonnees a = new AstreeDonnees();

            //sachant que 303 est le code profil effectuer aux fournisseurs
            gv_EnvoyerCommande.DataSource = a.GetUser().Where(w => w.code_profil == 303);
            gv_EnvoyerCommande.DataBind();
        }
Esempio n. 14
0
        protected void gv_User_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                lblMessage.Text = gv_User.Rows[gv_User.SelectedIndex].Cells[1].Text;
                AstreeDonnees ad  = new AstreeDonnees();
                string        ret = ad.maj_user(gv_User.Rows[gv_User.SelectedIndex].Cells[1].Text);
                Label         x   = (Label)Master.FindControl("lblNotifCompteDesactive") as Label;
                Label         y   = (Label)Master.FindControl("nbNotification") as Label;

                List <UtilisateurDB> lsNotification = ad.GetUser().Where(w => w.Etat.Trim() == "N").ToList();

                x.Text = lsNotification.Count().ToString();
                y.Text = lsNotification.Count().ToString();
                if (ret == "Active")
                {
                    lblMessage.Text = "Traitement fait avec succès!!";
                    this.BindGrid();
                    //gv_User.SelectedIndex = -1;
                    UtilisateurDB     S       = ad.GetUser().Where(w => w.login == gv_User.Rows[gv_User.SelectedIndex].Cells[1].Text).FirstOrDefault();
                    partenaireDB      part2   = ad.GetPartenair().Where(w => w.code_partenaire == S.code_partenaire).FirstOrDefault();
                    adresseDB         adr     = ad.GetAdresse().Where(w => w.code_adresse == part2.code_adresse).FirstOrDefault();
                    string            chaine  = "Le compte de votre utilisateur =" + S.Nom_utilisateur + "  est activé";
                    MailMessage       o       = new MailMessage("*****@*****.**", adr.email, "Activation du compte", chaine);
                    NetworkCredential netCred = new NetworkCredential("*****@*****.**", "HA_ouma147896321");
                    SmtpClient        smtpobj = new SmtpClient("smtp.gmail.com", 25);
                    smtpobj.EnableSsl   = true;
                    smtpobj.Credentials = netCred;
                    smtpobj.Send(o);
                }
                else if (ret == "Desactive")
                {
                    lblMessage.Text = "Traitement fait avec succès!!";
                    this.BindGrid();
                    // gv_User.SelectedIndex = -1;
                    UtilisateurDB     S       = ad.GetUser().Where(w => w.login == gv_User.Rows[gv_User.SelectedIndex].Cells[1].Text).FirstOrDefault();
                    partenaireDB      part2   = ad.GetPartenair().Where(w => w.code_partenaire == S.code_partenaire).FirstOrDefault();
                    adresseDB         adr     = ad.GetAdresse().Where(w => w.code_adresse == part2.code_adresse).FirstOrDefault();
                    string            chaine  = "Le compte de votre utilisateur =" + S.Nom_utilisateur + "  est désaactivé";
                    MailMessage       o       = new MailMessage("*****@*****.**", adr.email, "Désactivation du compte", chaine);
                    NetworkCredential netCred = new NetworkCredential("*****@*****.**", "HA_ouma147896321");
                    SmtpClient        smtpobj = new SmtpClient("smtp.gmail.com", 25);
                    smtpobj.EnableSsl   = true;
                    smtpobj.Credentials = netCred;
                    smtpobj.Send(o);
                }
                else
                {
                    lblMessage.Text = ret;
                }
            }
            catch (Exception ex)
            {
                //Response.Redirect("PageErreur.aspx");
            }
        }
Esempio n. 15
0
        private void BindGrid()
        {
            AstreeDonnees a    = new AstreeDonnees();
            UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString()));

            List <serviceDB> ls = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Remise") && (w.codeUtilisateur == user.code_utilisateur)).OrderBy(w => w.etat).ThenByDescending(w => w.code_service).ToList();

            foreach (serviceDB x in ls)
            {
                if (x.libelleBranche.Trim() == "Choisir")
                {
                    x.libelleBranche = "";
                }
                if (x.libelleSousbranche.Trim() == "Choisir")
                {
                    x.libelleSousbranche = "";
                }
            }
            Session["lstremise"]     = ls;
            gv_Derogation.DataSource = ls;
            gv_Derogation.DataBind();

            List <serviceDB> lss = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Prorogation") && (w.codeUtilisateur == user.code_utilisateur)).OrderBy(w => w.etat).ThenByDescending(w => w.code_service).ToList();

            foreach (serviceDB x in lss)
            {
                if (x.libelleBranche.Trim() == "Choisir")
                {
                    x.libelleBranche = "";
                }
                if (x.libelleSousbranche.Trim() == "Choisir")
                {
                    x.libelleSousbranche = "";
                }
            }
            Session["lstproro"]      = lss;
            gvProrogation.DataSource = lss;
            gvProrogation.DataBind();

            List <serviceDB> lsss = a.GetServices().Where(w => (w.libelleService != null) && (w.libelleService.Trim() == "Derogation") && (w.libelleType.Trim() == "Souscription") && (w.codeUtilisateur == user.code_utilisateur)).OrderBy(w => w.etat).ThenByDescending(w => w.code_service).ToList();

            foreach (serviceDB x in lsss)
            {
                if (x.libelleBranche.Trim() == "Choisir")
                {
                    x.libelleBranche = "";
                }
                if (x.libelleSousbranche.Trim() == "Choisir")
                {
                    x.libelleSousbranche = "";
                }
            }
            Session["lstsouscrip"]    = lsss;
            gvSouscription.DataSource = lsss;
            gvSouscription.DataBind();
        }
Esempio n. 16
0
        protected void gv_Detail_SelectedIndexChanged(object sender, EventArgs e)
        {
            AstreeDonnees a = new AstreeDonnees();
            //  txtetat.Text = "";
            GridViewRow row = gv_Detail.SelectedRow;

            //txtNum.Text = row.Cells[1].Text;
            //lblMessage.Text = "You selected Commande numéro " + row.Cells[1].Text + ".";
            txtProduit.Text          = row.Cells[2].Text;
            txtQuantiteDemandee.Text = row.Cells[3].Text;
        }
Esempio n. 17
0
        protected void gv_Commande_SelectedIndexChanged(object sender, EventArgs e)
        {
            AstreeDonnees a = new AstreeDonnees();
            //txtetat.Text = "";
            GridViewRow row = gv_Commande.SelectedRow;

            txtNum.Text     = row.Cells[1].Text;
            lblMessage.Text = "Vous avez séléctionner la commande numéro " + row.Cells[1].Text + ".";
            //txtProduit.Text = row.Cells[2].Text;
            //txtQuantiteDemandee.Text= row.Cells[4].Text;



            CheckBox cb = (CheckBox)row.FindControl("Accepter");

            if (cb != null && cb.Checked)
            {
                // txtetat.Text = "VALIDEE";
                Btnreponse.Visible = false;
                cb.Enabled         = false;
                notificationDB notif = a.GetNotification().Where(w => w.codeService == Convert.ToInt16(txtNum.Text)).FirstOrDefault();
                if (notif != null)
                {
                    notif.etatNotif = "L";
                    a.maj_notification(notif);
                }
                row.ForeColor = System.Drawing.Color.Black;
                Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
            }
            else
            {
                Btnreponse.Visible = true;
                //cb.Enabled = true;
            }



            List <DetailCommandeDB> ls = a.GetDetailCommande().Where(w => w.LibelleService.Trim() == "Commande" && w.code_dest == 404 && w.code_service == Convert.ToInt16(txtNum.Text)).ToList();

            if (ls.Count() > 0)
            {
                // PnlInfo.Visible = false;
                Pnl_GvDetail.Visible = true;
                gv_Detail.DataSource = ls;
                gv_Detail.DataBind();
            }

            else
            {
                Pnl_GvDetail.Visible = false;
                //PnlInfo.Visible = true;
                //msg.Text = "il n'existe aucune Demande pour cet fournisseur!";
            }
        }
Esempio n. 18
0
        protected void ddlpartenaire_SelectedIndexChanged(object sender, EventArgs e)
        {
            AstreeDonnees       a       = new AstreeDonnees();
            adresseDB           adr     = new adresseDB();
            List <partenaireDB> lstPart = a.GetPartenair().Where(w => w.code_partenaire == Convert.ToInt16(ddlpartenaire.SelectedValue)).ToList();

            adr = a.GetAdresse(lstPart.FirstOrDefault()).FirstOrDefault();
            if (adr != null)
            {
                txtemail.Text = adr.email;
            }
        }
        protected void Unnamed_ServerClick(object sender, EventArgs e)
        {
            AstreeDonnees a    = new AstreeDonnees();
            UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString()));

            if ((user.code_profil == 101) || (user.code_profil == 202))
            {
                Response.Redirect("DemanderReclamation.aspx");
            }
            else
            {
                Response.Redirect("AfficherReclamation.aspx");
            }
        }
        protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string   codeProfil   = gv_Profil.DataKeys[e.Row.RowIndex].Value.ToString();
                GridView gvPermission = e.Row.FindControl("gvPermission") as GridView;//Recherche gridview

                AstreeDonnees     a            = new AstreeDonnees();
                List <affecterDB> lsPermission = a.GetAffecter().Where(w => w.codeProfil == Convert.ToInt32(codeProfil)).ToList();

                gvPermission.DataSource = lsPermission;
                gvPermission.DataBind();
            }
        }
Esempio n. 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["code_utilisateur"] == null)
     {
         Response.Redirect("login.aspx");
     }
     if (!this.IsPostBack)
     {
         AstreeDonnees a  = new AstreeDonnees();
         int           nb = a.GetServices().Where(w => w.libelleService.Trim() == "Reclamation" && w.etat.Trim() == "A").Count();
         nbr.Text = nb.ToString();
         lundi(sender, e);
     }
 }
        protected void Btnsave_Click(object sender, EventArgs e)
        {
            if (Txtpsw.Text == "")
            {
                txtPasse2.Text = "";
                MsgPasse.Text  = "Vous devez saisir votre mot de passe!";
                Txtpsw.Focus();
            }

            else if (txtpsw2.Text == "")
            {
                txtpsw2.Focus();
                MsgPasse.Text  = "";
                txtPasse2.Text = "Vous devez retaper votre mot de passe";
            }
            else if (txtpsw2.Text.Trim() != Txtpsw.Text.Trim())
            {
                txtpsw2.Focus();
                txtpsw2.Text   = "";
                MsgPasse.Text  = "";
                txtPasse2.Text = "Les deux mot de passe ne sont pas identique!";
            }
            else
            {
                System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream);
                System.Drawing.Image imag = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream);
                txtPasse2.Text = "";
                MsgPasse.Text  = "";
                AstreeDonnees astrDonnes = new AstreeDonnees();

                UtilisateurDB usr = astrDonnes.GetUser(Convert.ToInt16(Session["code_utilisateur"]));
                adresseDB     adr = astrDonnes.GetAdresse(usr).FirstOrDefault();

                adr.ville       = TxtVille.Text;
                adr.tel         = Txttel.Text;
                adr.gouvernerat = Txtgouvernerat.Text;
                usr.Mdp         = Txtpsw.Text;

                byte[] tab = ConvertImageToByteArray(imag, System.Drawing.Imaging.ImageFormat.Jpeg);;
                usr.Image = tab;

                astrDonnes.modifierUtilisateur(usr);
                astrDonnes.modifierAdresse(adr);
                //lblMsgSucces.Visible = true;
                //lblMsgSucces.Text = "Modification Terminée";
            }
        }
        protected void gv_Reclamation_SelectedIndexChanged(object sender, EventArgs e)
        {
            Btnsave.Visible = false;
            AstreeDonnees a = new AstreeDonnees();

            GridViewRow   row  = gv_Reclamation.SelectedRow;
            serviceDB     serv = a.GetServices().Where(w => w.code_service == Convert.ToInt32(row.Cells[1].Text)).FirstOrDefault();
            UtilisateurDB user = a.GetUser(Convert.ToInt16(serv.codeUtilisateur));

            TxtCode.Text = serv.codeUtilisateur.ToString();


            List <destinationDB> lstDestination = a.GetDestination();

            destinationDB dest = lstDestination.Where(w => w.codeDest == Convert.ToInt16(row.Cells[5].Text.Trim())).FirstOrDefault();

            if (dest != null)
            {
                ddlDest.SelectedItem.Text = dest.libelleDest;
            }

            TxtCommentaire.Text = row.Cells[4].Text.Trim();

            notificationDB notif = a.GetNotification().Where(w => w.codeService == serv.code_service).FirstOrDefault();

            if (notif != null)
            {
                if (notif.etatNotif == "N")
                {
                    notif.etatNotif = "L";
                    a.maj_notification(notif);
                    row.ForeColor = System.Drawing.Color.Black;

                    Label x = (Label)Master.FindControl("lblNotifReclamation") 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() == "Reclamation").Count().ToString();

                    Label nbNotification = (Label)Master.FindControl("nbNotification") as Label;
                    nbNotification.Text = (Convert.ToInt16(nbNotification.Text) - 1).ToString();
                }
            }
            BindGrid();
        }
Esempio n. 24
0
        protected void btnSendMe_Click(object sender, EventArgs e)
        {
            try

            {
                AstreeDonnees        a1        = new AstreeDonnees();
                DataAccesDataContext dbcontext = new DataAccesDataContext();

                adresseDB rech = a1.GetAdresse().Where(w => w.email.Trim() == txtEmail.Text.Trim()).FirstOrDefault();

                //foreach (var R in rech)
                //{
                if (rech != null)
                {
                    AstreeDonnees a   = new AstreeDonnees();
                    adresseDB     adr = new adresseDB();
                    adr = a.GetAdresse().Where(w => w.email == txtEmail.Text).FirstOrDefault();
                    string            mail    = txtEmail.Text;
                    string[]          lst     = mail.Split('@');
                    string            date    = DateTime.Now.ToString();
                    string[]          lstDate = date.Split(' ');
                    string            hash    = lst[0] + lstDate[1];
                    recuperationMDPDB rec     = new recuperationMDPDB();
                    rec.code_adresse = adr.code_adresse;
                    rec.Hash         = CalculateMD5Hash(hash);
                    rec.Etat         = "E";
                    a.InsertHash(rec);
                    string            url     = "http://*****:*****@gmail.com", mail, "Récuperation Mot De Passe", "Pour la récupération de votre mot de passe il suffit de clicker sur ce lien : " + url);
                    NetworkCredential netCred = new NetworkCredential("*****@*****.**", "soutenancepfe");
                    SmtpClient        smtpobj = new SmtpClient("smtp.gmail.com", 25);
                    smtpobj.EnableSsl   = true;
                    smtpobj.Credentials = netCred;
                    smtpobj.Send(o);
                }
                else
                {
                }
                //}
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
            }
        }
Esempio n. 25
0
        private void getAnnee()
        {
            AstreeDonnees a    = new AstreeDonnees();
            UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString()));

            List <statistiquesDB> lsStat = a.GetStatistiques().Where(w => w.Agence == user.code_partenaire.ToString()).ToList();
            var            lst           = lsStat.Select(w => w.Annee);
            List <double?> lstAnnee      = lst.Distinct().ToList();

            List <ListItem> itemsAnnee = new List <ListItem>();

            itemsAnnee.Add(new ListItem("--Choisir", "--Choisir"));
            foreach (int x in lstAnnee)
            {
                itemsAnnee.Add(new ListItem(x.ToString(), x.ToString()));
            }

            ddlAnnee.Items.AddRange(itemsAnnee.ToArray());
        }
Esempio n. 26
0
        private void getBranche()
        {
            AstreeDonnees a    = new AstreeDonnees();
            UtilisateurDB user = a.GetUser(Convert.ToInt16(Session["code_utilisateur"].ToString()));

            List <statistiquesDB> lsStat = a.GetStatistiques().Where(w => w.Agence == user.code_partenaire.ToString()).ToList();
            var           lst2           = lsStat.Select(w => w.Branche);
            List <string> lstBranche     = lst2.Distinct().ToList();

            List <ListItem> itemsBranche = new List <ListItem>();

            itemsBranche.Add(new ListItem("--Choisir--", "--Choisir--"));
            foreach (string x in lstBranche)
            {
                itemsBranche.Add(new ListItem(x, x));
            }

            ddlBranche.Items.AddRange(itemsBranche.ToArray());
        }
Esempio n. 27
0
        protected void affichier_Click(object sender, ImageClickEventArgs e)
        {
            AstreeDonnees a = new AstreeDonnees();
            int id = int.Parse((sender as ImageButton).CommandArgument);

            int ls = a.GetDetailCommande().Where(w => w.code_dest == id).Count();
            if (ls != 0)
            {
                PnlInfo.Visible = false;
                Pnl_GvDetail.Visible = true;
                BindGridAffichage(id);
            }

            else
            {
                Pnl_GvDetail.Visible = false;
                PnlInfo.Visible = true;
                msg.Text = "il n'existe aucune Demande pour cet fournisseur!";
            }
        }
        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;
                }
            }
        }
Esempio n. 29
0
        protected void ddlprofil1_SelectedIndexChanged(object sender, EventArgs e)
        {
            AstreeDonnees       a       = new AstreeDonnees();
            List <partenaireDB> lstPart = new List <partenaireDB>();

            lstPart = a.GetPartenair();
            lstPart = a.GetPartenair().Where(w => w.description_profil.Trim() == ddlprofil1.SelectedItem.Text.Trim()).ToList();
            ddlpartenaire.DataSource = lstPart;
            ddlpartenaire.DataBind();
            if (lstPart.Count() == 1)
            {
                adresseDB adr = new adresseDB();

                adr = a.GetAdresse(lstPart.FirstOrDefault()).FirstOrDefault();
                if (adr != null)
                {
                    txtemail.Text = adr.email;
                }
            }
        }
        protected void BtnAjoutDevis_Click(object sender, EventArgs e)
        {
            //lblMessage1.Text = "Demande envoyer avec succées";

            AstreeDonnees    ad    = new AstreeDonnees();
            serviceDB        devis = new serviceDB();
            List <serviceDB> ls    = ad.GetServices().Where(w => w.libelleService.Trim() == "Devis" && w.codeUtilisateur == Convert.ToInt16(Session["code_utilisateur"].ToString())).ToList();

            if (ddlproduit.SelectedIndex == 0)
            {
                MsgError.Visible = true;
                MsgError.Text    = "Vous devez selectionner un produit";
            }
            else
            {
                //devis = ad.GetServices().Where(w => w.libelleService.Trim() == "Devis").FirstOrDefault();
                devis.libelleService = "Devis";
                devis.idBranche      = Convert.ToInt16(ddlproduit.SelectedValue.ToString());
                devis.idSousBranche  = Convert.ToInt16(ddlsousproduit.SelectedValue.ToString());

                devis.etat            = "A";
                devis.dateDemande     = DateTime.Now;
                devis.idType          = 5;
                devis.codeUtilisateur = Convert.ToInt16(Session["code_utilisateur"].ToString());

                serviceDB ser = ls.Where(w => (w.libelleBranche.Trim() == ddlproduit.SelectedItem.Text.Trim()) && (w.libelleSousbranche.Trim() == ddlsousproduit.SelectedItem.Text.Trim())).FirstOrDefault();
                if (ser == null)
                {
                    ad.Insertservice(devis);
                    lblMsgSucces.Visible = true;
                    lblMsgSucces.Text    = "Demande devis envoyée avec succés";
                    BindGrid();
                }
                else
                {
                    lblMsgSucces.Visible = true;
                    lblMsgSucces.Text    = "Vous avez déja envoyer cette demande";
                    BindGrid();
                }
            }
        }