Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //subscribe au event d'ajout film
        Button btnEnregistrer = (Button)filmAbrege.FindControl("btnEnregistrer");

        btnEnregistrer.Click += new EventHandler(Refresh);

        // initialiser label pour message erreur et autres
        Label lblMessage = librairie.lblDYN(phVignettes, "message_vignettes", "", "message_vignettes");

        utilCourant           = SQL.FindUtilisateurByName(HttpContext.Current.User.Identity.Name);
        noUtilisateurCourrant = utilCourant.NoUtilisateur;

        // initialiser les préférences de nb films par page
        EntitePreference pref = SQL.GetPreferenceByNoUtilisateur(noUtilisateurCourrant);

        nbVignettesParPage = pref.NbFilmParPage;

        if (!Page.IsPostBack)
        {
            populerDDLUtilisateurs();
        }

        initialiserNoUtilisateur();
        populerListeFilms();

        // Vérifier la page courante
        initialiserNoPage();

        afficherPageVignettes(lblMessage);
    }
Exemplo n.º 2
0
    public void UpdateColor()
    {
        EntiteUtilisateur utilCourant    = SQL.FindUtilisateurByName(HttpContext.Current.User.Identity.Name);
        EntitePreference  mesPreferences = SQL.GetPreferenceByNoUtilisateur(utilCourant.NoUtilisateur);

        body.Attributes.Add("style", "background-color:" + mesPreferences.CouleurFond + "; color:" + mesPreferences.CouleurTexte);
    }
Exemplo n.º 3
0
    private void Page_Load(object sender, EventArgs e)
    {
        string           utilisateur           = HttpContext.Current.User.Identity.Name;
        int              noUtilisateurCourrant = SQL.FindNoUtilisateurByName(utilisateur);
        EntitePreference mesPreferences        = SQL.GetPreferenceByNoUtilisateur(noUtilisateurCourrant);

        nbElementsParPage = mesPreferences.NbFilmParPage;

        Label lblMessage = librairie.lblDYN(phDynamique, "message_vignettes", "", "message_vignettes");

        //if (!Page.IsPostBack)
        //{
        // Établir connection BD

        try
        {
            SQL.Connection();
            lstFilms = SQL.FindAllExemplairesEmpruntes();
        }
        catch (Exception Ex)
        {
            lblMessage.Text = "Oops... Un problème s'est glissé lors du téléchargement des films! (*′☉.̫☉)";
        }

        lstFilmsAfficher = lstFilms.ToList();
        //}
        InitialiserOrderBy();
        InitialiserSearch();
        InitialiserNoPage();

        FilterList(lblMessage);
    }
Exemplo n.º 4
0
    protected void modifier_Click(object sender, EventArgs e)
    {
        string utilisateur   = HttpContext.Current.User.Identity.Name;
        int    noUtilisateur = SQL.FindNoUtilisateurByName(utilisateur);

        if (PasswordPresent.IsValid && !passValide.IsValid)
        {
            succes.Visible = false;
            error.Visible  = true;
            lblError.Text  = "Le mot de passe doit être entre 11111 à 99999";
            return;
        }
        else if (!string.IsNullOrEmpty(tbNewPassword.Text))
        {
            if (!SQL.UpdatePassword(noUtilisateur, int.Parse(tbNewPassword.Text)))
            {
                succes.Visible = false;
                error.Visible  = true;
                lblError.Text  = "Une erreure est survenue";
                return;
            }
        }


        int nbParPages = 10;

        int.TryParse(nbDVDPage.Text, out nbParPages);

        EntitePreference entitePreference = new EntitePreference()
        {
            CouleurFond             = couleurFond.Text,
            CouleurTexte            = couleurTexte.Text,
            CourrielSiSuppression   = cbCourrielRetrait.Checked,
            CourrielSiAjout         = cbCourrielAjout.Checked,
            CourrielSiAppropriation = cbCourrielAppropiation.Checked,

            NbFilmParPage = nbParPages
        };

        if (SQL.UpdatePreference(entitePreference, noUtilisateur))
        {
            var master = Master as PageMaster_MasterPage;
            master.UpdateColor();

            error.Visible  = false;
            succes.Visible = true;
            lblSucces.Text = "Les modifications ont été apporté";
        }
        else
        {
            succes.Visible = false;
            error.Visible  = true;
            lblError.Text  = "Une erreure est survenue";
        }
    }
Exemplo n.º 5
0
    private void LoadChamps(EntitePreference mesPreferences)
    {
        couleurFond.Text  = mesPreferences.CouleurFond;
        couleurTexte.Text = mesPreferences.CouleurTexte;

        cbCourrielRetrait.Checked      = mesPreferences.CourrielSiSuppression;
        cbCourrielAjout.Checked        = mesPreferences.CourrielSiAjout;
        cbCourrielAppropiation.Checked = mesPreferences.CourrielSiAppropriation;

        nbDVDPage.Text = mesPreferences.NbFilmParPage.ToString();
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string           utilisateur    = HttpContext.Current.User.Identity.Name;
            int              noUtilisateur  = SQL.FindNoUtilisateurByName(utilisateur);
            EntitePreference mesPreferences = SQL.GetPreferenceByNoUtilisateur(noUtilisateur);

            LoadChamps(mesPreferences);
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        EntiteUtilisateur utilCourant = SQL.FindUtilisateurByName(HttpContext.Current.User.Identity.Name);

        lbl_user_connected.Text = utilCourant.NomUtilisateur;
        if (utilCourant.TypeUtilisateur == 'A')
        {
            nav_dvdenmain.Visible          = false;
            nav_ajoutfilm.Visible          = false;
            nav_gestionUtilisateur.Visible = true;
        }

        EntitePreference mesPreferences = SQL.GetPreferenceByNoUtilisateur(utilCourant.NoUtilisateur);

        UpdateColor();
    }