コード例 #1
0
        public bool removeStade(StadeWS stade)
        {
            List <Stade> liste = businessManager.getStades();
            Stade        paria = liste.First(x => x.Id == stade.Id);

            liste.Remove(paria);
            return(0 == businessManager.updateStades(liste));
        }
コード例 #2
0
ファイル: MatchWS.cs プロジェクト: BBS007/WebServiceJedi
 public MatchWS(int pId, JediWS pJedi1, JediWS pJedi2, JediWS pJediV, StadeWS pStade, EPhaseTournoi pPhase)
 {
     this.Id = pId;
     this.Jedi1 = pJedi1;
     this.Jedi2 = pJedi2;
     this.JediVainqueur = pJediV;
     this.Stade = pStade;
     this.Phase = (EPhaseTournoiWS)pPhase;
 }
コード例 #3
0
 public MatchWS(int pId, JediWS pJedi1, JediWS pJedi2, JediWS pJediV, StadeWS pStade, EPhaseTournoi pPhase)
 {
     this.Id            = pId;
     this.Jedi1         = pJedi1;
     this.Jedi2         = pJedi2;
     this.JediVainqueur = pJediV;
     this.Stade         = pStade;
     this.Phase         = (EPhaseTournoiWS)pPhase;
 }
コード例 #4
0
        public bool addStade(StadeWS stade)
        {
            List <Stade>           listeS = businessManager.getStades();
            List <Caracteristique> listeC = businessManager.getCaracteristiques();
            List <Caracteristique> caracs = new List <Caracteristique>();

            stade.Caracteristiques.ForEach(x => caracs.Add(listeC.Find(c => c.Nom.Equals(x.Nom))));
            Stade newStade = new Stade(0, stade.NbPlaces, stade.Planete, caracs);

            listeS.Add(newStade);
            return(0 == businessManager.updateStades(listeS));
        }
コード例 #5
0
        public bool updateStade(StadeWS stade)
        {
            List <Stade>           listeS = businessManager.getStades();
            List <Caracteristique> listeC = businessManager.getCaracteristiques();
            List <Caracteristique> caracs = new List <Caracteristique>();

            stade.Caracteristiques.ForEach(x => caracs.Add(listeC.Find(c => c.Nom.Equals(x.Nom))));
            Stade newStade = listeS.First(x => x.Id == stade.Id);

            newStade.Planete          = stade.Planete;
            newStade.NbPlaces         = stade.NbPlaces;
            newStade.Caracteristiques = caracs;
            return(0 == businessManager.updateStades(listeS));
        }
コード例 #6
0
 public System.Threading.Tasks.Task <bool> removeStadeAsync(WCFJedi.StadeWS stade)
 {
     return(base.Channel.removeStadeAsync(stade));
 }
コード例 #7
0
 public bool removeStade(WCFJedi.StadeWS stade)
 {
     return(base.Channel.removeStade(stade));
 }
コード例 #8
0
 public bool updateStade(WCFJedi.StadeWS stade)
 {
     return(base.Channel.updateStade(stade));
 }
コード例 #9
0
 public bool addStade(WCFJedi.StadeWS stade)
 {
     return(base.Channel.addStade(stade));
 }
コード例 #10
0
        public void TestServiceARStades()
        {
            ServiceReference.ServiceClient client = new ServiceReference.ServiceClient();

            List<StadeWS> stades = client.getStades();
            int size = stades.Count;
            Assert.IsNotNull(stades);
            /* AJOUT */
            StadeWS zone = new StadeWS(0, "Zone TEST", 11, new List<CaracteristiqueWS>());

            client.addStade(zone);
            Assert.AreEqual(size + 1, client.getStades().Count);
            /* SUPPRESSION */
            zone = client.getStades().Find(x => x.Planete.Equals("Zone TEST"));
            client.removeStade(zone);
            Assert.AreEqual(size, client.getStades().Count);

            client.Close();
        }