/// <summary> /// methode permet d'executer les commande /// </summary> /// <param name="type"></param> /// <param name="Entitee"></param> /// <param name="CommandeSql"></param> /// <returns></returns> public void ExecuterCommande(TypeCommande type, ObjClass Entitee, string CommandeSql) { switch (type) { case TypeCommande.ExecuteReader: break; //case TypeCommande.ExecuteScalar: // break; case TypeCommande.ExecuteNonQuery: break; default: break; } switch (Entitee) { case ObjClass.Client: break; case ObjClass.Fournisseur: break; default: break; } }
Produit Produit(uint idSite, uint idCatégorie, uint id) { Random random = new Random(); Array types = Enum.GetValues(typeof(TypeMesure)); TypeMesure typeMesure = (TypeMesure)types.GetValue(random.Next(types.Length)); types = Enum.GetValues(typeof(TypeCommande)); TypeCommande typeCommande = (TypeCommande)types.GetValue(random.Next(types.Length)); decimal prix = .01m * Prix[random.Next(Prix.Length - 1)]; bool disponible = random.Next(100) >= 5; Produit produit = new Produit { Id = id, SiteId = idSite, CategorieId = idCatégorie, Nom = "Produit" + id, TypeMesure = typeMesure, TypeCommande = typeCommande, Prix = prix, Disponible = disponible }; return(produit); }