Beispiel #1
0
    public string GetClub(int cric, string device, string version, string fonction)
    {
        DateTime dt      = DateTime.Now;
        string   comment = "";
        string   code    = "ok";
        //envoyerTest(fonction);
        Club lm = new Club();

        try
        {
            lm = DataMapping.GetClub(cric);
        }
        catch (Exception ee)
        {
            code    = "erreur";
            comment = ee.ToString();
            Functions.Error(ee);
        }

        string output = JsonConvert.SerializeObject(lm, Formatting.Indented);

        DataMapping.InsertLogWS(os, device, version, getIP(), dt, getDuree(dt), fonction, code, comment, "");

        return(output);
    }
Beispiel #2
0
 protected void btn_img_Click(object sender, EventArgs e)
 {
     if (ful_img.HasFile)
     {
         Club club = new Club();
         if (hfd_cric.Value != "")
         {
             club = DataMapping.GetClub(int.Parse(hfd_cric.Value));
         }
         string fileName;
         if (club.cric != 0)
         {
             fileName = Path.GetFileName(club.club_type != "rotaract"? "fanion_" + club.cric : "fanion_" + tbx_clubRotaract.Text);
         }
         else
         {
             fileName = Path.GetFileName("fanion_" + tbx_clubRotaract.Text);
         }
         fileName += ".png";
         string        path = PortalSettings.HomeDirectory + Const.CLUBS_PREFIX + Const.PENNANT_PREFIX;
         DirectoryInfo d    = new DirectoryInfo(Server.MapPath(path));
         if (!d.Exists)
         {
             d.Create();
         }
         ful_img.PostedFile.SaveAs(Server.MapPath(path) + fileName);
         hfd_filename.Value  = fileName;
         club.pennant        = fileName;
         img_fanion.ImageUrl = club.GetPennant();
     }
 }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string id = "" + Request.QueryString["id"];

            if (id == "")
            {
                throw new Exception("La commande est introuvable sans parametre id (querystring : " + Request.QueryString + ")");
            }


            Order order = DataMapping.GetOrderByGuid(id);
            if (order == null)
            {
                throw new Exception("La commande " + id + " est introuvable");
            }

            Payment payment = DataMapping.GetPayment(order.id_payment);
            if (payment == null)
            {
                throw new Exception("Le reglement " + order.id_payment + " de la commande " + id + " est introuvable");
            }

            Club club = DataMapping.GetClub(order.cric);
            if (club == null)
            {
                throw new Exception("Le club " + order.club + " est introuvable");
            }

            string model = Const.ORDER_MODELE;
            if (!payment.model.Equals(""))
            {
                model = payment.model;
            }

            Media media = DataMapping.ProductionDocumentOrderPdf(model, order, payment, club, Functions.ClearFileName("Commande " + order.id + ".pdf"));


            Response.Buffer  = true;
            Response.Expires = 0;
            Response.Cache.SetCacheability(HttpCacheability.Public);


            Response.AppendHeader("Content-Disposition", "attachment; filename=" + media.name);
            Response.ContentType = media.content_type;
            Response.BinaryWrite(media.content);
        }
        catch (Exception ee)
        {
            Functions.Error(ee);
        }
    }
Beispiel #4
0
    protected void btn_addClub_Click(object sender, EventArgs e)
    {
        Club club = new Club();

        if (hfd_cric.Value != "")
        {
            club = DataMapping.GetClub(int.Parse(hfd_cric.Value));
        }

        club.adress_1     = tbx_adr1.Text;
        club.adress_2     = tbx_adr2.Text;
        club.adress_3     = tbx_adr3.Text;
        club.email        = tbx_email.Text;
        club.fax          = tbx_fax.Text;
        club.meeting_adr1 = tbx_meetAdr1.Text;
        club.meeting_adr2 = tbx_meetAdr2.Text;
        club.meetings     = tbx_meetings.Text;
        club.meeting_town = tbx_meetTown.Text;
        club.meeting_zip  = tbx_meetZip.Text;
        club.telephone    = tbx_tel.Text;
        club.text         = tbx_text.Text;
        club.town         = tbx_town.Text;
        club.web          = tbx_web.Text;
        club.zip          = tbx_zip.Text;
        club.pennant      = hfd_filename.Value;
        club.district_id  = 1730;


        if (tbx_clubRotaract.Text != "")
        {
            club.name      = tbx_clubRotaract.Text.ToUpper();;
            club.club_type = "rotaract";
        }

        if (hfd_cric.Value == "")
        {
            club.seo               = tbx_clubRotaract.Text.Replace(' ', '-');
            club.latitude          = "";
            club.longitude         = "";
            club.former_presidents = "";


            DataMapping.InsertClub(club);
        }

        else
        {
            DataMapping.UpdateClub(club);
        }

        Response.Redirect(Globals.NavigateURL());
    }
