Exemplo n.º 1
0
 private void UC_Home_Load(object sender, EventArgs e)
 {
     OneSemaine(InstantRound.GetInstance().Id);
     ChartCotisation();
     RefreshData(new Cotisation());
     lblMax.Text = dgCotisation.Rows.Count.ToString();
 }
Exemplo n.º 2
0
        void SavePhone()
        {
            Telephone telephone = new Telephone();

            telephone.Id        = idPhone;
            telephone.Initial   = initial.Text;
            telephone.Numero    = contactTxt.Text;
            telephone.RefMembre = InstantRound.GetInstance().IdMembre;

            telephone.Enregistrer(telephone);
        }
Exemplo n.º 3
0
 void RefreshDatas(IInscription insc)
 {
     if (radioAgent.Checked == true)
     {
         dgInscit.DataSource = insc.AllAgent();
     }
     else if (radioMembre.Checked == true)
     {
         dgInscit.DataSource = insc.AllInscriptionsRound(InstantRound.GetInstance().Id);
     }
 }
Exemplo n.º 4
0
        void SaveInscription()
        {
            IInscription I = new Inscription();

            I.Id          = Convert.ToInt32(idInscription);
            I.RefMembre   = idMembre;
            I.RefRound    = InstantRound.GetInstance().Id;
            I.UserSession = UserSession.GetInstance().UserName.ToString();

            I.Enregistrer(I);
        }
Exemplo n.º 5
0
        void ActionLancement()
        {
            RefreshDatas(new Inscription());
            lblMax.Text  = InstantRound.GetInstance().LimiteInscription().ToString() + " Membres";
            lblDeja.Text = InstantRound.GetInstance().CountInscription().ToString() + " Membres";

            if (lblDeja.Text == lblMax.Text)
            {
                lblEtat.Visible = true;
            }
        }
Exemplo n.º 6
0
 private void Button4_Click(object sender, EventArgs e)
 {
     if (InstantRound.GetInstance().IdMembre == 0)
     {
         MessageBox.Show("Veuillez selectionner un membre dans le Tableau");
     }
     else
     {
         MiniFormAdresse m = new MiniFormAdresse();
         m.ShowDialog();
     }
 }
Exemplo n.º 7
0
        void SaveDomicile()
        {
            Domicile dom = new Domicile();

            dom.Id         = idDomicile;
            dom.Avenue     = avenueTxt.Text;
            dom.Numero     = numTxt.Text;
            dom.RefAdresse = idAdresse;
            dom.RefMembre  = InstantRound.GetInstance().IdMembre;

            dom.Enregistrer(dom);
        }
