Texture.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Drawing;
  7. using System.Windows.Forms;
  8. namespace Швейная_фабрика
  9. {
  10. public struct TextureData
  11. {
  12. public string TextureName;
  13. public string Colour;
  14. public int ProductWidth;
  15. public int Length;
  16. public string Description;
  17. public Image Photo;
  18. public fManager f;
  19. public string ID;
  20. }
  21. public class Texture : Panel
  22. {
  23. public Label lblName = new Label();
  24. public Label lblColour = new Label();
  25. public Label lblWidth = new Label();
  26. public Label lblLength = new Label();
  27. public Label lblDescription = new Label();
  28. public PictureBox pbxPhoto = new PictureBox();
  29. public fManager fManager;
  30. public string ID;
  31. void ItemFurniture_Click(object sender, EventArgs e)
  32. {
  33. if (fManager.CurrentTexture != null)
  34. {
  35. fManager.CurrentTexture.BackColor = Color.White;
  36. }
  37. this.BackColor = Color.LightGreen;
  38. fManager.CurrentTexture = this;
  39. }
  40. public Texture(TextureData texture)
  41. {
  42. this.BackColor = Color.White;
  43. this.BorderStyle = BorderStyle.FixedSingle;
  44. this.Controls.Add(this.lblName);
  45. this.Controls.Add(this.lblColour);
  46. this.Controls.Add(this.lblWidth);
  47. this.Controls.Add(this.lblLength);
  48. this.Controls.Add(this.lblDescription);
  49. this.Controls.Add(this.pbxPhoto);
  50. this.Location = new Point(38, 57);
  51. this.Name = "pTexture";
  52. this.Size = new Size(590, 73);
  53. this.TabIndex = 0;
  54. //
  55. // lblName
  56. //
  57. this.lblName.AutoSize = true;
  58. this.lblName.Location = new Point(74, 3);
  59. this.lblName.Name = "lblName";
  60. this.lblName.Size = new Size(35, 13);
  61. this.lblName.TabIndex = 2;
  62. this.lblName.Text = texture.TextureName;
  63. this.lblName.Click += ItemFurniture_Click;
  64. //
  65. // lblColour
  66. //
  67. this.lblColour.AutoSize = true;
  68. this.lblColour.Location = new Point(74, 16);
  69. this.lblColour.Name = "lblColour";
  70. this.lblColour.Size = new Size(35, 13);
  71. this.lblColour.TabIndex = 3;
  72. this.lblColour.Text = texture.Colour;
  73. this.lblColour.Click += ItemFurniture_Click;
  74. //
  75. // lblWidth
  76. //
  77. this.lblWidth.AutoSize = true;
  78. this.lblWidth.Location = new Point(74, 29);
  79. this.lblWidth.Name = "lblWidth";
  80. this.lblWidth.Size = new Size(35, 13);
  81. this.lblWidth.TabIndex = 4;
  82. this.lblWidth.Text = texture.ProductWidth.ToString();
  83. this.lblWidth.Click += ItemFurniture_Click;
  84. //
  85. // lblLength
  86. //
  87. this.lblLength.AutoSize = true;
  88. this.lblLength.Location = new Point(74, 42);
  89. this.lblLength.Name = "lblLength";
  90. this.lblLength.Size = new Size(60, 13);
  91. this.lblLength.TabIndex = 5;
  92. this.lblLength.Text = texture.Length.ToString();
  93. this.lblLength.Click += ItemFurniture_Click;
  94. //
  95. // lblDescription
  96. //
  97. this.lblDescription.AutoSize = true;
  98. this.lblDescription.Location = new Point(74, 55);
  99. this.lblDescription.Name = "lblDescription";
  100. this.lblDescription.Size = new Size(35, 13);
  101. this.lblDescription.TabIndex = 6;
  102. this.lblDescription.Text = texture.Description;
  103. this.lblDescription.Click += ItemFurniture_Click;
  104. //
  105. // pbxPhoto
  106. //
  107. this.pbxPhoto.BorderStyle = BorderStyle.FixedSingle;
  108. this.pbxPhoto.Location = new Point(3, 3);
  109. this.pbxPhoto.Name = "pbxPhoto";
  110. this.pbxPhoto.Image = texture.Photo;
  111. this.pbxPhoto.Size = new Size(65, 65);
  112. this.pbxPhoto.TabIndex = 1;
  113. this.pbxPhoto.Click += ItemFurniture_Click;
  114. fManager = texture.f;
  115. ID = texture.ID;
  116. }
  117. }
  118. }