Beispiel #5
0
    /// <summary>
    /// Permet d'ajouter une Nouvelle et de la paramétrer
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void BT_Ajouter_Nouvelle_Click(object sender, EventArgs e)
    {
        HF_id.Value = "";

        HF_Cric.Value     = "" + Functions.CurrentCric;
        LBL_nom_club.Text = DataMapping.GetClub(Functions.CurrentCric).name;


        TXT_description.Text        = "";
        TXT_description_phases.Text = "";
        TXT_moyens_humains.Text     = "";
        TXT_moyens_materiel.Text    = "";
        TXT_nom_action.Text         = "";
        TXT_objectif.Text           = "";
        TXT_remarques.Text          = "";
        TXT_resultats.Text          = "";
        TXT_zone_geographique.Text  = "";
        DT_Date.SelectedDate        = DateTime.Now;

        LBL_nom_user_courant.Text     = "";
        LBL_nom_user_responsable.Text = "";

        bool validable = (UserInfo.IsSuperUser || UserInfo.IsInRole(Const.ADMIN_ROLE) || UserInfo.IsInRole(Const.ROLE_ADMIN_CLUB) || UserInfo.IsInRole(Const.ROLE_ADMIN_DISTRICT) || DataMapping.isADG(Functions.GetCurrentMember().id));

        BT_Valider.Visible             = validable;
        DL_id_user_courant.Visible     = validable;
        DL_id_user_responsable.Visible = validable;

        P_Lecture.Visible    = !validable;
        P_Modifiable.Visible = validable;

        if (validable)
        {
            List <Member> members = DataMapping.ListMembers(Functions.CurrentCric, "", "", "nom", 0, 999, false, true);

            DL_id_user_courant.Items.Clear();
            DL_id_user_responsable.Items.Clear();
            foreach (Member m in members)
            {
                DL_id_user_courant.Items.Add(new ListItem("" + m.surname + " " + m.name, "" + m.id));
                DL_id_user_responsable.Items.Add(new ListItem("" + m.surname + " " + m.name, "" + m.id));
            }
        }


        BT_Supprimer.Visible = false;

        Panel2.Visible = true;
        Panel1.Visible = false;
    }
Beispiel #6
0
    protected void dataList_Members_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        Affectation affectation = (Affectation)e.Item.DataItem;
        Member      member      = DataMapping.GetMemberByNim(affectation.nim);
        Image       Image1      = (Image)e.Item.FindControl("Image1");

        if (member != null)
        {
            Image1.ImageUrl = member.GetPhoto();
        }
        else
        {
            Image1.ImageUrl = Const.MEMBERS_NOPHOTO_H;
        }

        Label LBL_Club = (Label)e.Item.FindControl("LBL_Club");

        LBL_Club.Text = DataMapping.GetClub(affectation.cric).name;

        Label LBL_Nom = (Label)e.Item.FindControl("LBL_Nom");

        LBL_Nom.Text = affectation.name;

        HyperLink HL_Contact = (HyperLink)e.Item.FindControl("HL_Contact");

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

            if (member.IsWoman() == true)
            {
                HL_Contact.Text = "La contacter";
            }
        }
        else
        {
            HL_Contact.Visible = false;
        }
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string id = "" + Request.QueryString["id"];

            if (id == "")
            {
                throw new Exception("La commande est introuvable sans parametre id (querystring : " + Request.QueryString + ")");
            }


            Order commande = DataMapping.GetOrderByGuid(id);
            if (commande == null)
            {
                throw new Exception("La commande " + id + " est introuvable");
            }


            Payment reglement = DataMapping.GetPayment(commande.id_payment);
            if (reglement == null)
            {
                throw new Exception("Le reglement " + commande.id_payment + " de la commande " + id + " est introuvable");
            }

            Club club = DataMapping.GetClub(commande.cric);
            if (club == null)
            {
                throw new Exception("Le club " + commande.club + " est introuvable");
            }

            HF_id.Value           = "" + commande.guid;
            TXT_id.Text           = "" + commande.id;
            TXT_dt.Text           = "" + commande.dt.ToString("dd/MM/yyyy");
            TXT_montant.Text      = commande.amount + " €";
            TXT_club.Text         = club.name;
            HL_Detail.NavigateUrl = Functions.UrlAddParam(Const.ORDER_VIEW_URL, "id", commande.guid);
        }
        catch (Exception ee)
        {
            Functions.Error(ee);
        }
    }
Beispiel #8
0
    protected void gvw_clubs_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Club club = DataMapping.GetClub(int.Parse("" + e.CommandArgument));

        lbl_nomClub.Text    = club.name;
        hfd_cric.Value      = (e.CommandArgument + "");
        pnl_edit.Visible    = true;
        pnl_display.Visible = false;

        tbx_adr1.Text       = club.adress_1;
        tbx_adr2.Text       = club.adress_2;
        tbx_adr3.Text       = club.adress_3;
        tbx_email.Text      = club.email;
        tbx_fax.Text        = club.fax;
        tbx_meetAdr1.Text   = club.meeting_adr1;
        tbx_meetAdr2.Text   = club.meeting_adr2;
        tbx_meetings.Text   = club.meetings;
        tbx_meetTown.Text   = club.meeting_town;
        tbx_meetZip.Text    = club.meeting_zip;
        tbx_tel.Text        = club.telephone;
        tbx_text.Text       = club.text;
        tbx_town.Text       = club.town;
        tbx_web.Text        = club.web;
        tbx_zip.Text        = club.zip;
        img_fanion.ImageUrl = club.GetPennant();

        if (club.club_type != "rotaract")
        {
            tbx_clubRotaract.Text = "";
            pnl_rotaract.Visible  = false;
            btn_delete.Visible    = false;


            tbx_adr1.Enabled     = false;
            tbx_adr2.Enabled     = false;
            tbx_adr3.Enabled     = false;
            tbx_email.Enabled    = false;
            tbx_fax.Enabled      = false;
            tbx_meetAdr1.Enabled = false;
            tbx_meetAdr2.Enabled = false;

            tbx_meetTown.Enabled = false;
            tbx_meetZip.Enabled  = false;
            tbx_tel.Enabled      = false;

            tbx_town.Enabled = false;
            tbx_web.Enabled  = false;
            tbx_zip.Enabled  = false;

            pnl_notRotaract.Visible = true;
        }
        else
        {
            pnl_rotaract.Visible       = true;
            tbx_clubRotaract.Text      = club.name;
            btn_delete.CommandArgument = "" + club.cric;
            btn_delete.Visible         = true;

            tbx_adr1.Enabled     = true;
            tbx_adr2.Enabled     = true;
            tbx_adr3.Enabled     = true;
            tbx_email.Enabled    = true;
            tbx_fax.Enabled      = true;
            tbx_meetAdr1.Enabled = true;
            tbx_meetAdr2.Enabled = true;

            tbx_meetTown.Enabled = true;
            tbx_meetZip.Enabled  = true;
            tbx_tel.Enabled      = true;

            tbx_town.Enabled = true;
            tbx_web.Enabled  = true;
            tbx_zip.Enabled  = true;

            pnl_notRotaract.Visible = false;
        }

        btn_addClub.Text = "Modifier le club";
    }
