Exemple #1
0
        public List <MetierTrader.Action> getAllActionsNonPossedees(int numTrader)
        {
            List <MetierTrader.Action> lesActions = new List <MetierTrader.Action>();

            cmd = new MySqlCommand("select idAction, nomAction from action  where ", cnx);
            dr  = cmd.ExecuteReader();
            while (dr.Read())
            {
                MetierTrader.Action act = new MetierTrader.Action(Convert.ToInt16(dr[0].ToString()), dr[1].ToString());
                lesActions.Add(act);
            }
            return(lesActions);
        }
Exemple #2
0
        public List <MetierTrader.Action> getAllActionsNonPossedees(int numTrader)
        {
            List <MetierTrader.Action> lesActions = new List <MetierTrader.Action>();

            cmd = new MySqlCommand("SELECT idAction,nomAction, FROM action INNER JOIN acheter ON action.idAction = acheter.numAction WHERE acheter.numTrader != (Select idTrader from Trader where idTrader =" + numTrader + ")", cnx);
            dr  = cmd.ExecuteReader();
            while (dr.Read())
            {
                MetierTrader.Action uneAction = new MetierTrader.Action(Convert.ToInt16(dr[0].ToString()), dr[1].ToString());
                lesActions.Add(uneAction);
            }
            dr.Close();
            return(lesActions);
        }
        public List <MetierTrader.Action> getAllActionsNonPossedees(int numTrader)
        {
            List <MetierTrader.Action> lesActions = new List <MetierTrader.Action>();

            cmd = new MySqlCommand("select idAction, nomAction, coursReel from action where idAction NOT IN (select numAction from acheter where numTrader=" + numTrader + ");", cnx);
            dr  = cmd.ExecuteReader();
            while (dr.Read())
            {
                MetierTrader.Action uneAction = new MetierTrader.Action(Convert.ToInt16(dr[0]), dr[1].ToString(), Convert.ToDouble(dr[2]));
                lesActions.Add(uneAction);
            }
            dr.Close();
            return(lesActions);
        }
Exemple #4
0
        public List <MetierTrader.Action> getAllActionsNonPossedees(int numTrader)
        {
            List <MetierTrader.Action> lesActionsNonPosseder = new List <MetierTrader.Action>();

            cmd = new MySqlCommand("select idAction, nomAction from action where idAction not in (select numAction from action a inner join acheter ac on a.idAction = ac.numAction where numTrader =" + numTrader + ")", cnx);
            dr  = cmd.ExecuteReader();
            while (dr.Read())
            {
                MetierTrader.Action uneActionNonPosseder = new MetierTrader.Action(Convert.ToInt32(dr[0].ToString()), (dr[1].ToString()));
                lesActionsNonPosseder.Add(uneActionNonPosseder);
            }
            dr.Close();
            return(lesActionsNonPosseder);
        }
Exemple #5
0
        public List <MetierTrader.Action> getAllActionsNonPossedees(int numTrader)
        {
            List <MetierTrader.Action> pasMesActions = new List <MetierTrader.Action>();

            cmd = new MySqlCommand("SELECT `idAction`, `nomAction`, `coursReel` FROM `action` WHERE idAction NOT IN (SELECT acheter.numAction FROM acheter WHERE acheter.numTrader = " + numTrader + ")", cnx);
            dr  = cmd.ExecuteReader();
            while (dr.Read())
            {
                MetierTrader.Action pasMonAction = new MetierTrader.Action(Convert.ToInt16(dr[0].ToString()), dr[1].ToString());
                pasMesActions.Add(pasMonAction);
            }
            dr.Close();
            return(pasMesActions);
        }