Exemplo n.º 8
0
        private void DgInscit_SelectionChanged(object sender, EventArgs e)
        {
            try
            {
                int i;
                i = dgInscit.CurrentRow.Index;


                InstantRound.GetInstance().IdMembre = Convert.ToInt32(dgInscit["idM", i].Value.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show("L'erreur suivant est survenue : " + ex.Message);
            }
        }
Exemplo n.º 9
0
        void SaveMembre()
        {
            Membre membre = new Membre();

            GenererQrCode();
            InstantRound.GetInstance().IdMembre = idMembre;
            membre.Id            = idMembre;
            membre.Matricule     = "00000000";
            membre.Nom           = nomTxt.Text;
            membre.Postnom       = pnomTxt.Text;
            membre.Prenom        = prenomTxt.Text;
            membre.Sex           = sexeTxt.Text.Equals(Sexe.Masculin.ToString()) ? Sexe.Masculin : Sexe.Féminin;
            membre.DateNaiss     = DateTime.Parse(dateNaissTxt.Text);
            membre.LieuNaiss     = lieuTxt.Text;
            membre.Profession    = professionTxt.Text;
            membre.QrCode        = qrCode.Image;
            membre.Photo         = photo.Image;
            membre.RefMandataire = idMandataire;

            membre.Enregistrer(membre);
        }
Exemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (userTxt.Text == "" || passTxt.Text == "" || tontineCombo.Text == "")
                {
                    MessageBox.Show("Veuillez completez tout les champs svp !!!", "Erreur de connection", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    PubCon.testlog = DynamicClasses.GetInstance().loginTest(userTxt.Text, passTxt.Text);
                    InstantRound.GetInstance().Id = dn.retourId("Id", "TRound", "Designation", tontineCombo.Text);
                    //Envoyer();
                    if (PubCon.testlog == 1)
                    {
                        if (UserSession.GetInstance().Etat == "Bloquer")
                        {
                            MessageBox.Show("Vous n'etes pas autorisez à vous connecter veuillez contacter un administrateur", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }
                        else
                        {
                            MessageBox.Show("La connection a reussie !!!", "Message Serveur...", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            this.Close();
                            Principale_Form frm = new Principale_Form();
                            frm.ChargerUser(new UC_Home());
                        }

                        //frm.Show();
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 11
0
 void RefreshData(Cotisation cot)
 {
     dgCotisation.DataSource = cot.AllCotisationSemaine(InstantSemaine.GetInstance().IdSemaine, InstantRound.GetInstance().Id);
 }
Exemplo n.º 12
0
        public void SendSMSDettes()
        {
            bool   envoie      = true;
            string numero      = "";
            string message     = "";
            string codeMs      = "";
            string utilisateur = "";
            string dateEnvoie  = "";
            string Etat        = "";
            int    count       = 0;

            try
            {
                innitialiseConnect();
                if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
                {
                    ImplementeConnexion.Instance.Conn.Open();
                }

                cmd             = new SqlCommand("SELECT_SMS_DETTE", (SqlConnection)ImplementeConnexion.Instance.Conn);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 30, DbType.String, InstantRound.GetInstance().Id));

                dr = cmd.ExecuteReader();

                while (dr.Read())
                {
                    numero  = dr["Numero"].ToString();
                    message = dr["Message"].ToString();


                    if (numero != "" && message != "" && count != 1)
                    {
                        ClsMessages ms = new ClsMessages();
                        if (message.Length <= 140)
                        {
                            //update_Valmsg(codeMs);
                            if (ms.sendshortMsg(numero, message) == false)
                            {
                                if (ms.sendlongMsg(numero, message + "                                                   ") == false)
                                {
                                    envoie = false;
                                    //ClsSMS msInsert = new ClsSMS();
                                    //msInsert.NumeroTutaire1 = numero;
                                    //msInsert.CorpsMessage1 = message;
                                    //msInsert.DateEnvoie1 = dateEnvoie;
                                    //msInsert.EtatSms1 = 0;
                                    //msInsert.Utilisateur1 = utilisateur;
                                    //insert_Messagerie(msInsert);

                                    numero      = "";
                                    message     = "";
                                    codeMs      = "";
                                    dateEnvoie  = "";
                                    utilisateur = "";
                                    Etat        = "";
                                }
                            }
                            else
                            {
                                envoie      = true;
                                numero      = "";
                                message     = "";
                                codeMs      = "";
                                dateEnvoie  = "";
                                utilisateur = "";
                                Etat        = "";
                            }
                        }
                        else
                        {
                            //update_Valmsg(codeMs);
                            if (ms.sendlongMsg(numero, message) == true)
                            {
                                numero  = "";
                                message = "";
                                envoie  = true;
                            }
                            else
                            {
                                envoie = false;

                                //ClsSMS msInsert = new ClsSMS();
                                //msInsert.CorpsMessage1 = message;
                                //msInsert.DateEnvoie1 = dateEnvoie;
                                //msInsert.EtatSms1 = 0;
                                //msInsert.Utilisateur1 = utilisateur;
                                //insert_Messagerie(msInsert);
                            }
                        }
                        //update set statutMessage='non'
                    }
                }
                //dr.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                envoie = false;

                //ClsSMS msInsert = new ClsSMS();
                //msInsert.CorpsMessage1 = message;
                //msInsert.DateEvoie1 = DateTime.Parse(dateEnvoie);
                //msInsert.EtatSms1 = 0;
                //msInsert.Utilisateur1 = utilisateur;
                //insert_Messagerie(msInsert);
            }

            finally
            {
                con.Close();
            }


            //return envoie;
        }
Exemplo n.º 13
0
        public List <Remboursement> AllRemboursements()
        {
            List <Remboursement> r = new List <Remboursement>();

            //Num = 0;

            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "SELECT_REMBOURSEMENTS_FROM_ROUND";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, InstantRound.GetInstance().Id));

                IDataReader rd = cmd.ExecuteReader();

                while (rd.Read())
                {
                    r.Add(GetDetailsRemboursement(rd));
                }
                rd.Dispose();
            }
            return(r);
        }
Exemplo n.º 14
0
        public string retourLastCotisationMembre(Label champ1, Label champ2, int valeur)
        {
            string   identifiant = "Prémière Cotisation";
            DateTime dateco, datenow = new DateTime();

            datenow = DateTime.Now;


            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = @"SELECT_LAST_COTISATION";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 5, DbType.Int32, valeur));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@idRound", 5, DbType.Int32, InstantRound.GetInstance().Id));

                IDataReader rd = cmd.ExecuteReader();

                if (rd.Read())
                {
                    //if (rd.IsDBNull(1))
                    //{
                    //    dateco = InstantSemaine.GetInstance().DateDebut;
                    //    identifiant = "Début Round";

                    //}
                    //else
                    //{
                    dateco = Convert.ToDateTime(rd["Date_Concernee"].ToString());
                    //identifiant = Convert.ToInt32(rd["Id"].ToString());
                    champ1.Text = string.Format("{0}", dateco.ToString("dd/MM/yyyy"));
                    champ2.Text = rd["Designation"].ToString();
                    //champ3.Text = rd["Postnom"].ToString();
                    if (Convert.ToDateTime(champ1.Text) == datenow.Date)
                    {
                        identifiant = "En ordre";
                    }
                    else if (Convert.ToDateTime(champ1.Text) < datenow.Date)
                    {
                        identifiant = "En retard";
                    }
                    else if (Convert.ToDateTime(champ1.Text) > datenow.Date)
                    {
                        identifiant = "En avance";
                    }
                    //}
                }
                rd.Close();
                rd.Dispose();
                cmd.Dispose();
            }
            return(identifiant);
        }