Beispiel #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            List <News.Bloc> blocs = new List <News.Bloc>();
            if (!IsPostBack)
            {
                pnl_add.Visible     = HasPermission() && Request.QueryString["edit"] != "true" && Request.QueryString["add"] != "true" && Request.QueryString["delete"] != "true";
                pnl_type.Visible    = Request.QueryString["edit"] == "true" || Request.QueryString["add"] == "true";
                hlk_add.NavigateUrl = Functions.UrlAddParam(Globals.NavigateURL(), "add", "true");
                hlk_add.NavigateUrl = Functions.UrlAddParam(hlk_add.NavigateUrl, "newsid", Request.QueryString["newsid"]);



                string newsid = ("" + Request.QueryString["newsid"]);
                if (newsid == "")
                {
                    Functions.Error(new Exception("Newsid inconnu : " + newsid));
                }

                HL_Print.NavigateUrl = print + "?popUp=true&print=yes&newsid=" + newsid;

                if (("" + Request.QueryString["print"]) != "")
                {
                    Response.Write("<script>window.print();</script>");
                    P_Share.Visible = false;
                }

                News news = DataMapping.GetNews_EN(newsid);
                if (news != null)
                {
                    LBL_Titre.Text = news.title;
                    LBL_Date.Text  = news.dt.ToShortDateString();

                    Club c = DataMapping.GetClub(news.cric);
                    if (c != null)
                    {
                        HLK_Club.Text        = c.name;
                        HLK_Club.NavigateUrl = Request.Url.AbsoluteUri.ToString().Replace(Request.Url.PathAndQuery, "") + "/" + c.seo + "/";
                    }
                    else
                    {
                        HLK_Club.Visible = false;
                    }


                    string blocid = ("" + Request.QueryString["blocid"]);
                    string add    = "" + Request.QueryString["add"];
                    if (blocid != "")
                    {
                        foreach (News.Bloc b in news.GetListBlocs())
                        {
                            if (b.id == blocid)
                            {
                                blocs.Add(b);
                            }
                        }
                    }
                    else
                    {
                        blocs = news.GetListBlocs();
                    }

                    if (add == "true")
                    {
                        blocs = new List <News.Bloc>();
                        News.Bloc bloc = new News.Bloc();
                        bloc.type = "BlocPhotoTop";
                        blocs.Add(bloc);
                    }
                }

                LI_Blocs.DataSource = blocs;
                LI_Blocs.DataBind();
            }
        }
        catch (Exception ee)
        {
            Functions.Error(ee);
        }
    }
Beispiel #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string leCric = "" + Request.QueryString["cric"];
            Club   leClub = null;
            string titre  = "Nouvelles des clubs du Rotary";
            int    zCric  = 0;
            if (!string.IsNullOrEmpty(leCric))
            {
                int.TryParse(leCric, out zCric);
                DataMapping.GetClub(zCric);
            }

            if (zCric > 0)
            {
                leClub = DataMapping.GetClub(zCric);
                if (leClub != null && !string.IsNullOrEmpty(leClub.name))
                {
                    titre = "Nouvelles du club " + leClub.name;
                }
            }

            Response.Clear();
            Response.ContentType = "text/xml";
            XmlTextWriter feedWriter = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);

            feedWriter.WriteStartDocument();

            // These are RSS Tags
            feedWriter.WriteStartElement("rss");
            feedWriter.WriteAttributeString("version", "2.0");

            feedWriter.WriteStartElement("channel");
            feedWriter.WriteElementString("title", titre + " (district 1730)");
            feedWriter.WriteElementString("link", "http://www.rotary1730.org/");
            feedWriter.WriteElementString("description", titre + " (district 1730 : Var - Alpes-Maritimes - Monaco - Corse)");
            feedWriter.WriteElementString("copyright",
                                          "Copyright 2015 www.rotary1730.org. All rights reserved.");

            List <News> news = DataMapping.ListNews(category: "Clubs", cric: zCric, top: " TOP 20 ");
            if (news != null)
            {
                foreach (News post in news)
                {
                    feedWriter.WriteStartElement("item");
                    feedWriter.WriteElementString("title", RemoveIllegalCharacters(post.title));
                    feedWriter.WriteElementString("pubDate", string.Format("{0:r}", post.dt));
                    feedWriter.WriteElementString("description", RemoveIllegalCharacters(post.text));
                    feedWriter.WriteElementString("link", "http://www.rotary1730.org/LesNouvelles/Clubs.aspx?cric=" + zCric + "&newsid=" + post.id);

                    feedWriter.WriteEndElement();
                }
            }

            // Close all open tags tags
            feedWriter.WriteEndElement();
            feedWriter.WriteEndElement();
            feedWriter.WriteEndDocument();
            feedWriter.Flush();
            feedWriter.Close();

            Response.End();
        }
        catch (Exception ee)
        {
            Functions.Error(ee);
        }
    }
