Your Name пре 4 месеци
родитељ
комит
633a713d87

+ 5 - 1
СУБД Альфапол/FormManager.cs

@@ -162,7 +162,11 @@ FROM            Partner INNER JOIN
             formProfile.bsMeneger.Filter = bsUsers.Filter;
             formProfile.ShowDialog();
             this.managerTableAdapter.Fill(this.dbAlphapolAGDataSet.Manager);
-
+            try
+            {
+                pbxPhoto.Image = Image.FromFile(Application.StartupPath + "\\photo\\" + lblPhoto.Text);
+            }
+            catch { }
         }
     }
 }

+ 113 - 52
СУБД Альфапол/FormProfile.Designer.cs

@@ -51,6 +51,11 @@
             this.tbxPass2 = new System.Windows.Forms.TextBox();
             this.cbxShowPass = new System.Windows.Forms.CheckBox();
             this.lblPass = new System.Windows.Forms.Label();
+            this.pbxPhoto = new System.Windows.Forms.PictureBox();
+            this.btnLoadPhoto = new System.Windows.Forms.Button();
+            this.btnDelPhoto = new System.Windows.Forms.Button();
+            this.lblPhoto = new System.Windows.Forms.Label();
+            this.OpenPhoto = new System.Windows.Forms.OpenFileDialog();
             surnameLabel = new System.Windows.Forms.Label();
             nameLabel = new System.Windows.Forms.Label();
             patronymicLabel = new System.Windows.Forms.Label();
@@ -60,25 +65,73 @@
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.bsMeneger)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.dbAlphapolAGDataSet)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pbxPhoto)).BeginInit();
             this.SuspendLayout();
             // 
+            // surnameLabel
+            // 
+            surnameLabel.AutoSize = true;
+            surnameLabel.Location = new System.Drawing.Point(12, 145);
+            surnameLabel.Name = "surnameLabel";
+            surnameLabel.Size = new System.Drawing.Size(80, 17);
+            surnameLabel.TabIndex = 2;
+            surnameLabel.Text = "Фамилия:";
+            // 
+            // nameLabel
+            // 
+            nameLabel.AutoSize = true;
+            nameLabel.Location = new System.Drawing.Point(48, 177);
+            nameLabel.Name = "nameLabel";
+            nameLabel.Size = new System.Drawing.Size(44, 17);
+            nameLabel.TabIndex = 3;
+            nameLabel.Text = "Имя:";
+            // 
+            // patronymicLabel
+            // 
+            patronymicLabel.AutoSize = true;
+            patronymicLabel.Location = new System.Drawing.Point(3, 214);
+            patronymicLabel.Name = "patronymicLabel";
+            patronymicLabel.Size = new System.Drawing.Size(89, 17);
+            patronymicLabel.TabIndex = 5;
+            patronymicLabel.Text = "Отчество:";
+            // 
+            // label2
+            // 
+            label2.AutoSize = true;
+            label2.Location = new System.Drawing.Point(225, 145);
+            label2.Name = "label2";
+            label2.Size = new System.Drawing.Size(125, 17);
+            label2.TabIndex = 25;
+            label2.Text = "Новый пароль:";
+            // 
+            // label3
+            // 
+            label3.AutoSize = true;
+            label3.Location = new System.Drawing.Point(216, 174);
+            label3.Name = "label3";
+            label3.Size = new System.Drawing.Size(134, 17);
+            label3.TabIndex = 26;
+            label3.Text = "Повтор пароля:";
+            // 
             // panel1
             // 
             this.panel1.BackColor = System.Drawing.Color.LightGray;
+            this.panel1.Controls.Add(this.lblPhoto);
             this.panel1.Controls.Add(this.label1);
             this.panel1.Controls.Add(this.pictureBox1);
+            this.panel1.Controls.Add(this.lblPass);
             this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel1.Location = new System.Drawing.Point(0, 0);
             this.panel1.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(939, 131);