Exemplo n.º 15
0
        public int retourInfoRembMembre(Label champ1, Label champ2, Label champ3, string valeur, PictureBox photo)
        {
            int identifiant = 0;
            int id          = 0;


            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "SELECT_INFO_REMB";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@noms", 100, DbType.String, valeur));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 5, DbType.Int32, InstantRound.GetInstance().Id));

                IDataReader rd = cmd.ExecuteReader();

                if (rd.Read())
                {
                    champ1.Text = rd["DebutFin"].ToString();
                    champ2.Text = rd["Matricule"].ToString();
                    champ3.Text = rd["Mandataire"].ToString();
                    identifiant = Convert.ToInt32(rd["Id"].ToString());
                    id          = Convert.ToInt32(rd["IdMembre"].ToString());
                }
                rd.Close();
                rd.Dispose();
                cmd.Dispose();
                retreivePhoto(id.ToString(), photo);
            }
            return(identifiant);
        }
Exemplo n.º 16
0
        public void chargeNomsCombo(ComboBox cmb, string nomChamp, string procedure)
        {
            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = procedure;
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 5, DbType.Int32, InstantRound.GetInstance().Id));
                //cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 5, DbType.Int32, InstantSemaine.GetInstance().IdSemaine));

                IDataReader rd = cmd.ExecuteReader();

                while (rd.Read())
                {
                    string de = rd[nomChamp].ToString();
                    cmb.Items.Add(de);
                }
                rd.Close();
                rd.Dispose();
                cmd.Dispose();
            }
        }