Beispiel #11
0
    /// <summary>
    /// Permet à l'utilisateur d'enregistrer les modifications apportées
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void BT_Valider_Click(object sender, EventArgs e)
    {
        try
        {
            int cric = 0;
            int.TryParse(HF_Cric.Value, out cric);
            if (cric != 0)
            {
                Club club = DataMapping.GetClub(cric);
                //Club club = DataMapping.GetClub(6560);
                if (club != null)
                {
                    club.meetings = TXT_Reunions.Content;
                    club.text     = TXT_Texte.Content;
                    club.web      = TXT_Url.Text.Trim();

                    if (club.club_type == Const.Club_Rotaract)
                    {
                        club.name = tbx_nom.Text;

                        club.meeting_adr1 = TXT_Reunion_Adr1.Text;
                        club.meeting_adr2 = TXT_Reunion_Adr2.Text;
                        club.meeting_zip  = TXT_Reunion_CP.Text;
                        club.meeting_town = TXT_Reunion_Ville.Text;
                        club.longitude    = TXT_Longitude.Text;
                        club.latitude     = TXT_Latitude.Text;

                        club.adress_1          = tbx_adresse1.Text;
                        club.adress_2          = tbx_adresse2.Text;
                        club.adress_3          = tbx_adresse3.Text;
                        club.zip               = tbx_cp.Text;
                        club.town              = tbx_ville.Text;
                        club.telephone         = tbx_telephone.Text;
                        club.fax               = tbx_fax.Text;
                        club.email             = tbx_email.Text;
                        club.seo               = tbx_seo.Text;
                        club.web               = tbx_url.Text.Trim();
                        club.former_presidents = tbx_anciens_presidents.Text;

                        club.pennant = HF_Logo.Value;
                    }

                    if (DataMapping.UpdateClub(club))
                    {
                        // BT_Valider.Style.Add("visibility", "hidden");
                        if (club.club_type == Const.Club_Rotaract)
                        {
                            if (Session[HF_Logo.Value] != null)
                            {
                                string        chemin = PortalSettings.Current.HomeDirectory + Const.CLUBS_PREFIX + Const.PENNANT_PREFIX + HF_Logo.Value;
                                DirectoryInfo d      = new DirectoryInfo(Server.MapPath(PortalSettings.Current.HomeDirectory + Const.CLUBS_PREFIX + Const.PENNANT_PREFIX));
                                if (!d.Exists)
                                {
                                    d.Create();
                                }
                                File.WriteAllBytes(Server.MapPath(chemin), ((Media)Session[HF_Logo.Value]).content);

                                Session[HF_Logo.Value] = null;
                            }
                        }
                    }
                    else
                    {
                        throw new Exception("Update du club cric : " + cric + " impossible!");
                    }
                }
            }
        }
        catch (Exception ee)
        {
            Functions.Error(ee);
        }
    }