+            this.panel1.Size = new System.Drawing.Size(753, 131);
             this.panel1.TabIndex = 2;
             // 
             // label1
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("Courier New", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
-            this.label1.Location = new System.Drawing.Point(224, 48);
+            this.label1.Location = new System.Drawing.Point(161, 48);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(559, 33);
@@ -127,15 +180,6 @@
             this.tableAdapterManager.TypeProductTableAdapter = null;
             this.tableAdapterManager.UpdateOrder = СУБД_Альфапол.dbAlphapolAGDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete;
             // 
-            // surnameLabel
-            // 
-            surnameLabel.AutoSize = true;
-            surnameLabel.Location = new System.Drawing.Point(12, 145);
-            surnameLabel.Name = "surnameLabel";
-            surnameLabel.Size = new System.Drawing.Size(80, 17);
-            surnameLabel.TabIndex = 2;
-            surnameLabel.Text = "Фамилия:";
-            // 
             // surnameTextBox
             // 
             this.surnameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMeneger, "Surname", true));
@@ -144,15 +188,6 @@
             this.surnameTextBox.Size = new System.Drawing.Size(100, 24);
             this.surnameTextBox.TabIndex = 3;
             // 
-            // nameLabel
-            // 
-            nameLabel.AutoSize = true;
-            nameLabel.Location = new System.Drawing.Point(48, 177);
-            nameLabel.Name = "nameLabel";
-            nameLabel.Size = new System.Drawing.Size(44, 17);
-            nameLabel.TabIndex = 3;
-            nameLabel.Text = "Имя:";
-            // 
             // nameTextBox
             // 
             this.nameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMeneger, "Name", true));
@@ -161,15 +196,6 @@
             this.nameTextBox.Size = new System.Drawing.Size(100, 24);
             this.nameTextBox.TabIndex = 4;
             // 
-            // patronymicLabel
-            // 
-            patronymicLabel.AutoSize = true;
-            patronymicLabel.Location = new System.Drawing.Point(3, 214);
-            patronymicLabel.Name = "patronymicLabel";
-            patronymicLabel.Size = new System.Drawing.Size(89, 17);
-            patronymicLabel.TabIndex = 5;
-            patronymicLabel.Text = "Отчество:";
-            // 
             // patronymicTextBox
             // 
             this.patronymicTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMeneger, "Patronymic", true));
@@ -183,7 +209,7 @@
             this.btnClose.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(161)))), ((int)(((byte)(99)))), ((int)(((byte)(245)))));
             this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
             this.btnClose.ForeColor = System.Drawing.SystemColors.Control;
-            this.btnClose.Location = new System.Drawing.Point(723, 496);
+            this.btnClose.Location = new System.Drawing.Point(536, 496);
             this.btnClose.Name = "btnClose";
             this.btnClose.Size = new System.Drawing.Size(204, 30);
             this.btnClose.TabIndex = 21;
@@ -220,24 +246,6 @@
             this.tbxPass2.UseSystemPasswordChar = true;
             this.tbxPass2.TextChanged += new System.EventHandler(this.tbxPass2_TextChanged);
             // 
-            // label2
-            // 
-            label2.AutoSize = true;
-            label2.Location = new System.Drawing.Point(225, 145);
-            label2.Name = "label2";
-            label2.Size = new System.Drawing.Size(125, 17);
-            label2.TabIndex = 25;
-            label2.Text = "Новый пароль:";
-            // 
-            // label3
-            // 
-            label3.AutoSize = true;
-            label3.Location = new System.Drawing.Point(216, 174);
-            label3.Name = "label3";
-            label3.Size = new System.Drawing.Size(134, 17);
-            label3.TabIndex = 26;
-            label3.Text = "Повтор пароля:";
-            // 
             // cbxShowPass
             // 
             this.cbxShowPass.AutoSize = true;
@@ -253,18 +261,64 @@
             // 
             this.lblPass.AutoSize = true;
             this.lblPass.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMeneger, "Password", true));
