private void btnAcheteur(object sender, RoutedEventArgs e)
        {
            Acheteur ucObj = new Acheteur();

            stkTest.Children.Clear();
            stkTest.Children.Add(ucObj);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Acheteur lukas     = new Acheteur("Lukas");
            Acheteur charlotte = new Acheteur("Charlotte");
            Produit  coca33CL  = new Produit("Coca 33cl");

            coca33CL.Attach(lukas.Print);
            coca33CL.Attach(charlotte.Print);

            coca33CL.Prix = .80;
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Acheteur lukas     = new Acheteur("Lukas");
            Acheteur charlotte = new Acheteur("Charlotte");
            Produit  coca33CL  = new Produit("Coca 33cl");
            Produit  iPhone    = new Produit("IPhone 11");

            coca33CL.NotifyHandler += lukas.Print;
            coca33CL.NotifyHandler += charlotte.Print;

            coca33CL.Prix = .80;
        }
Exemple #4
0
        public static void ResetWeek()
        {
            CommandLogging.WriteLine("Lancement d'un reset de gain d'xp hebdomadaire manuel.");

            Experience.ResetAllTicks();

            CompensationGump.CompenserGMs();

            Acheteur.Reset();

            InstitutionHandler.Pay();           // Salaire venant des institutions.

            BoiteAuLettreComponent.WeeklyPay(); // Paiement des maisons.

            LastReset = DateTime.Now;
        }
Exemple #5
0
        public Boolean newSouhait_oldAcheteur(Acheteur obj_Acheteur, string s_habitablemin,
                                              string s_parcellemin, string s_villesouhait, string s_type,
                                              string s_statut, string s_garage, string s_cave, int chambre,
                                              string prix)
        {
            Souhait obj_Souhait = new Souhait()
            {
                Id     = Guid.NewGuid(),
                Statut = s_statut,
                Type   = s_type,
                Surface_habitable_min = Aide.parseInt(s_habitablemin),
                Surface_parcelle_min  = Aide.parseInt(s_parcellemin),
                Chambre_min           = Aide.parseInt(s_parcellemin),
                Cave         = s_cave,
                Garage       = s_garage,
                Ville        = s_villesouhait,
                Prix_max     = Aide.parseFloat(prix),
                Id_acheteur  = obj_Acheteur.Id.ToString(),
                Nom_acheteur = obj_Acheteur.Prenom + " " + obj_Acheteur.Nom,
            };

            return(Souhait.insert(obj_Souhait) && Acheteur.update(obj_Acheteur));
        }
Exemple #6
0
        public Boolean saveSouhait_Acheteur(string s_nom, string s_prenom, string s_adresse, string s_email, string s_tel_mobile, string s_tel_fixe, string s_habitablemin,
                                            string s_parcellemin, string s_villesouhait, string s_type,
                                            string s_statut, string s_garage, string s_cave, int chambre,
                                            string prix, Management.Agent agent)

        {
            Acheteur obj_Acheteur = new Acheteur()
            {
                Id          = Guid.NewGuid(),
                Nom         = s_nom,
                Prenom      = s_prenom,
                Adresse     = s_adresse,
                Telfixe     = s_tel_fixe,
                Telportable = s_tel_mobile,
                Email       = s_email,
                Idagent     = agent.ID.ToString()
            };
            Souhait obj_Souhait = new Souhait()
            {
                Id     = Guid.NewGuid(),
                Statut = s_statut,
                Type   = s_type,
                Surface_habitable_min = Aide.parseInt(s_habitablemin),
                Surface_parcelle_min  = Aide.parseInt(s_parcellemin),
                Chambre_min           = Aide.parseInt(s_parcellemin),
                Cave         = s_cave,
                Garage       = s_garage,
                Ville        = s_villesouhait,
                Prix_max     = Aide.parseFloat(prix),
                Id_acheteur  = obj_Acheteur.Id.ToString(),
                Nom_acheteur = obj_Acheteur.Prenom + " " + obj_Acheteur.Nom,
            };


            return(Souhait.insert(obj_Souhait) && Acheteur.insert(obj_Acheteur));
        }
Exemple #7
0
 public Boolean updateSouhait_Acheteur(Souhait obj_Souhait, Acheteur obj_Acheteur)
 {
     return(Souhait.update(obj_Souhait) && Acheteur.update(obj_Acheteur));
 }