Beispiel #12
0
    /// <summary>
    /// Lors du chargement de la page, synchronise les controles avec les données
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //if (IsPostBack)
            //{
            HF_Nb_Member.Value = messSupp;
            if (Functions.CurrentCric == 0)
            {
                lbl_noClub.Visible = true;
            }
            else
            {
                lbl_noClub.Visible = false;
            }
            if (Request.QueryString["ref"] == null || Request.QueryString["ref"] != "new")
            {
                if (HF_Cric.Value != Functions.CurrentCric + "")
                {
                    //HF_Cric.Value = "" + 6560;
                    HF_Cric.Value = "" + Functions.CurrentCric;

                    Club club = DataMapping.GetClub(Functions.CurrentCric);
                    //Club club = DataMapping.GetClub(6560);
                    if (club != null)
                    {
                        LBL_Nom.Text = club.name;

                        tbx_nom.Text = club.name;

                        TXT_Reunions.Content = club.meetings;
                        TXT_Texte.Content    = club.text;
                        TXT_Url.Text         = club.web;

                        TXT_Latitude.Text      = club.latitude;
                        TXT_Longitude.Text     = club.longitude;
                        TXT_Reunion_Adr1.Text  = club.meeting_adr1;
                        TXT_Reunion_Adr2.Text  = club.meeting_adr2;
                        TXT_Reunion_CP.Text    = club.meeting_zip;
                        TXT_Reunion_Ville.Text = club.meeting_town;

                        tbx_adresse1.Text           = club.adress_1;
                        tbx_adresse2.Text           = club.adress_2;
                        tbx_adresse3.Text           = club.adress_3;
                        tbx_cp.Text                 = club.zip;
                        tbx_ville.Text              = club.town;
                        tbx_telephone.Text          = club.telephone;
                        tbx_fax.Text                = club.fax;
                        tbx_email.Text              = club.email;
                        tbx_seo.Text                = club.seo;
                        tbx_url.Text                = club.web;
                        tbx_anciens_presidents.Text = club.former_presidents;

                        if (club.pennant != "")
                        {
                            IMG_Logo.ImageUrl = club.GetPennant();
                        }
                        else
                        {
                            IMG_Logo.ImageUrl = Const.MEMBERS_NOPHOTO_F;
                        }
                        HF_Logo.Value           = club.pennant;
                        BT_Effacer_Logo.Visible = club.pennant != "";

                        //BT_Valider.Style.Add("visibility", "hidden");
                        //TXT_Texte.Attributes.Add("onchange", "javascript: AfficheValider();");
                        //TXT_Reunions.Attributes.Add("onchange", "javascript: AfficheValider();");
                        //TXT_Longitude.Attributes.Add("onchange", "javascript: AfficheValider();");
                        //TXT_Latitude.Attributes.Add("onchange", "javascript: AfficheValider();");
                        //TXT_Reunion_Adr1.Attributes.Add("onchange", "javascript: AfficheValider();");
                        //TXT_Reunion_Adr2.Attributes.Add("onchange", "javascript: AfficheValider();");
                        //TXT_Reunion_CP.Attributes.Add("onchange", "javascript: AfficheValider();");
                        //TXT_Reunion_Ville.Attributes.Add("onchange", "javascript: AfficheValider();");
                        //TXT_Url.Attributes.Add("onchange", "javascript: AfficheValider();");

                        if (club.club_type == Const.Club_Rotaract && (UserInfo.IsInRole(Const.ROLE_ADMIN_ROTARACT) || UserInfo.IsSuperUser))
                        {
                            pnl_Club.Visible    = true;
                            pnl_Reunion.Visible = true;
                            Label9.Visible      = false;
                            TXT_Url.Visible     = false;
                            lblnom.Visible      = false;
                            LBL_Nom.Visible     = false;
                            BT_Ajout.Visible    = false;

                            int cric = 0;
                            int.TryParse(HF_Cric.Value, out cric);
                            if (cric != 0)
                            {
                                List <Member> ListeM = DataMapping.ListMembers(cric: cric);
                                if (ListeM != null)
                                {
                                    if (ListeM.Count == 1)
                                    {
                                        HF_Nb_Member.Value = HF_Nb_Member.Value + "? Attention, le membre de ce club sera supprimé!";
                                    }
                                    else if (ListeM.Count > 1)
                                    {
                                        HF_Nb_Member.Value = HF_Nb_Member.Value + "? Attention, les " + ListeM.Count() + " membres de ce club seront supprimés!";
                                    }
                                    else
                                    {
                                        HF_Nb_Member.Value = HF_Nb_Member.Value + " (aucun membre dans ce club)?";
                                    }
                                }
                                else
                                {
                                    HF_Nb_Member.Value = HF_Nb_Member.Value + " (aucun membre dans ce club)?";
                                }

                                BT_Supprimer.Visible = true;
                                //    BT_Supprimer.Enabled = true;
                                //}
                                //else
                                //{
                                //    BT_Supprimer.Visible = true;
                                //    BT_Supprimer.Enabled = false;
                                //    if (ListeM.Count == 1)
                                //    {
                                //        BT_Supprimer.ToolTip = "Impossible de supprimer le club car il y a " + ListeM.Count + " membre rattaché au club !";
                                //    }
                                //    else if (ListeM.Count > 1)
                                //    {
                                //        BT_Supprimer.ToolTip = "Impossible de supprimer le club car il y a " + ListeM.Count + " membres rattachés au club !";
                                //    }
                                //}
                                //}
                                //else
                                //{
                                //    BT_Supprimer.Visible = false;
                                //}
                            }
                            else
                            {
                                pnl_Club.Visible     = false;
                                pnl_Reunion.Visible  = false;
                                Label9.Visible       = true;
                                TXT_Url.Visible      = true;
                                lblnom.Visible       = true;
                                LBL_Nom.Visible      = true;
                                BT_Supprimer.Visible = false;
                                BT_Ajout.Visible     = false;
                            }
                        }
                        else
                        {
                            BT_Supprimer.Visible = false;
                            BT_Ajout.Visible     = false;
                        }
                    }
                    P1.Visible = HF_Cric.Value != "0";
                }
            }
            else     //Ajout club ROTARACT
            {
                if (UserInfo.IsInRole(Const.ROLE_ADMIN_ROTARACT) || UserInfo.IsSuperUser)
                {
                    pnl_Club.Visible     = true;
                    pnl_Reunion.Visible  = true;
                    Label9.Visible       = false;
                    TXT_Url.Visible      = false;
                    lblnom.Visible       = false;
                    LBL_Nom.Visible      = false;
                    BT_Supprimer.Visible = false;
                    BT_Valider.Visible   = false;
                    BT_Ajout.Visible     = true;

                    BT_Effacer_Logo.Visible = false;
                    IMG_Logo.ImageUrl       = Const.MEMBERS_NOPHOTO_H;
                }
            }
            //}
            if (UserInfo.IsSuperUser || UserInfo.IsInRole(Const.ROLE_ADMIN_CLUB) || UserInfo.IsInRole(Const.ROLE_ADMIN_DISTRICT))
            {
                BT_Presentation.Visible = true;
            }
            else
            {
                BT_Presentation.Visible = false;
            }
        }
        catch (Exception ee)
        {
            Functions.Error(ee);
        }
    }
