Beispiel #1
0
        public Form5(ProductExamEntities2 db, Product product)
        {
            InitializeComponent();
            int xLabel  = 16;
            int yItem   = 64;
            int xTexbox = 124;

            this.product  = product;
            this.db       = db;
            textBox2.Text = product.Name;
            textBox3.Text = product.Producer;

            var valueTable = db.Value.Where(x => x.IdProduct == product.Id).ToList();

            tb = new TextBox[valueTable.Count];
            foreach (var VARIABLE in valueTable)
            {
                this.Controls.Add(new Label()
                {
                    Text = VARIABLE.Attribute.NameAtt, Location = new Point(xLabel, yItem)
                });
                tb[countTexbox] = new TextBox()
                {
                    Text = VARIABLE.Value1, Location = new Point(xTexbox, yItem), Size = new Size(196, 20)
                };
                this.Controls.Add(tb[countTexbox]);
                yItem += 24;
                countTexbox++;
            }
        }
Beispiel #2
0
 public Form3(ProductExamEntities2 db)
 {
     InitializeComponent();
     this.db = db;
     GetAllProduct();
 }