Exemple #8
0
        public virtual bool OnSellItems(Mobile seller, List <SellItemResponse> list)
        {
            if (!IsActiveBuyer)
            {
                return(false);
            }

            if (!seller.CheckAlive())
            {
                return(false);
            }

            if (!CheckVendorAccess(seller))
            {
                //Say( 501522 ); // I shall not treat with scum like thee!
                Say("Je ne peux rien vous acheter.");
                return(false);
            }

            seller.PlaySound(0x32);

            IShopSellInfo[] info     = GetSellInfo();
            IBuyItemInfo[]  buyInfo  = this.GetBuyInfo();
            int             GiveGold = 0;
            int             Sold     = 0;
            Container       cont;

            foreach (SellItemResponse resp in list)
            {
                if (resp.Item.RootParent != seller || resp.Amount <= 0 || !resp.Item.IsStandardLoot() || !resp.Item.Movable || (resp.Item is Container && ((Container)resp.Item).Items.Count != 0))
                {
                    continue;
                }

                foreach (IShopSellInfo ssi in info)
                {
                    if (ssi.IsSellable(resp.Item))
                    {
                        Sold++;
                        break;
                    }
                }
            }

            if (Sold > MaxSell)
            {
                SayTo(seller, true, "Vous pouvez seulement vendre {0} objets en meme temps !", MaxSell);
                //SayTo( seller, true, "You may only sell {0} items at a time!", MaxSell );
                return(false);
            }
            else if (Sold == 0)
            {
                return(true);
            }

            foreach (SellItemResponse resp in list)
            {
                if (resp.Item.RootParent != seller || resp.Amount <= 0 || !resp.Item.IsStandardLoot() || !resp.Item.Movable || (resp.Item is Container && ((Container)resp.Item).Items.Count != 0))
                {
                    continue;
                }

                foreach (IShopSellInfo ssi in info)
                {
                    if (ssi.IsSellable(resp.Item))
                    {
                        int amount = resp.Amount;

                        GiveGold += ssi.GetSellPriceFor(resp.Item) * amount;
                    }
                }
            }

            if (!Acheteur.TesterDepense(seller, GiveGold))
            {
                SayTo(seller, "Vous ne pouvez vendre que pour {0} pièces d'or de matériel cette semaine.", Acheteur.VerifierDepense(seller));
                return(false);
            }

            int reste = Acheteur.AjouterMontant(seller, GiveGold);

            SayTo(seller, "Vous pouvez encore vendre pour {0} pièces d'or de matériel cette semaine.", reste);

            foreach (SellItemResponse resp in list)
            {
                if (resp.Item.RootParent != seller || resp.Amount <= 0 || !resp.Item.IsStandardLoot() || !resp.Item.Movable || (resp.Item is Container && ((Container)resp.Item).Items.Count != 0))
                {
                    continue;
                }

                foreach (IShopSellInfo ssi in info)
                {
                    if (ssi.IsSellable(resp.Item))
                    {
                        int amount = resp.Amount;

                        if (amount > resp.Item.Amount)
                        {
                            amount = resp.Item.Amount;
                        }

                        if (ssi.IsResellable(resp.Item))
                        {
                            bool found = false;

                            foreach (IBuyItemInfo bii in buyInfo)
                            {
                                if (bii.Restock(resp.Item, amount))
                                {
                                    resp.Item.Consume(amount);
                                    found = true;

                                    break;
                                }
                            }

                            if (!found)
                            {
                                cont = this.BuyPack;

                                if (amount < resp.Item.Amount)
                                {
                                    Item item = Mobile.LiftItemDupe(resp.Item, resp.Item.Amount - amount);

                                    if (item != null)
                                    {
                                        item.SetLastMoved();
                                        cont.DropItem(item);
                                    }
                                    else
                                    {
                                        resp.Item.SetLastMoved();
                                        cont.DropItem(resp.Item);
                                    }
                                }
                                else
                                {
                                    resp.Item.SetLastMoved();
                                    cont.DropItem(resp.Item);
                                }
                            }
                        }
                        else
                        {
                            if (amount < resp.Item.Amount)
                            {
                                resp.Item.Amount -= amount;
                            }
                            else
                            {
                                resp.Item.Delete();
                            }
                        }


                        break;
                    }
                }
            }

            if (GiveGold > 0)
            {
                while (GiveGold > 60000)
                {
                    seller.AddToBackpack(new Gold(60000));
                    GiveGold -= 60000;
                }

                seller.AddToBackpack(new Gold(GiveGold));

                seller.PlaySound(0x0037);                  //Gold dropping sound

                if (SupportsBulkOrders(seller))
                {
                    Item bulkOrder = CreateBulkOrder(seller, false);

                    if (bulkOrder is LargeBOD)
                    {
                        seller.SendGump(new LargeBODAcceptGump(seller, (LargeBOD)bulkOrder));
                    }
                    else if (bulkOrder is SmallBOD)
                    {
                        seller.SendGump(new SmallBODAcceptGump(seller, (SmallBOD)bulkOrder));
                    }
                }
            }
            //no cliloc for this?
            //SayTo( seller, true, "Thank you! I bought {0} item{1}. Here is your {2}gp.", Sold, (Sold > 1 ? "s" : ""), GiveGold );

            return(true);
        }