-            this.lblPass.Location = new System.Drawing.Point(579, 151);
+            this.lblPass.Location = new System.Drawing.Point(147, 114);
             this.lblPass.Name = "lblPass";
             this.lblPass.Size = new System.Drawing.Size(71, 17);
             this.lblPass.TabIndex = 28;
             this.lblPass.Text = "lblPass";
             // 
+            // pbxPhoto
+            // 
+            this.pbxPhoto.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.pbxPhoto.Location = new System.Drawing.Point(536, 141);
+            this.pbxPhoto.Name = "pbxPhoto";
+            this.pbxPhoto.Size = new System.Drawing.Size(204, 169);
+            this.pbxPhoto.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pbxPhoto.TabIndex = 29;
+            this.pbxPhoto.TabStop = false;
+            // 
+            // btnLoadPhoto
+            // 
+            this.btnLoadPhoto.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(161)))), ((int)(((byte)(99)))), ((int)(((byte)(245)))));
+            this.btnLoadPhoto.ForeColor = System.Drawing.SystemColors.Control;
+            this.btnLoadPhoto.Location = new System.Drawing.Point(536, 316);
+            this.btnLoadPhoto.Name = "btnLoadPhoto";
+            this.btnLoadPhoto.Size = new System.Drawing.Size(204, 30);
+            this.btnLoadPhoto.TabIndex = 30;
+            this.btnLoadPhoto.Text = "Загрузить фото";
+            this.btnLoadPhoto.UseVisualStyleBackColor = false;
+            this.btnLoadPhoto.Click += new System.EventHandler(this.btnLoadPhoto_Click);
+            // 
+            // btnDelPhoto
+            // 
+            this.btnDelPhoto.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(161)))), ((int)(((byte)(99)))), ((int)(((byte)(245)))));
+            this.btnDelPhoto.ForeColor = System.Drawing.SystemColors.Control;
+            this.btnDelPhoto.Location = new System.Drawing.Point(536, 352);
+            this.btnDelPhoto.Name = "btnDelPhoto";
+            this.btnDelPhoto.Size = new System.Drawing.Size(204, 30);
+            this.btnDelPhoto.TabIndex = 31;
+            this.btnDelPhoto.Text = "Удалить фото";
+            this.btnDelPhoto.UseVisualStyleBackColor = false;
+            this.btnDelPhoto.Click += new System.EventHandler(this.btnDelPhoto_Click);
+            // 
+            // lblPhoto
+            // 
+            this.lblPhoto.AutoSize = true;
+            this.lblPhoto.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMeneger, "Photo", true));
+            this.lblPhoto.Location = new System.Drawing.Point(246, 115);
+            this.lblPhoto.Name = "lblPhoto";
+            this.lblPhoto.Size = new System.Drawing.Size(80, 17);
+            this.lblPhoto.TabIndex = 29;
+            this.lblPhoto.Text = "lblPhoto";
+            // 
             // FormProfile
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(939, 538);
-            this.Controls.Add(this.lblPass);
+            this.ClientSize = new System.Drawing.Size(753, 538);
+            this.Controls.Add(this.btnDelPhoto);
+            this.Controls.Add(this.btnLoadPhoto);
+            this.Controls.Add(this.pbxPhoto);
             this.Controls.Add(this.cbxShowPass);
             this.Controls.Add(label3);
             this.Controls.Add(label2);
@@ -281,8 +335,9 @@
             this.Controls.Add(this.panel1);
             this.Font = new System.Drawing.Font("Courier New", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "FormProfile";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "\"ООО\" Альфапол";
             this.Load += new System.EventHandler(this.FormProfile_Load);
             this.panel1.ResumeLayout(false);
@@ -290,6 +345,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.bsMeneger)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.dbAlphapolAGDataSet)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pbxPhoto)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -313,5 +369,10 @@
         private System.Windows.Forms.TextBox tbxPass2;
         private System.Windows.Forms.CheckBox cbxShowPass;
         private System.Windows.Forms.Label lblPass;
