public void FillShoppingCart()
        {
            formExample = new FormExample();
            GroupBox groupBoxExample = formExample.groupBoxProduct;

            form.panelShopingCart.Controls.Clear();
            NumericUpDown nud;
            Button        but;

            foreach (var productInShopCart in MainController.GetInstance().User.userShopCart)
            {
                var amount  = productInShopCart.amount;
                var prod_id = productInShopCart.prod_id;
                var product = products.Find(f => f.id == prod_id);

                GroupBox groupBox = new GroupBox();
                groupBox.Size = groupBoxExample.Size;
                groupBox.Name = prod_id.ToString();
                groupBox.Controls.AddRange(new Control[] {
                    new PictureBox()
                    {
                        Size                  = formExample.pictureBoxProductImage.Size,
                        Location              = formExample.pictureBoxProductImage.Location,
                        BackgroundImage       = product.image ?? formExample.pictureBoxProductImage.BackgroundImage,
                        BackgroundImageLayout = formExample.pictureBoxProductImage.BackgroundImageLayout
                    },
                    new Label()
                    {
                        Size     = formExample.labelProductPrice.Size,
                        Location = formExample.labelProductPrice.Location,
                        Text     = (product.price == decimal.Zero)? formExample.labelProductPrice.Text : product.price.ToString(),
                        AutoSize = true
                    },
                    new Label()
                    {
                        Size     = formExample.labelProductAmount.Size,
                        Location = formExample.labelProductAmount.Location,
                        Text     = product.amount?"Есть в наличии": formExample.labelProductAmount.Text,
                        AutoSize = true
                    },
                    new Label()
                    {
                        Size     = formExample.labelProductInfo.Size,
                        Location = formExample.labelProductInfo.Location,
                        Text     = (product.info == "")? formExample.labelProductInfo.Text : product.info,
                        AutoSize = true
                    },
                    but = new Button()
                    {
                        Name     = product.id.ToString(),
                        Size     = formExample.button1.Size,
                        Location = formExample.button1.Location,
                        Text     = "Убрать из корзины"
                    },

                    nud = new NumericUpDown()
                    {
                        Size     = formExample.numericUpDown1.Size,
                        Location = formExample.numericUpDown1.Location,
                        Maximum  = 20,
                        Minimum  = 0,
                        Value    = amount
                    }
                })
                ;
                but.Click        += buttonDontBuyClick;
                nud.ValueChanged += NudOnValueChanged;
                groupBox.Text     = product.name;
                groupBox.Location = Point.Empty + new Size(0, groupBox.Height * (form.panelShopingCart.Controls.Count));
                form.panelShopingCart.Controls.Add(groupBox);
            }
        }
        public void FillProductsList()
        {
            products    = dbManager.tableProducts.GetAllAvalibleProducts();
            formExample = new FormExample();
            GroupBox groupBoxExample = formExample.groupBoxProduct;

            form.panelUser.Controls.Clear();
            foreach (var product in products)
            {
                GroupBox groupBox = new GroupBox();
                groupBox.Size = groupBoxExample.Size;
                groupBox.Controls.Add(new PictureBox()
                {
                    Size                  = formExample.pictureBoxProductImage.Size,
                    Location              = formExample.pictureBoxProductImage.Location,
                    BackgroundImage       = product.image ?? formExample.pictureBoxProductImage.BackgroundImage,
                    BackgroundImageLayout = formExample.pictureBoxProductImage.BackgroundImageLayout
                });
                groupBox.Controls.Add(new Label()
                {
                    Size     = formExample.labelProductPrice.Size,
                    Location = formExample.labelProductPrice.Location,
                    Text     = (product.price == decimal.Zero)
                        ? formExample.labelProductPrice.Text
                        : product.price.ToString(),
                    AutoSize = true
                });
                groupBox.Controls.Add(new Label()
                {
                    Size     = formExample.labelProductAmount.Size,
                    Location = formExample.labelProductAmount.Location,
                    Text     = product.amount ? "Есть в наличии" : formExample.labelProductAmount.Text,
                    AutoSize = true
                });
                groupBox.Controls.Add(new Label()
                {
                    Size     = formExample.labelProductInfo.Size,
                    Location = formExample.labelProductInfo.Location,
                    Text     = (product.info == "") ? formExample.labelProductInfo.Text : product.info,
                    AutoSize = true
                });
                groupBox.Controls.Add(new Button()
                {
                    Name     = product.id.ToString(),
                    Size     = formExample.button1.Size,
                    Location = formExample.button1.Location,
                    Text     = formExample.button1.Text
                });

                groupBox.Controls.Add(new NumericUpDown()
                {
                    Size     = formExample.numericUpDown1.Size,
                    Location = formExample.numericUpDown1.Location,
                    Maximum  = 20,
                    Minimum  = 0,
                    Value    = 1
                });

                groupBox.Controls.Add(new Label()
                {
                    Name     = "labelAmount",
                    Size     = formExample.labelShoppingCartAmount.Size,
                    Location = formExample.labelShoppingCartAmount.Location,
                    Text     = "Уже в корзине: " + MainController.GetInstance().User.userShopCart
                               .Find(f => f.prod_id == product.id).amount,
                    AutoSize = true
                });

                groupBox.Text     = product.name;
                groupBox.Location = Point.Empty + new Size(0, groupBox.Height * (form.panelUser.Controls.Count));
                form.panelUser.Controls.Add(groupBox);
            }

            foreach (Control control in form.panelUser.Controls)
            {
                foreach (Control control1 in control.Controls)
                {
                    if (control1.GetType() == typeof(Button))
                    {
                        control1.Click += buttonBuyClick;
                    }
                }
            }
        }
        public void FillAdminProductsList()
        {
            products    = dbManager.tableProducts.GetAllProducts();
            formExample = new FormExample();
            PictureBox pbox            = new PictureBox();
            Button     btn             = new Button();
            GroupBox   groupBoxExample = formExample.groupBoxProduct;

            form.panelAdmin.Controls.Clear();
            foreach (var product in products)
            {
                GroupBox groupBox = new GroupBox();
                groupBox.Size = groupBoxExample.Size;
                groupBox.Controls.Add(pbox = new PictureBox()
                {
                    Size                  = formExample.pictureBoxProductImage.Size,
                    Location              = formExample.pictureBoxProductImage.Location,
                    BackgroundImage       = product.image ?? formExample.pictureBoxProductImage.BackgroundImage,
                    BackgroundImageLayout = formExample.pictureBoxProductImage.BackgroundImageLayout
                });
                groupBox.Controls.Add(new Label()
                {
                    Size     = formExample.labelProductPrice.Size,
                    Location = formExample.labelProductPrice.Location,
                    Text     = (product.price == decimal.Zero)
                        ? formExample.labelProductPrice.Text
                        : product.price.ToString(),
                    AutoSize = true
                });
                groupBox.Controls.Add(new Label()
                {
                    Size     = formExample.labelProductAmount.Size,
                    Location = formExample.labelProductAmount.Location,
                    Text     = product.amount ? "Есть в наличии" : formExample.labelProductAmount.Text,
                    AutoSize = true
                });
                groupBox.Controls.Add(new Label()
                {
                    Size     = formExample.labelProductInfo.Size,
                    Location = formExample.labelProductInfo.Location,
                    Text     = (product.info == "") ? formExample.labelProductInfo.Text : product.info,
                    AutoSize = true
                });
                groupBox.Controls.Add(btn = new Button()
                {
                    Name     = product.id.ToString(),
                    Size     = formExample.button1.Size,
                    Location = formExample.button1.Location,
                    Text     = "Редактировать продукт"
                });

                groupBox.Controls.Add(new NumericUpDown()
                {
                    Size     = formExample.numericUpDown1.Size,
                    Location = formExample.numericUpDown1.Location,
                    Maximum  = 20,
                    Minimum  = 0,
                    Value    = 1
                });

                groupBox.Text     = product.name;
                groupBox.Location = Point.Empty + new Size(0, groupBox.Height * (form.panelAdmin.Controls.Count));
                form.panelAdmin.Controls.Add(groupBox);
                pbox.Click += Picture_Click;
                btn.Click  += Btn_Click;
            }
        }