コード例 #1
0
        public EntityQuotation(Quotation q)
        {
            ShouldDispose(this.Operations.Changed.Subscribe(x => Tarifs.ForEach(t => t.Update(this))));
            var pp = Observable.FromEventPattern<PropertyChangedEventArgs>(this, "PropertyChanged").ObserveOnDispatcher(System.Windows.Threading.DispatcherPriority.Normal);
            ShouldDispose(pp.Subscribe(_ =>
            {
                Tarifs.ForEach(t => t.Update(this));
            }));

            q.Entities.Add(this);
            Commentaire = q.Commentaire;
            TauxHorraireMethodes = q.TauxHorraireMethodes;
            TempsMethodes = q.TempsMethodes;
            FAD = q.FAD;
            Outillage = q.Outillage;
            Difficulte = q.Difficulte;
            Delai = q.Delai;
            Ts = q.Ts;
            /* var p = Observable.FromEventPattern<CollectionChangeEventArgs>(this.Operations, "CollectionChanged").ObserveOnDispatcher(System.Windows.Threading.DispatcherPriority.Normal);
             ShouldDispose( p.Subscribe(_ => {
                 Tarifs.ForEach(t => t.Update(this));
             }));*/
            
        }
コード例 #2
0
        public void TestPropertyChange()
        {
            Quotation q = new Quotation();
            /*q.PropertyChanged += (sender,args)=> {
                Debug.WriteLine("Property Changed:" + args.PropertyName);
            };
            q.PropertyChanging += (send, args) =>
            {
                Debug.WriteLine("Property Changing:" + args.PropertyName);
            };*/
            q.Numero = 1234;
            q.IsSelected = true;

            var tmp = new Tmp();
            tmp.PropertyChanged += (sender, args) =>
            {
                Debug.WriteLine("Property Changed:" + args.PropertyName);
            };
            tmp.Numero = 1;

        }
コード例 #3
0
        public async Task TestQuotationWithEntities()
        {
            var pcp = container.Get<IEntityProvider<PosteCharge, int>>();
            var q = new Quotation() { Numero = 1234 };
            var e = new EntityQuotation(q) { Reference = "reftest", Designation = "refdesi", };
            var op1 = new Operation(e) {Poste=pcp.Find(300),Nombre=2 };
            Debug.WriteLine(op1);
            var op2 = new Operation(e) { Poste =pcp.Find(101), Nombre = 5 };
            Debug.WriteLine(op2);

            new Tarif(e) { Quantite = 1,CoeficientVente=0.4 };
            new Tarif(e) { Quantite = 5, CoeficientVente = 0.35 };
            new Tarif(e) { Quantite = 10, CoeficientVente = 0.30 };
            new Tarif(e) { Quantite = 20, CoeficientVente = 0.20};
            new Tarif(e) { Quantite = 50, CoeficientVente = 0.20};
            new Tarif(e) { Quantite = 100, CoeficientVente = 0.20 };
            Debug.WriteLine(e);

            var ctrl = container.Get<IEntityController<Quotation>>();
            var result = await ctrl.Post(q);
            result.Throw();
            var q1 = await ctrl.Get(q.Id);
            Assert.AreEqual(q.Numero, q1.Numero);
        }
コード例 #4
0
        public async Task TestQuotationWithEntitiesAndDecoupeLaser()
        {
      
            var pcp = container.Get<IEntityProvider<PosteCharge, int>>();
            var vdlp= container.Get<IEntityProvider<VitesseDecoupeLaser, string>>();
            var mpp = container.Get<IEntityProvider<MaterialPrice, string>>();
            var mp = container.Get<IEntityProvider<Material, string>>();
            var q = new Quotation() { Numero = 1234 };
           
            
            var e = new EntityQuotation(q) { Reference = "reftest", Designation = "refdesi" };
            e.Outillage = 50 * Currency.Euro;
           
            var op1 = new Operation(e) { Poste = pcp.Find(300), Nombre = 2 };
            Debug.WriteLine(op1);
            var op2 = new Operation(e) { Poste = pcp.Find(101), Nombre = 5 };
            Debug.WriteLine(op2);

            var op3 = new Operation(e) { Poste = pcp.Find(215), Nombre = 1 };
            var decoupe = new OperationLaser(op3) { Epaisseur = 1, Gaz = GazDecoupe.Oxygene, Longueur = 600 * Length.Millimetre, NombreAmorcage = 3, NombrePetitDiametre = 2 ,SqueletteX=20*Length.Millimetre,SqueletteY=20*Length.Millimetre,Pince=0*Length.Millimetre};
            decoupe.FormatPiece = new Format() { Longueur = 200 * Length.Millimetre, Largeur = 100 * Length.Millimetre, Epaisseur = 1 * Length.Millimetre,/* Matiere = mp.Find("1.0035")*/ };
            decoupe.FormatTole = new Format() { Longueur = 222  * Length.Millimetre, Largeur = 125 * Length.Millimetre, Epaisseur = 1 * Length.Millimetre,/* Matiere = mp.Find("1.0035"),PrixMatiere=mpp.Find("1.0035")*/ };

            decoupe.Laser = vdlp.Find(215, MaterialGroup.P, 1, GazDecoupe.Oxygene);
            
            Debug.WriteLine(op3);

            

            Tarif tarif1=new Tarif(e) { Quantite = 1, CoeficientVente = 0.4 };
            tarif1.Prestations.Add(new TarifPrestation() {Estime=true,Prestation="Epoxy",Tarif=Currency.Euro*80 });
            new Tarif(e) { Quantite = 5, CoeficientVente = 0.35 };
            new Tarif(e) { Quantite = 10, CoeficientVente = 0.30 };
            new Tarif(e) { Quantite = 20, CoeficientVente = 0.20 };
            new Tarif(e) { Quantite = 50, CoeficientVente = 0.20 };
            new Tarif(e) { Quantite = 100, CoeficientVente = 0.20 };
            Debug.WriteLine(e);

            var ctrl = container.Get<IEntityController<Quotation>>();
            var result = await ctrl.Post(q);
            result.Throw();
            var q1 = await ctrl.Get(q.Id);
            Assert.AreEqual(q.Numero, q1.Numero);

            Debug.WriteLine(q1.Entities[0]);
        }
コード例 #5
0
 public async Task TestQuotation()
 {
     var q = new Quotation() { Numero = 1234 };
     var ctrl=container.Get<IEntityController<Quotation>>();
     var result = await ctrl.Post(q);
     result.Throw();
     var q1 = await ctrl.Get(q.Id);
     Assert.AreEqual(q.Numero, q1.Numero);
 }