Exemple #6
0
        public List <MetierTrader.Action> getAllActionsNonPossedees(int numTrader)
        {
            List <MetierTrader.Action> mesActionsNonPossedees = new List <MetierTrader.Action>();

            cmd = new MySqlCommand("SELECT action.idAction, action.nomAction FROM action WHERE idAction NOT IN(SELECT action.idAction FROM action INNER JOIN acheter ON action.idAction = acheter.numAction WHERE numTrader =" + numTrader + ")", cnx);
            dr  = cmd.ExecuteReader();
            while (dr.Read())
            {
                MetierTrader.Action uneAction = new MetierTrader.Action(Convert.ToInt16(dr[0].ToString()), dr[1].ToString());
                mesActionsNonPossedees.Add(uneAction);
            }
            dr.Close();
            return(mesActionsNonPossedees);
        }
Exemple #7
0
        //public int getTotalPorteFeuille(int numTrader)
        //{
        //    //int total;
        //    //cmd = new MySqlCommand("select sum(quantite * prixAchat) as total from action a inner join acheter ach on a.idAction = ach.numAction inner join trader t on ach.numTrader = t.idTrader where t.idTrader = " + "'" + numTrader + "';", cnx);
        //    //dr = cmd.ExecuteReader();

        //    //dr.Read();

        //    //total = Convert.ToDouble(dr[0]);

        //    //dr.Close();
        //    //return total;
        //}

        public List <MetierTrader.Action> getAllActionsNonPossedees(int numTrader)
        {
            List <MetierTrader.Action> mesActionsNonPossedees = new List <MetierTrader.Action>();

            cmd = new MySqlCommand("select idAction,nomAction from action a inner join acheter ach on a.idAction = ach.numAction inner join trader t on ach.numTrader = t.idTraderr where a .idAction not in (select idAction from action a inner join acheter ach on a.idAction=ach.numAction inner join trader t on ach.numTrader = t.idTrader where t.idTrader = " + "'" + numTrader + "';", cnx);
            dr  = cmd.ExecuteReader();
            while (dr.Read())
            {
                MetierTrader.Action mta = new MetierTrader.Action(Convert.ToInt16(dr[0]), dr[1].ToString());
                mesActionsNonPossedees.Add(mta);
            }

            dr.Close();
            return(mesActionsNonPossedees);
        }
Exemple #8
0
        public List <MetierTrader.Action> getAllActionsNonPossedees(int numTrader)
        {
            List <MetierTrader.Action> lesActionsNonPossedees = new List <MetierTrader.Action>();

            cmd = new MySqlCommand("SELECT action.idAction,action.nomAction , action.coursReel from acheter INNER JOIN action ON action.idAction = acheter.numAction WHERE acheter.numAction NOT IN (SELECT action.idAction from action) AND acheter.numTrader = " + numTrader, cnx);
            dr  = cmd.ExecuteReader();

            while (dr.Read())
            {
                MetierTrader.Action unAction = new MetierTrader.Action(Convert.ToInt16(dr[0].ToString()), dr[1].ToString(), Convert.ToDouble(dr[2].ToString()));
                lesActionsNonPossedees.Add(unAction);
            }

            dr.Close();

            return(lesActionsNonPossedees);
        }
Exemple #9
0
        public List <ActionPerso> getAllActionsByTrader(int numTrader)
        {
            List <ActionPerso> lesActionsPerso = new List <ActionPerso>();

            cmd = new MySqlCommand("SELECT action.idAction , action.nomAction ,acheter.prixAchat , acheter.quantite from acheter INNER JOIN action ON action.idAction = acheter.numAction WHERE acheter.numTrader = " + numTrader + ";", cnx);
            dr  = cmd.ExecuteReader();

            while (dr.Read())
            {
                MetierTrader.Action unAction = new MetierTrader.Action(Convert.ToInt16(dr[0].ToString()), dr[1].ToString());
                double      prixAchat        = Convert.ToDouble(dr[2].ToString());
                int         quantite         = Convert.ToInt16(dr[3].ToString());
                double      total            = prixAchat * quantite;
                ActionPerso unActionPerso    = new ActionPerso(unAction, prixAchat, quantite, total);
                lesActionsPerso.Add(unActionPerso);
            }

            dr.Close();

            return(lesActionsPerso);
        }