Beispiel #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = 0;

        int.TryParse("" + Request.QueryString["id"], out id);
        if (id > 0)
        {
            Member member = DataMapping.GetMember(id);
            if (member != null)
            {
                HF_id.Value     = "" + id;
                TXT_membre.Text = member.name + " " + member.surname;

                PortalSettings ps = PortalController.GetCurrentPortalSettings();
                if (ps.UserInfo.Roles != null && ps.UserInfo.Roles.Count() > 0)
                {
                    td_Coord.Visible  = true;
                    Pnl_Coord.Visible = true;

                    Table tbC = new Table();

                    #region Cartouche
                    //if(!string.IsNullOrEmpty(membre.photo))
                    //{
                    TableRow trC = new TableRow();

                    TableCell tdC       = new TableCell();
                    Image     IMG_Logo2 = new Image();
                    IMG_Logo2.ImageUrl = member.GetPhoto();
                    tdC.Controls.Add(IMG_Logo2);
                    trC.Controls.Add(tdC);


                    TableCell tdC2 = new TableCell();

                    Panel p = new Panel();

                    Label lbNom = new Label();
                    lbNom.Text      = member.name + "  " + member.surname;
                    lbNom.Font.Bold = true;
                    lbNom.Font.Size = FontUnit.Point(14);
                    p.Controls.Add(lbNom);

                    Literal lit = new Literal();
                    lit.Text = "<br/>";
                    p.Controls.Add(lit);

                    Club club = DataMapping.GetClub(member.cric);
                    if (club != null)
                    {
                        HyperLink lbclub = new HyperLink();
                        lbclub.Text        = club.name;
                        lbclub.NavigateUrl = Request.Url.AbsoluteUri.ToString().Replace(Request.Url.PathAndQuery, "") + "/" + club.seo + "/";
                        lbclub.Target      = "_top";
                        p.Controls.Add(lbclub);

                        Literal lit2 = new Literal();
                        lit2.Text = "<br/>";
                        p.Controls.Add(lit2);
                    }

                    #region metier
                    string metier = "";
                    if (!string.IsNullOrEmpty(member.job))
                    {
                        metier = member.job;
                    }

                    if (!string.IsNullOrEmpty(metier))
                    {
                        metier = metier + " | ";
                    }

                    if (!string.IsNullOrEmpty(member.retired) && member.retired == "O")
                    {
                        if (member.IsWoman())
                        {
                            metier = metier + "Retraité";
                        }
                        else
                        {
                            metier = metier + "Retraitée";
                        }
                    }
                    else
                    {
                        metier = metier + "En activité";
                    }

                    if (!string.IsNullOrEmpty(metier))
                    {
                        Label lbmetier = new Label();
                        lbmetier.Text = metier;
                        p.Controls.Add(lbmetier);

                        //p.Controls.Add(lit);
                        Literal lit3 = new Literal();
                        lit3.Text = "<br/>";
                        p.Controls.Add(lit3);
                    }
                    #endregion metier

                    if (!string.IsNullOrEmpty(member.industry))
                    {
                        Label lbBranche = new Label();
                        lbBranche.Text = member.industry;
                        p.Controls.Add(lbBranche);
                    }

                    tdC2.Controls.Add(p);
                    trC.Controls.Add(tdC2);

                    tbC.Controls.Add(trC);
                    //}

                    #endregion Cartouche

                    Pnl_Coord.Controls.Add(tbC);

                    Table tb = new Table();

                    #region Coordonnées Pro
                    if (!string.IsNullOrEmpty(member.professionnal_adress) || !string.IsNullOrEmpty(member.professionnal_tel) || !string.IsNullOrEmpty(member.professionnal_fax) || !string.IsNullOrEmpty(member.professionnal_mobile) || !string.IsNullOrEmpty(member.professionnal_email))
                    {
                        TableRow  trH = new TableRow();
                        TableCell tdH = new TableCell();
                        tdH.ColumnSpan = 2;
                        Label lH = new Label();
                        lH.Text      = "Coordonnées professionnelles : ";
                        lH.Font.Bold = true;
                        tdH.Controls.Add(lH);
                        trH.Controls.Add(tdH);
                        tb.Controls.Add(trH);


                        if (!string.IsNullOrEmpty(member.professionnal_adress))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Adresse : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            Label     l  = new Label();
                            l.Text = member.professionnal_adress;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);
                            tb.Controls.Add(tr);

                            if (!string.IsNullOrEmpty(member.professionnal_zip_code) && !string.IsNullOrEmpty(member.professionnal_town))
                            {
                                TableRow tr2 = new TableRow();

                                TableCell tdLabel2 = new TableCell();
                                Label     lab2     = new Label();
                                lab2.Text  = "";
                                lab2.Width = Unit.Pixel(80);
                                tdLabel2.Controls.Add(lab2);
                                tr2.Controls.Add(tdLabel2);

                                TableCell td2 = new TableCell();
                                Label     l2  = new Label();
                                l2.Text = member.professionnal_zip_code + " " + member.professionnal_town;
                                td2.Controls.Add(l2);
                                tr2.Controls.Add(td2);
                                tb.Controls.Add(tr2);
                            }
                        }

                        if (!string.IsNullOrEmpty(member.professionnal_tel))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Téléphone : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            Label     l  = new Label();
                            l.Text = member.professionnal_tel;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);

                            tb.Controls.Add(tr);
                        }

                        if (!string.IsNullOrEmpty(member.professionnal_fax))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Fax : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            Label     l  = new Label();
                            l.Text = member.professionnal_fax;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);

                            tb.Controls.Add(tr);
                        }

                        if (!string.IsNullOrEmpty(member.professionnal_mobile))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Mobile : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            Label     l  = new Label();
                            l.Text = member.professionnal_mobile;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);

                            tb.Controls.Add(tr);
                        }

                        if (!string.IsNullOrEmpty(member.professionnal_email))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Email : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            HyperLink l  = new HyperLink();
                            l.Text        = member.professionnal_email;
                            l.NavigateUrl = "mailto:" + member.professionnal_email;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);

                            tb.Controls.Add(tr);
                        }

                        //Pour le saut de ligne entre les coord pro et coord perso
                        TableRow  trF = new TableRow();
                        TableCell tdF = new TableCell();
                        tdF.ColumnSpan = 2;
                        Label lF = new Label();
                        lF.Height = Unit.Pixel(15);
                        lF.Text   = "";
                        tdF.Controls.Add(lF);
                        trF.Controls.Add(tdF);
                        tb.Controls.Add(trF);
                    }
                    #endregion Coordonnées Pro

                    #region Coordonnées Perso
                    if (!string.IsNullOrEmpty(member.adress_1) || !string.IsNullOrEmpty(member.telephone) || !string.IsNullOrEmpty(member.fax) || !string.IsNullOrEmpty(member.gsm) || !string.IsNullOrEmpty(member.email))
                    {
                        TableRow  trH = new TableRow();
                        TableCell tdH = new TableCell();
                        tdH.ColumnSpan = 2;
                        Label lH = new Label();
                        lH.Text      = "Coordonnées personnelles : ";
                        lH.Font.Bold = true;
                        tdH.Controls.Add(lH);
                        trH.Controls.Add(tdH);
                        tb.Controls.Add(trH);


                        if (!string.IsNullOrEmpty(member.adress_1))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Adresse : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            Label     l  = new Label();
                            l.Text = member.adress_1;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);
                            tb.Controls.Add(tr);

                            if (!string.IsNullOrEmpty(member.adress_2))
                            {
                                TableRow tr2 = new TableRow();

                                TableCell tdLabel2 = new TableCell();
                                Label     lab2     = new Label();
                                lab2.Text  = "";
                                lab2.Width = Unit.Pixel(80);
                                tdLabel2.Controls.Add(lab2);
                                tr2.Controls.Add(tdLabel2);

                                TableCell td2 = new TableCell();
                                Label     l2  = new Label();
                                l2.Text = member.adress_2;
                                td2.Controls.Add(l2);
                                tr2.Controls.Add(td2);
                                tb.Controls.Add(tr2);
                            }

                            if (!string.IsNullOrEmpty(member.adress_3))
                            {
                                TableRow tr2 = new TableRow();

                                TableCell tdLabel2 = new TableCell();
                                Label     lab2     = new Label();
                                lab2.Text  = "";
                                lab2.Width = Unit.Pixel(80);
                                tdLabel2.Controls.Add(lab2);
                                tr2.Controls.Add(tdLabel2);

                                TableCell td2 = new TableCell();
                                Label     l2  = new Label();
                                l2.Text = member.adress_3;
                                td2.Controls.Add(l2);
                                tr2.Controls.Add(td2);
                                tb.Controls.Add(tr2);
                            }

                            if (!string.IsNullOrEmpty(member.zip_code) && !string.IsNullOrEmpty(member.town))
                            {
                                TableRow tr2 = new TableRow();

                                TableCell tdLabel2 = new TableCell();
                                Label     lab2     = new Label();
                                lab2.Text  = "";
                                lab2.Width = Unit.Pixel(80);
                                tdLabel2.Controls.Add(lab2);
                                tr2.Controls.Add(tdLabel2);

                                TableCell td2 = new TableCell();
                                Label     l2  = new Label();
                                l2.Text = member.zip_code + " " + member.town;
                                td2.Controls.Add(l2);
                                tr2.Controls.Add(td2);
                                tb.Controls.Add(tr2);
                            }
                        }

                        if (!string.IsNullOrEmpty(member.telephone))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Téléphone : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            Label     l  = new Label();
                            l.Text = member.telephone;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);

                            tb.Controls.Add(tr);
                        }

                        if (!string.IsNullOrEmpty(member.fax))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Fax : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            Label     l  = new Label();
                            l.Text = member.fax;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);

                            tb.Controls.Add(tr);
                        }

                        if (!string.IsNullOrEmpty(member.gsm))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Mobile : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            Label     l  = new Label();
                            l.Text = member.gsm;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);

                            tb.Controls.Add(tr);
                        }

                        if (!string.IsNullOrEmpty(member.email))
                        {
                            TableRow tr = new TableRow();

                            TableCell tdLabel = new TableCell();
                            Label     lab     = new Label();
                            lab.Text  = "Email : ";
                            lab.Width = Unit.Pixel(80);
                            tdLabel.Controls.Add(lab);
                            tr.Controls.Add(tdLabel);

                            TableCell td = new TableCell();
                            HyperLink l  = new HyperLink();
                            l.Text        = member.email;
                            l.NavigateUrl = "mailto:" + member.email;
                            td.Controls.Add(l);
                            tr.Controls.Add(td);

                            tb.Controls.Add(tr);
                        }
                    }
                    #endregion Coordonnées Perso

                    Pnl_Coord.Controls.Add(tb);
                }
            }
        }
    }
