示例#1
0
        static void Main(string[] args)
        {
            ProductMenager productMenager = new ProductMenager(new InMemoryProductDal());

            foreach (var product in productMenager.GetAll())
            {
                Console.WriteLine(product.ProductName);
            }
            Console.ReadLine();
        }
示例#2
0
        public bool RunningChecks(bool title, int blok)

        {
            ProductMenager workFile = new ProductMenager();

            workFile.OpenFilePathR(Path);
            var set      = new HashSet <string>();
            int flag     = blok;
            int longfile = System.IO.File.ReadAllLines(Path).Length;

            //if (title == true) { longfile = System.IO.File.ReadAllLines(Path).Length - blok; }
            //else { longfile = System.IO.File.ReadAllLines(Path).Length; }
            for (int i = 0; i < longfile; i++)
            {
                if (title = true && flag == blok)
                {
                    workFile.ReadLine();
                    flag = 0;
                }
                string temp = workFile.ReadLine();
                if (temp == null)
                {
                    return(false);
                }
                if (SerialNumberCheck(temp) != true)
                {
                    MessageBox.Show("Найден кривой серийник! " + temp);
                    return(true);
                }
                if (temp != "")
                {
                    if (!set.Add(temp))
                    {
                        MessageBox.Show("Найдены повторяющиесы строки! " + temp);
                        return(true);
                    }
                }
                flag++;
            }
            return(false);
        }