예제 #1
0
            public static void syncSingleProduct()
            {
                object date = new LastUpdDB().getUpdAB();

                if (date != null)
                {
                    ClassGroupProduct.loadFromFile();
                    ClassTVA.loadFromFile();
                    ClassProducts.loadFronFile();

                    List <ProductDB.Products> productsAB = ProductDB.Products.selAB(DateTime.Parse(date.ToString()).AddMinutes(-1), DateTime.Now.AddMinutes(1));


                    if (productsAB.Count > 0)
                    {
                        string s = "Les produits suivante a été modifié : " + Environment.NewLine;

                        foreach (var p in productsAB)
                        {
                            // ClassProducts.modifAddOnlyFile(ClassProducts.DbToVar(p));


                            try
                            {
                                s += p.Name + " (" + p.CodeBare + ") - " + "QTY : " + p.StockReal_.Count() + " - Prix : € " + Environment.NewLine;
                            }


                            catch (Exception ex)
                            {
                                string text = "KOD 013214" + ex.Message;

                                //   new ClassFunctuon().showMessageSB(text);

                                new ClassLog(text);
                            }
                        }

                        //   new ClassFunctuon().showMessageTimeList(s);
                    }
                }
            }
예제 #2
0
                public static int selABCount()
                {
                    object date = new LastUpdDB().getUpdAB();

                    if (date != null)
                    {
                        DateTime a = DateTime.Parse(date.ToString()).AddMinutes(-1);
                        DateTime b = DateTime.Now.AddMinutes(1);

                        string cmd = "SELECT * FROM Products WHERE (" +
                                     "[Date] >=  CAST('{DATETIME_A}' AS DateTime) AND [Date] <= CAST('{DATETIME_B}' AS DateTime))";

                        string c = cmd.Replace("{DATETIME_A}", a.ToString())
                                   .Replace("{DATETIME_B}", b.ToString());

                        return(new ClassDB(null).queryResonse(c).Count());
                    }

                    return(0);
                }