Exemplo n.º 1
0
        private void genBottleID()
        {
            string existBottle = null;
            Random rnd         = new Random();
            string id          = "BL" + rnd.Next(100000, 999999);
            Bottle p           = pbda.getOneProductBottleByID(id, Language.getLanguageCode(), conn);

            existBottle = p.getProductID();
            Bottle db = pbda.getOneDeletedBottleByID(id, Language.getLanguageCode(), conn);

            existBottle = db.getProductID();

            if (existBottle != null)
            {
                genBottleID();
            }
            else
            {
                bottleIdTextBox.Text = id;
            }
        }