예제 #1
0
                public static void set()
                {
                    List <object[]> S = new ClassDB(null).queryResonse("SELECT * FROM TranslateNameProductsSet");


                    foreach (object[] s in S)
                    {
                        TranslateNameProductsSet t = new TranslateNameProductsSet();
                        t.CustomerId        = (Guid)s[0];
                        t.ProductCustomerId = (Guid)((s[1] is DBNull ? Guid.Empty : s[1]));
                        t.cod_lng           = s[2].ToString();
                        t.Name    = s[3].ToString();
                        t.Details = s[4].ToString();
                        list.Add(t);
                    }
                }
예제 #2
0
                public static void set()
                {
                    List <object[]> S = new ClassDB(null).queryResonse("SELECT * FROM Products");



                    foreach (object[] s in S)
                    {
                        Products p = new Products();

                        p.CustumerId = (Guid)s[0];

                        var t = TranslateNameProductsSet.get(p.CustumerId, "FR");

                        p.Name                   = t != null ? t.Name : (string)s[1];
                        p.CodeBare               = (string)s[2];
                        p.Desc                   = (string)s[3];
                        p.Chp_cat                = (short)s[4];
                        p.Balance                = (bool)s[5];
                        p.Contenance             = (decimal)s[6];
                        p.UniteContenance        = (int)s[7];
                        p.Tare                   = (int)s[8];
                        p.Date                   = (DateTime)s[9];
                        p.TVACustumerId          = (Guid)s[10];
                        p.ProductsWeb_CustomerId = (Guid)s[11];
                        //   p.ProductsAwaitingDeliveryCustomerId = (Guid)s[11];

                        p.SubGrpProduct = SubGrpProduct.L.Find(l => l.Id == (int)s[12]) ?? SubGrpProduct.L.First();

                        p.TVA = TVA_.L.Find(l => l.CustumerId == p.TVACustumerId);

                        List <StockReal> lsr = StockReal.L.FindAll(l => (l.ProductsCustumerId == p.CustumerId) &&
                                                                   (l.IdEstablishment == ClassGlobalVar.IdEstablishment)
                                                                   );


                        tstDubl(lsr, p, out p, true);

                        p.ProductsWeb_ = ProductsWeb_.R.Find(l => l.CustomerId == p.ProductsWeb_CustomerId);
                        p.bc           = new List <ProductsBC_>();
                        p.bc.AddRange(ProductsBC_.list.Where(l => l.CustomerIdProduct == p.CustumerId));
                        L.Add(p);
                    }
                }
예제 #3
0
                public static TranslateNameProductsSet get(Guid ProductCustomerId_, string cod_lng_)
                {
                    List <object[]> S = new ClassDB(null).queryResonse("SELECT * FROM TranslateNameProductsSet WHERE ProductCustomerId='" + ProductCustomerId_.ToString() + "' AND cod_lng=' " + cod_lng_ + "'");


                    List <TranslateNameProductsSet> l = new List <TranslateNameProductsSet>();

                    foreach (object[] s in S)
                    {
                        TranslateNameProductsSet t = new TranslateNameProductsSet();
                        t.CustomerId        = (Guid)s[0];
                        t.ProductCustomerId = (Guid)((s[1] is DBNull ? Guid.Empty : s[1]));
                        t.cod_lng           = s[2].ToString();
                        t.Name    = s[3].ToString();
                        t.Details = s[4].ToString();
                        l.Add(t);
                    }

                    return(l.FirstOrDefault());
                }