Esempio n. 1
0
        private static XElement XelementCopy(XElement xe)
        {
            XDocument x = new XDocument();

            x.Add(new XElement("rec"));

            ClassProducts.product p = ClassProducts.transform(xe);

            x.Element("rec").Add(
                new XElement("ii", p.ii),
                new XElement("CustumerId", p.CustumerId),
                new XElement("Name", p.Name.ToUpper()),
                new XElement("Desc", p.Desc),
                new XElement("price", p.price),
                new XElement("priceGros", p.priceGros),
                new XElement("tva", p.tva),
                new XElement("qty", p.qty),
                new XElement("CodeBare", p.CodeBare),
                new XElement("balance", p.balance),
                new XElement("contenance", p.contenance),
                new XElement("uniteContenance", p.uniteContenance),
                new XElement("tare", p.tare),
                new XElement("date", p.date ?? DateTime.Now),
                new XElement("cusumerIdRealStock", p.cusumerIdRealStock),
                new XElement("cusumerIdSubGroup", p.cusumerIdSubGroup),
                new XElement("ProductsWeb_CustomerId", p.ProductsWeb_CustomerId),
                new XElement("grp", p.grp),
                new XElement("sgrp", p.sgrp)
                );

            return(x.Element("rec"));
        }
Esempio n. 2
0
        public static void discountCalc()
        {
            if (b != null)
            {
                IEnumerable <XElement> elms = ClassCheck.b.Element("check").Elements("product");

                foreach (var e in elms)
                {
                    ClassProducts.product p = ClassProducts.transform(e);
                    ClassCheck.modifProductCheck_(p.ii, p.price, p.Name, p.qty);
                }
                ClassCheck.getTotalPrice();
            }
        }
Esempio n. 3
0
        private static ClassSync.classPriceGros[] get_gros(Guid[] g)
        {
            var res = new ClassSync.classPriceGros[g.Length];

            for (int i = 0; i < res.Length; i++)
            {
                XElement x = ClassProducts.findCustomerId(g[i]);


                decimal pg = decimal.Parse(x.Element("priceGros").Value.Replace('.', ','));


                decimal procent = (decimal)(ClassSync.classPro.getDiscountValue(ClassProMode.pro));



                pg = pg + (pg * procent / 100);



                decimal tva_ = ClassTVA.getTVA(int.Parse(x.Element("tva").Value.Replace('.', ',')));

                decimal tva = PrixOnlyTVA(pg, tva_);

                pg = pg + tva;


                res[i] = new ClassSync.classPriceGros(new object[] {
                    Guid.Parse(x.Element("cusumerIdRealStock").Value),

                    Guid.Parse(x.Element("CustumerId").Value),

                    pg
                });
            }

            return(res);
        }
Esempio n. 4
0
        private static ClassSync.classPriceGros[] get(Guid[] g)
        {
            var res = new ClassSync.classPriceGros[g.Length];

            for (int i = 0; i < res.Length; i++)
            {
                XElement x = ClassProducts.findCustomerId(g[i]);


                decimal procent = (decimal)(ClassSync.classPro.getDiscountValue(ClassProMode.pro)) / 100;

                decimal prix = decimal.Parse(x.Element("price").Value.Replace('.', ','));

                res[i] = new ClassSync.classPriceGros(new object[] {
                    Guid.Parse(x.Element("cusumerIdRealStock").Value),

                    Guid.Parse(x.Element("CustumerId").Value),

                    prix + prix * procent
                });
            }

            return(res);
        }