+        private System.Windows.Forms.PictureBox pbxPhoto;
+        private System.Windows.Forms.Button btnLoadPhoto;
+        private System.Windows.Forms.Button btnDelPhoto;
+        private System.Windows.Forms.Label lblPhoto;
+        private System.Windows.Forms.OpenFileDialog OpenPhoto;
     }
 }

+ 45 - 0
СУБД Альфапол/FormProfile.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -22,6 +23,12 @@ namespace СУБД_Альфапол
             // TODO: This line of code loads data into the 'dbAlphapolAGDataSet.Manager' table. You can move, or remove it, as needed.
             this.managerTableAdapter.Fill(this.dbAlphapolAGDataSet.Manager);
             lblPass.Hide();
+            try
+            {
+                pbxPhoto.Image = Image.FromFile(Application.StartupPath + "\\photo\\" + lblPhoto.Text);
+            }
+            catch { }
+            lblPhoto.Hide();
 
         }
 
@@ -37,6 +44,17 @@ namespace СУБД_Альфапол
                 lblPass.Text = tbxPass1.Text;
             }
 
+            if (OpenPhoto.FileName != "")
+            {
+                string UniqueFileName = Path.GetRandomFileName() + Path.GetExtension(OpenPhoto.FileName);
+                lblPhoto.Text = UniqueFileName;
+                try
+                {
+                    File.Copy(OpenPhoto.FileName, Application.StartupPath + "\\photo\\" + lblPhoto.Text);
+                }
+                catch { }
+            }
+
             bsMeneger.EndEdit();
             this.managerTableAdapter.Update(this.dbAlphapolAGDataSet.Manager);
             Close();
@@ -58,5 +76,32 @@ namespace СУБД_Альфапол
             tbxPass2.UseSystemPasswordChar = !cbxShowPass.Checked;
 
         }
+
+        private void btnLoadPhoto_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                if (OpenPhoto.ShowDialog() == DialogResult.OK)
+                    pbxPhoto.Image = Image.FromFile(OpenPhoto.FileName);
+            }
+            catch 
+            {
+                MessageBox.Show("Не удалось загрузить фотографию!", "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                OpenPhoto.FileName = "";
+                return;
+            }
+            MessageBox.Show("Фотография успешно загружена!", "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Information);
+        }
+
+        private void btnDelPhoto_Click(object sender, EventArgs e)
+        {
+            if (MessageBox.Show("Удалить фотографию фотографию?", "Внимание!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+            {
+                pbxPhoto.Image = null;
+                lblPhoto.Text = "";
+                OpenPhoto.FileName = "";
+            }
+
+        }
     }
 }

+ 21 - 12
СУБД Альфапол/FormProfile.resx

@@ -117,18 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="bsMeneger.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-  <metadata name="dbAlphapolAGDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>130, 17</value>
-  </metadata>
-  <metadata name="managerTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>302, 17</value>
-  </metadata>
-  <metadata name="tableAdapterManager.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>472, 17</value>
-  </metadata>
   <metadata name="surnameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>False</value>
   </metadata>
@@ -144,6 +132,27 @@
   <metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>False</value>
   </metadata>
+  <metadata name="bsMeneger.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="dbAlphapolAGDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>130, 17</value>
+  </metadata>
+  <metadata name="dbAlphapolAGDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>130, 17</value>
+  </metadata>
+  <metadata name="managerTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>302, 17</value>
+  </metadata>
+  <metadata name="tableAdapterManager.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>472, 17</value>
+  </metadata>
+  <metadata name="bsMeneger.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="OpenPhoto.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>641, 17</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

BIN
СУБД Альфапол/bin/Debug/photo/nutjahpj.evr.jpg


BIN
СУБД Альфапол/bin/Debug/photo/qmiiob1g.uyo.jpg


BIN
СУБД Альфапол/bin/Debug/photo/yibriqlw.pcu.png


BIN
СУБД Альфапол/bin/Debug/СУБД Альфапол.exe