Beispiel #14
0
    /// <summary>
    /// Récupère les données nécessaires et les affiche
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            if (DL_Clubs.SelectedIndex == 0)
            {
                Functions.CurrentClub = null;
                return;
            }
            int cric = 0;
            int.TryParse(DL_Clubs.SelectedValue, out cric);
            Club club = DataMapping.GetClub(cric);
            Functions.CurrentClub = club;
            return;
        }



        List <Club> clubs = new List <Club>();

        if (UserInfo.IsSuperUser)
        {
            clubs = DataMapping.ListClubs(sort: "name asc");
        }

        else if (UserInfo.IsInRole(Const.ROLE_ADMIN_ROTARACT))
        {
            clubs = DataMapping.ListClubs(club_type: "rotaract", sort: "name asc");
        }
        else
        {
            Member curmem = Functions.GetCurrentMember();
            if (curmem != null && DataMapping.isADG(curmem.id))
            {
                List <Domain> listeDomFinale = new List <Domain>();
                List <Domain> listeDom       = DataMapping.GetListDomain("ADG", "");
                foreach (Domain dom in listeDom)
                {
                    if (UserInfo.IsInRole(dom.subdomain))
                    {
                        listeDomFinale.Add(dom);
                    }
                }
                foreach (Domain dom in listeDomFinale)
                {
                    Club club = DataMapping.GetClub(int.Parse(dom.value));
                    clubs.Add(club);
                }
            }
            else
            {
                clubs = DataMapping.ListClubs(sort: "name asc");
            }
        }

        DL_Clubs.Items.Clear();
        DL_Clubs.Items.Add(new ListItem("--- Tous ---", "")
        {
            Selected = true
        });
        foreach (Club c in clubs)
        {
            DL_Clubs.Items.Add(new ListItem(c.name, "" + c.cric));
        }
        if (Functions.CurrentClub != null)
        {
            DL_Clubs.SelectedValue = "" + Functions.CurrentClub.cric;
        }

        //if (UserInfo.IsInRole(Const.ROLE_ADMIN_ROTARACT) || UserInfo.IsSuperUser || UserInfo.IsInRole(Const.ROLE_ADMIN_DISTRICT))
        //{
        //    BT_Ajouter.Visible = true;
        //}
    }