Exemplo n.º 17
0
        public int retourIdSemaine(string valeur1)
        {
            int identifiant = 0;

            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = @"select Id  from Affichage_Details_Semaine where DebutFin = '" + valeur1 + "' And IdRound = '" + InstantRound.GetInstance().Id + "'";

                IDataReader rd = cmd.ExecuteReader();

                if (rd.Read())
                {
                    identifiant = int.Parse(rd["Id"].ToString());
                }
                rd.Close();
                rd.Dispose();
                cmd.Dispose();
            }
            return(identifiant);
        }
Exemplo n.º 18
0
        public List <Cotisation> AllDettes()
        {
            List <Cotisation> lst = new List <Cotisation>();

            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "SELECT_ALL_DETTE_ROUND";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, InstantRound.GetInstance().Id));
                IDataReader rd = cmd.ExecuteReader();

                while (rd.Read())
                {
                    lst.Add(GetDetailDettes(rd));
                }
                rd.Dispose();
            }
            return(lst);
        }
Exemplo n.º 19
0
        public void Enregistrer(Semaine sem)
        {
            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "INSERT_SEMAINE";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, Id));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@numero", 4, DbType.Int32, RefInscrit));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@refround", 4, DbType.Int32, InstantRound.GetInstance().Id));


                cmd.ExecuteNonQuery();

                //MessageBox.Show("Enregistrement reussie", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 20
0
        public List <Cotisation> Research(string recherche)
        {
            List <Cotisation> lst = new List <Cotisation>();

            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "SELECT * FROM Affichage_Details_Cotisation WHERE IdRound=" + InstantRound.GetInstance().Id + " AND IdSemaine=" + InstantSemaine.GetInstance().IdSemaine + " AND (Nom LIKE '%" + recherche + "%' OR Postnom LIKE '%" + recherche + "' OR Prenom LIKE '%" + recherche + "')";
                //cmd.CommandType = CommandType.StoredProcedure;

                IDataReader rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    lst.Add(GetDetailCotisation(rd));
                }
                rd.Dispose();
                rd.Close();
            }
            return(lst);
        }
Exemplo n.º 21
0
 void RefreshDatas(IInscription insc)
 {
     dgInscit.DataSource = insc.AllInscriptionsRound(InstantRound.GetInstance().Id);
     sexeTxt.DataSource  = Enum.GetNames(typeof(Sexe));
     dn.chargeCombo(membreCombo, "Nom_Complet", "SELECT_NOM_COMPLET_MEMBRE");
 }
Exemplo n.º 22
0
        public List <IInscription> Research(string recherche)
        {
            List <IInscription> lst = new List <IInscription>();

            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "SELECT * FROM Affichage_Details_Inscriptions WHERE IdRound=" + InstantRound.GetInstance().Id + " AND Nom_Complet LIKE '%" + recherche + "%'";
                //cmd.CommandType = CommandType.StoredProcedure;

                IDataReader rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    lst.Add(GetAllDetailsInscription(rd));
                }
                rd.Dispose();
                rd.Close();
            }
            return(lst);
        }
Exemplo n.º 23
0
        public List <Cotisation> ResearchDette(string recherche)
        {
            List <Cotisation> lst = new List <Cotisation>();

            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "SEARCH_DETTE_ROUND";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 5, DbType.Int32, InstantRound.GetInstance().Id));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@idSemaine", 5, DbType.Int32, InstantSemaine.GetInstance().IdSemaine));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@text", 200, DbType.String, recherche));

                IDataReader rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    Matricule.ToUpper();
                    lst.Add(GetDetailDettes(rd));
                }
                rd.Dispose();
                rd.Close();
            }
            return(lst);
        }
Exemplo n.º 24
0
        private void OneInfoSemaine()
        {
            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }

            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "SELECT_CAISSE_RESTE";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, InstantSemaine.GetInstance().IdSemaine));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@idRound", 4, DbType.Int32, InstantRound.GetInstance().Id));

                IDataReader dr = cmd.ExecuteReader();

                if (dr.Read())
                {
                    lblCaisse.Text = dr["En_Caisse"].ToString();
                    lblReste.Text  = dr["Dette"].ToString();
                }

                dr.Dispose();
            }

            //return semaine;
        }