Пример #1
0
    protected void Binding_Panel1()
    {
        string nom = "";

        if (membre != null && membre.id != null && membre.id > 0)
        {
            nom = nom + membre.name + "  " + membre.surname;
        }

        if (!string.IsNullOrEmpty(nom))
        {
            LBL_Nom_Prenom.Text = nom;
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                LBL_Nom_Prenom.Visible = false;
            }
        }



        if (membre != null && membre.id != null && membre.id > 0 && !string.IsNullOrEmpty(membre.industry))
        {
            LBL_Classification.Text = "" + membre.industry;
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                LBL_Classification.Visible = false;
            }
        }

        if (membre != null && membre.id != null && membre.id > 0)
        {
            IMG_Photo.ImageUrl = membre.GetPhoto();
            //HF_Photo.Value = membre.photo;
            //BT_Effacer_Photo.Visible = membre.photo != "";
        }

        // Custum image manager
        string        filename_Img = Functions.ClearFileName(PortalSettings.Current.HomeDirectory + Const.CONTENT_PRESENTATION_PREFIX + UserIdQuery + "/");
        DirectoryInfo d            = new DirectoryInfo(Server.MapPath(PortalSettings.Current.HomeDirectory + Const.CONTENT_PRESENTATION_PREFIX + UserIdQuery + "/"));

        if (!d.Exists)
        {
            d.Create();
        }
        TXT_Editor.ImageManager.ViewPaths   = new string[] { filename_Img };
        TXT_Editor.ImageManager.UploadPaths = new string[] { filename_Img };
        TXT_Editor.ImageManager.DeletePaths = new string[] { filename_Img };
        // Custum document manager
        string filename_Doc = Functions.ClearFileName(PortalSettings.Current.HomeDirectory + Const.CONTENT_PRESENTATION_PREFIX + UserIdQuery + "/");

        TXT_Editor.DocumentManager.ViewPaths   = new string[] { filename_Doc };
        TXT_Editor.DocumentManager.UploadPaths = new string[] { filename_Doc };
        TXT_Editor.DocumentManager.DeletePaths = new string[] { filename_Doc };
        //size
        TXT_Editor.DocumentManager.MaxUploadFileSize = 4194304;
        TXT_Editor.ImageManager.MaxUploadFileSize    = 1048576;

        if (affectation != null && !string.IsNullOrEmpty(affectation.function))
        {
            LBL_Fonction.Text = "" + affectation.function;
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                LBL_Fonction.Visible = false;
            }
        }

        if (contenu != null)
        {
            Session["id_contenu"] = contenu.id;
            Session["publie"]     = contenu.published;

            if (!string.IsNullOrEmpty(contenu.text))
            {
                TXT_Editor.Content = contenu.text;
            }

            if (!string.IsNullOrEmpty(contenu.title))
            {
                TBX_Titre.Text = contenu.title;
            }

            if (!string.IsNullOrEmpty(contenu.company))
            {
                TBX_Societe.Text = contenu.company;
            }

            IMG_Logo.ImageUrl       = contenu.GetPresentationPhoto();
            HF_Logo.Value           = contenu.photo;
            BT_Effacer_Logo.Visible = contenu.photo != "";

            if (!string.IsNullOrEmpty(contenu.url))
            {
                TBX_URL.Text = contenu.url;
            }
        }
    }
Пример #2
0
    protected void Binding_Panel2()
    {
        string nom = "";

        if (membre != null && membre.id != null && membre.id > 0)
        {
            nom = nom + membre.name + "  " + membre.surname;
        }

        if (!string.IsNullOrEmpty(nom))
        {
            LBL_Nom_Prenom2.Text = nom;
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                LBL_Nom_Prenom2.Visible = false;
            }
        }

        if (membre != null && membre.id != null && membre.id > 0 && !string.IsNullOrEmpty(membre.industry))
        {
            LBL_Classification2.Text = "" + membre.industry;
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                LBL_Classification2.Visible = false;
            }
        }

        if (membre != null && membre.id != null && membre.id > 0)
        {
            IMG_Photo2.ImageUrl = membre.GetPhoto();
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                IMG_Photo2.Visible = false;
            }
        }


        if (affectation != null && !string.IsNullOrEmpty(affectation.function))
        {
            LBL_Fonction2.Text = "" + affectation.function;
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                LBL_Fonction2.Visible = false;
            }
        }

        if (content != null)
        {
            if (!string.IsNullOrEmpty(content.text))
            {
                LTL_Texte2.Text = content.text;
            }
            else
            {
                if (!UserInfo.IsSuperUser)
                {
                    LTL_Texte2.Visible = false;
                }
            }

            if (!string.IsNullOrEmpty(content.title))
            {
                LBL_Titre2.Text = content.title;
            }
            else
            {
                if (!UserInfo.IsSuperUser)
                {
                    LBL_Titre2.Visible = false;
                }
            }

            if (!string.IsNullOrEmpty(content.company))
            {
                LBL_Societe.Text = content.company;
            }
            else
            {
                if (!UserInfo.IsSuperUser)
                {
                    LBL_Societe.Visible = false;
                }
            }

            if (!string.IsNullOrEmpty(content.GetPresentationPhoto()))
            {
                IMG_Logo2.ImageUrl = content.GetPresentationPhoto();
            }
            else
            {
                if (!UserInfo.IsSuperUser)
                {
                    IMG_Logo2.Visible = false;
                }
            }

            if (!string.IsNullOrEmpty(content.url))
            {
                HLK_URL2.NavigateUrl = content.url;
            }
            else
            {
                if (!UserInfo.IsSuperUser)
                {
                    HLK_URL2.Visible = false;
                }
            }
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                LTL_Texte2.Visible = false;
                LBL_Titre2.Visible = false;
                IMG_Logo2.Visible  = false;
                HLK_URL2.Visible   = false;
            }
        }

        if (membre != null && membre.id != null && membre.id > 0)
        {
            PortalSettings ps = PortalController.GetCurrentPortalSettings();
            if (ps.UserInfo.Roles != null && ps.UserInfo.Roles.Count() > 0)
            {
                HLK_Contact2.NavigateUrl = "javascript:dnnModal.show('/AIS/contact.aspx?id=" + membre.id + "&popUp=true',false,350,850,false);";
            }
            else
            {
                HLK_Contact2.NavigateUrl = "javascript:dnnModal.show('/AIS/contact.aspx?id=" + membre.id + "&popUp=true',false,350,500,false);";
            }
        }
        else
        {
            if (!UserInfo.IsSuperUser)
            {
                HLK_Contact2.Visible = false;
            }
        }
    }