コード例 #1
0
        public void senario_b()
        {
            // un employé prend la commande d'un client
            //l'utilisateur clique sur nouvelle commande
            int id_commande = Restaurant.addCommande(new Commande());
            //il veut ajouté un maki et un nigiri a sa commande
            var      sf     = new SaumonFabric();
            IProduit sushiA = sf.CreateMaki();
            IProduit sushiB = sf.CreateNigiri();

            Restaurant.getCommande(id_commande).addProduit(sushiA);
            Restaurant.getCommande(id_commande).addProduit(sushiB);
            //il veut annulé le nigiri(son dertnier ajout)
            Restaurant.getCommande(id_commande).removeDernierProduit();
            //il veut ajouté un menu
            IMenu MenuA = new MenuAllTuna();

            Restaurant.getCommande(id_commande).addProduit(MenuA);
            //il affiche le total
            Restaurant.getCommande(id_commande).getTTc();
            //il valide sa commande
            Restaurant.getCommande(id_commande).Validate();
            //mais le clien déside de partir
            Restaurant.getCommande(id_commande).Cancel();
        }
コード例 #2
0
        public void senario_a()
        {
            // un employé prend la commande d'un client
            //l'utilisateur clique sur nouvelle commande
            int id_commande = Restaurant.addCommande(new Commande());
            //il veut ajouté un maki et un nigiri a sa commande
            var      sf     = new SaumonFabric();
            IProduit sushiA = sf.CreateMaki();
            IProduit sushiB = sf.CreateNigiri();

            Restaurant.getCommande(id_commande).addProduit(sushiA);
            Restaurant.getCommande(id_commande).addProduit(sushiB);
            //il veut annulé le nigiri(son dertnier ajout)
            Restaurant.getCommande(id_commande).removeDernierProduit();
            //il veut ajouté un menu
            IMenu MenuA = new MenuAllTuna();

            Restaurant.getCommande(id_commande).addProduit(MenuA);
            //il affiche le total
            Restaurant.getCommande(id_commande).getTTc();
            //ou pour plus de detail
            Restaurant.getCommande(id_commande).toString();
            //il valide sa commande
            Restaurant.getCommande(id_commande).Validate();
            //en cuisine il veules les commande non préparé
            var list = Restaurant.getCommandeList(EStateCommande.Valider);

            //en cuisine il veules voir le detail d'une commande non préparé affiché grace a notre liste
            //(pour que se soit plus pratique on va dire d'ils on cliqué sur la commande de notre client)
            Restaurant.getCommande(id_commande).toString();
            //une fois préparé ils valide la preparation de la commande
            Restaurant.getCommande(id_commande).Validate();
            //et le client repart avec sa commande
        }
コード例 #3
0
        static void Main(string[] args)
        {
            int      id_commande = Restaurant.addCommande(new Commande());
            var      sf          = new SaumonFabric();
            IProduit sushiA      = sf.CreateMaki();
            IProduit sushiB      = sf.CreateNigiri();

            Restaurant.getCommande(id_commande).addProduit(sushiA);
            Restaurant.getCommande(id_commande).addProduit(sushiB);
            Restaurant.getCommande(id_commande).removeDernierProduit();
            IMenu MenuA = new MenuAllTuna();

            Restaurant.getCommande(id_commande).addProduit(MenuA);
            Restaurant.getCommande(id_commande).getTTc();
            Restaurant.getCommande(id_commande).toString();
            Console.Write(Restaurant.getCommande(id_commande).toString());
            Restaurant.getCommande(id_commande).Validate();
            var list = Restaurant.getCommandeList(EStateCommande.Valider);

            Restaurant.getCommande(id_commande).toString();
            Restaurant.getCommande(id_commande).Validate();
        }
コード例 #4
0
        public void Enregistrer(IProduit prod)
        {
            if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
            {
                ImplementeConnexion.Instance.Conn.Open();
            }
            using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
            {
                cmd.CommandText = "INSERT_PRODUIT";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, Id));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@designation", 50, DbType.String, Designation));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@dosage", 50, DbType.String, Dosage));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@forme", 50, DbType.String, Forme));
                //cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "", 100, DbType.Int32, QteStock));
                cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@refcategorie", 100, DbType.Int32, Ref_Categ));

                cmd.ExecuteNonQuery();


                //MessageBox.Show("Enregistrement reussi svp !!!", "Reussite", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
            }
        }
コード例 #5
0
 public void addProduit(IProduit produit)
 {
     this.Produits.Add(produit);
 }