123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Drawing;
- using System.Windows.Forms;
- namespace Швейная_фабрика
- {
- public struct TextureData
- {
- public string TextureName;
- public string Colour;
- public int ProductWidth;
- public int Length;
- public string Description;
- public Image Photo;
- public fManager f;
- public string ID;
- }
- public class Texture : Panel
- {
- public Label lblName = new Label();
- public Label lblColour = new Label();
- public Label lblWidth = new Label();
- public Label lblLength = new Label();
- public Label lblDescription = new Label();
- public PictureBox pbxPhoto = new PictureBox();
- public fManager fManager;
- public string ID;
- void ItemFurniture_Click(object sender, EventArgs e)
- {
- if (fManager.CurrentTexture != null)
- {
- fManager.CurrentTexture.BackColor = Color.White;
- }
- this.BackColor = Color.LightGreen;
- fManager.CurrentTexture = this;
- }
- public Texture(TextureData texture)
- {
- this.BackColor = Color.White;
- this.BorderStyle = BorderStyle.FixedSingle;
- this.Controls.Add(this.lblName);
- this.Controls.Add(this.lblColour);
- this.Controls.Add(this.lblWidth);
- this.Controls.Add(this.lblLength);
- this.Controls.Add(this.lblDescription);
- this.Controls.Add(this.pbxPhoto);
- this.Location = new Point(38, 57);
- this.Name = "pTexture";
- this.Size = new Size(590, 73);
- this.TabIndex = 0;
- //
- // lblName
- //
- this.lblName.AutoSize = true;
- this.lblName.Location = new Point(74, 3);
- this.lblName.Name = "lblName";
- this.lblName.Size = new Size(35, 13);
- this.lblName.TabIndex = 2;
- this.lblName.Text = texture.TextureName;
- this.lblName.Click += ItemFurniture_Click;
- //
- // lblColour
- //
- this.lblColour.AutoSize = true;
- this.lblColour.Location = new Point(74, 16);
- this.lblColour.Name = "lblColour";
- this.lblColour.Size = new Size(35, 13);
- this.lblColour.TabIndex = 3;
- this.lblColour.Text = texture.Colour;
- this.lblColour.Click += ItemFurniture_Click;
- //
- // lblWidth
- //
- this.lblWidth.AutoSize = true;
- this.lblWidth.Location = new Point(74, 29);
- this.lblWidth.Name = "lblWidth";
- this.lblWidth.Size = new Size(35, 13);
- this.lblWidth.TabIndex = 4;
- this.lblWidth.Text = texture.ProductWidth.ToString();
- this.lblWidth.Click += ItemFurniture_Click;
- //
- // lblLength
- //
- this.lblLength.AutoSize = true;
- this.lblLength.Location = new Point(74, 42);
- this.lblLength.Name = "lblLength";
- this.lblLength.Size = new Size(60, 13);
- this.lblLength.TabIndex = 5;
- this.lblLength.Text = texture.Length.ToString();
- this.lblLength.Click += ItemFurniture_Click;
- //
- // lblDescription
- //
- this.lblDescription.AutoSize = true;
- this.lblDescription.Location = new Point(74, 55);
- this.lblDescription.Name = "lblDescription";
- this.lblDescription.Size = new Size(35, 13);
- this.lblDescription.TabIndex = 6;
- this.lblDescription.Text = texture.Description;
- this.lblDescription.Click += ItemFurniture_Click;
- //
- // pbxPhoto
- //
- this.pbxPhoto.BorderStyle = BorderStyle.FixedSingle;
- this.pbxPhoto.Location = new Point(3, 3);
- this.pbxPhoto.Name = "pbxPhoto";
- this.pbxPhoto.Image = texture.Photo;
- this.pbxPhoto.Size = new Size(65, 65);
- this.pbxPhoto.TabIndex = 1;
- this.pbxPhoto.Click += ItemFurniture_Click;
- fManager = texture.f;
- ID = texture.ID;
- }
- }
- }
|