Beispiel #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string newsid = ("" + Request.QueryString["newsid"]);

        if (newsid == "")
        {
            Functions.Error(new Exception("Newsid inconnu : " + newsid));
        }
        News news = DataMapping.GetNews(newsid);

        if (news != null)
        {
            LBL_Titre.Text = news.title;

            string texte = news.text;
            texte = texte.Replace(Environment.NewLine, "<br />");
            if (texte.IndexOf("http") > -1)
            {
                int st    = 0;
                int index = texte.IndexOf("http");
                while (st <= texte.Length && index > -1)
                {
                    index = texte.IndexOf("http", index);
                    int index1 = texte.IndexOf("<", index);
                    if (index1 > index)
                    {
                        string url = texte.Substring(index, index1 - index);

                        url   = "<a href=\"" + url + "\" target=\"_blank\">" + url + "</a>";
                        texte = texte.Substring(0, index) + url + texte.Substring(index1);

                        st = texte.Substring(0, index).Length + url.Length;
                    }
                    else
                    {
                        int index2 = texte.IndexOf("<", index);
                        if (index2 > index)
                        {
                            string url = texte.Substring(index, index2 - index);

                            url   = "<a href=\"" + url + "\" target=\"_blank\">" + url + "</a>";
                            texte = texte.Substring(0, index) + url + texte.Substring(index2);

                            st = texte.Substring(0, index).Length + url.Length;
                        }
                        else
                        {
                            st = index + 6;
                        }
                    }
                    index = texte.IndexOf("http", st);
                }
            }

            LBL_Detail.Text = texte;

            LBL_Date.Text      = news.dt.ToShortDateString();
            Image1.ImageUrl    = news.GetPhoto();
            Image1.Visible     = Image1.ImageUrl != "";
            HL_Url.NavigateUrl = news.GetUrl();
            HL_Url.Text        = news.url_text;
            HL_Url.Visible     = news.url.Trim() != "";
            LBL_Url.Visible    = HL_Url.Visible;

            Club c = DataMapping.GetClub(news.cric);
            if (c != null)
            {
                HLK_Club.Text        = c.name;
                HLK_Club.NavigateUrl = Request.Url.AbsoluteUri.ToString().Replace(Request.Url.PathAndQuery, "") + "/" + c.seo + "/";
            }
            else
            {
                HLK_Club.Visible = false;
            }
        }
    }