Quellcode durchsuchen

Коррекция переключений между окнами

Вячеслав Терешенко vor 2 Jahren
Ursprung
Commit
def47fc8fc

+ 15 - 15
ImpulseVision/FormEditUser.Designer.cs

@@ -56,7 +56,7 @@
             this.BtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
             this.BtnCancel.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.BtnCancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(255)))), ((int)(((byte)(248)))));
-            this.BtnCancel.Location = new System.Drawing.Point(19, 344);
+            this.BtnCancel.Location = new System.Drawing.Point(19, 325);
             this.BtnCancel.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.BtnCancel.Name = "BtnCancel";
             this.BtnCancel.Size = new System.Drawing.Size(165, 35);
@@ -71,7 +71,7 @@
             this.BtnSaveEditing.DialogResult = System.Windows.Forms.DialogResult.OK;
             this.BtnSaveEditing.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.BtnSaveEditing.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(255)))), ((int)(((byte)(248)))));
-            this.BtnSaveEditing.Location = new System.Drawing.Point(195, 344);
+            this.BtnSaveEditing.Location = new System.Drawing.Point(195, 325);
             this.BtnSaveEditing.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.BtnSaveEditing.Name = "BtnSaveEditing";
             this.BtnSaveEditing.Size = new System.Drawing.Size(165, 35);
@@ -83,7 +83,7 @@
             // LblSelectUserID
             // 
             this.LblSelectUserID.AutoSize = true;
-            this.LblSelectUserID.Location = new System.Drawing.Point(341, 320);
+            this.LblSelectUserID.Location = new System.Drawing.Point(351, 21);
             this.LblSelectUserID.Name = "LblSelectUserID";
             this.LblSelectUserID.Size = new System.Drawing.Size(22, 21);
             this.LblSelectUserID.TabIndex = 8;
@@ -101,7 +101,7 @@
             this.TbxPassportNumber.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.TbxPassportNumber.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
             this.TbxPassportNumber.ForeColor = System.Drawing.Color.Black;
-            this.TbxPassportNumber.Location = new System.Drawing.Point(19, 240);
+            this.TbxPassportNumber.Location = new System.Drawing.Point(19, 220);
             this.TbxPassportNumber.Name = "TbxPassportNumber";
             this.TbxPassportNumber.SelectionStart = 0;
             this.TbxPassportNumber.Size = new System.Drawing.Size(341, 40);
@@ -134,7 +134,7 @@
             this.TbxPassportSeria.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.TbxPassportSeria.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
             this.TbxPassportSeria.ForeColor = System.Drawing.Color.Black;
-            this.TbxPassportSeria.Location = new System.Drawing.Point(19, 194);
+            this.TbxPassportSeria.Location = new System.Drawing.Point(19, 174);
             this.TbxPassportSeria.Name = "TbxPassportSeria";
             this.TbxPassportSeria.SelectionStart = 0;
             this.TbxPassportSeria.Size = new System.Drawing.Size(341, 40);
@@ -157,7 +157,7 @@
             this.TbxPatronymic.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.TbxPatronymic.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
             this.TbxPatronymic.ForeColor = System.Drawing.Color.Black;
-            this.TbxPatronymic.Location = new System.Drawing.Point(19, 148);
+            this.TbxPatronymic.Location = new System.Drawing.Point(19, 128);
             this.TbxPatronymic.Name = "TbxPatronymic";
             this.TbxPatronymic.SelectionStart = 0;
             this.TbxPatronymic.Size = new System.Drawing.Size(341, 40);
@@ -178,7 +178,7 @@
             this.TbxFirstname.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.TbxFirstname.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
             this.TbxFirstname.ForeColor = System.Drawing.Color.Black;
-            this.TbxFirstname.Location = new System.Drawing.Point(19, 102);
+            this.TbxFirstname.Location = new System.Drawing.Point(19, 82);
             this.TbxFirstname.Name = "TbxFirstname";
             this.TbxFirstname.SelectionStart = 0;
             this.TbxFirstname.Size = new System.Drawing.Size(341, 40);
@@ -199,7 +199,7 @@
             this.TbxLastname.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.TbxLastname.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
             this.TbxLastname.ForeColor = System.Drawing.Color.Black;
-            this.TbxLastname.Location = new System.Drawing.Point(19, 56);
+            this.TbxLastname.Location = new System.Drawing.Point(19, 36);
             this.TbxLastname.Name = "TbxLastname";
             this.TbxLastname.SelectionStart = 0;
             this.TbxLastname.Size = new System.Drawing.Size(341, 40);
@@ -224,11 +224,11 @@
             this.RPanelTextEditUser.Cursor = System.Windows.Forms.Cursors.Default;
             this.RPanelTextEditUser.Font = new System.Drawing.Font("Verdana", 8.25F);
             this.RPanelTextEditUser.ForeColor = System.Drawing.Color.White;
-            this.RPanelTextEditUser.Location = new System.Drawing.Point(12, 12);
+            this.RPanelTextEditUser.Location = new System.Drawing.Point(1, 3);
             this.RPanelTextEditUser.Name = "RPanelTextEditUser";
             this.RPanelTextEditUser.RippleColor = System.Drawing.Color.Black;
             this.RPanelTextEditUser.RoundingEnable = true;
-            this.RPanelTextEditUser.Size = new System.Drawing.Size(351, 27);
+            this.RPanelTextEditUser.Size = new System.Drawing.Size(372, 27);
             this.RPanelTextEditUser.TabIndex = 0;
             this.RPanelTextEditUser.TextHover = null;
             this.RPanelTextEditUser.UseDownPressEffectOnClick = false;
@@ -242,9 +242,9 @@
             this.LblTextEditUser.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.LblTextEditUser.Location = new System.Drawing.Point(3, 0);
             this.LblTextEditUser.Name = "LblTextEditUser";
-            this.LblTextEditUser.Size = new System.Drawing.Size(345, 25);
+            this.LblTextEditUser.Size = new System.Drawing.Size(366, 25);
             this.LblTextEditUser.TabIndex = 1;
-            this.LblTextEditUser.Text = "<Редактирование пользователя>";
+            this.LblTextEditUser.Text = "<О пользователе>";
             this.LblTextEditUser.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // TbxPhone
@@ -259,7 +259,7 @@
             this.TbxPhone.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.TbxPhone.FontTextPreview = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
             this.TbxPhone.ForeColor = System.Drawing.Color.Black;
-            this.TbxPhone.Location = new System.Drawing.Point(19, 286);
+            this.TbxPhone.Location = new System.Drawing.Point(19, 266);
             this.TbxPhone.Name = "TbxPhone";
             this.TbxPhone.SelectionStart = 0;
             this.TbxPhone.Size = new System.Drawing.Size(341, 40);
@@ -277,9 +277,8 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(255)))), ((int)(((byte)(252)))));
-            this.ClientSize = new System.Drawing.Size(375, 391);
+            this.ClientSize = new System.Drawing.Size(375, 372);
             this.Controls.Add(this.TbxPhone);
-            this.Controls.Add(this.LblSelectUserID);
             this.Controls.Add(this.BtnSaveEditing);
             this.Controls.Add(this.BtnCancel);
             this.Controls.Add(this.TbxPassportNumber);
@@ -288,6 +287,7 @@
             this.Controls.Add(this.TbxFirstname);
             this.Controls.Add(this.TbxLastname);
             this.Controls.Add(this.RPanelTextEditUser);
+            this.Controls.Add(this.LblSelectUserID);
             this.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.ForeColor = System.Drawing.Color.Black;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

+ 16 - 3
ImpulseVision/FormMain.Designer.cs

@@ -76,6 +76,7 @@
             this.RPanelSettings = new ImpulseVision.RPanel();
             this.LblTextSettings = new System.Windows.Forms.Label();
             this.SwAutoLoad = new ImpulseVision.EgoldsToggleSwitch();
+            this.TbVisits = new System.Windows.Forms.TabPage();
             this.ImList = new System.Windows.Forms.ImageList(this.components);
             this.TimerSaving = new System.Windows.Forms.Timer(this.components);
             this.menuStrip1.SuspendLayout();
@@ -225,8 +226,9 @@
             this.BtnInfoTraffic.Image = global::ImpulseVision.Properties.Resources._103515_text_document_information_icon;
             this.BtnInfoTraffic.ImageTransparentColor = System.Drawing.Color.Magenta;
             this.BtnInfoTraffic.Name = "BtnInfoTraffic";
-            this.BtnInfoTraffic.Size = new System.Drawing.Size(183, 22);
-            this.BtnInfoTraffic.Text = "Информация о посещениях";
+            this.BtnInfoTraffic.Size = new System.Drawing.Size(92, 22);
+            this.BtnInfoTraffic.Text = "Посещения";
+            this.BtnInfoTraffic.Click += new System.EventHandler(this.BtnInfoTraffic_Click);
             // 
             // statusStrip1
             // 
@@ -266,6 +268,7 @@
             this.TabPages.Controls.Add(this.TbUsers);
             this.TabPages.Controls.Add(this.TbMain);
             this.TabPages.Controls.Add(this.TbSettings);
+            this.TabPages.Controls.Add(this.TbVisits);
             this.TabPages.Dock = System.Windows.Forms.DockStyle.Fill;
             this.TabPages.Location = new System.Drawing.Point(0, 49);
             this.TabPages.Name = "TabPages";
@@ -553,7 +556,7 @@
             this.BtnSave.Name = "BtnSave";
             this.BtnSave.Size = new System.Drawing.Size(236, 35);
             this.BtnSave.TabIndex = 3;
-            this.BtnSave.Text = "Сохранить";
+            this.BtnSave.Text = "Добавить";
             this.BtnSave.UseVisualStyleBackColor = false;
             this.BtnSave.Click += new System.EventHandler(this.BtnSave_Click);
             // 
@@ -659,6 +662,15 @@
             this.SwAutoLoad.TabIndex = 1;
             this.SwAutoLoad.TextOnChecked = "";
             // 
+            // TbVisits
+            // 
+            this.TbVisits.Location = new System.Drawing.Point(4, 30);
+            this.TbVisits.Name = "TbVisits";
+            this.TbVisits.Size = new System.Drawing.Size(723, 357);
+            this.TbVisits.TabIndex = 3;
+            this.TbVisits.Text = "tabPage1";
+            this.TbVisits.UseVisualStyleBackColor = true;
+            // 
             // ImList
             // 
             this.ImList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
@@ -763,6 +775,7 @@
         private EgoldsGoogleTextBox TbxFirstname;
         public System.Windows.Forms.Timer TimerSaving;
         private EgoldsGoogleTextBox TbxPhone;
+        private System.Windows.Forms.TabPage TbVisits;
     }
 }
 

+ 20 - 15
ImpulseVision/FormMain.cs

@@ -632,9 +632,8 @@ where ID = '{IdUser}'";
                 //Capture.Stop();
                 //Capture.Dispose();
                 Capture.Dispose();
+                CaptureTimer.Tick -= CaptureTimer_Tick;
             }
-            //CaptureTimer.Stop();
-            CaptureTimer.Tick -= CaptureTimer_Tick;
 
             PbxEther.Image = Properties.Resources._9110852_video_no_icon;
 
@@ -669,7 +668,8 @@ where ID = '{IdUser}'";
                 return;
             }
             string PhotoPath = string.Empty;
-            ProgressTrain.Value = 0;
+            ProgressTrain.Value = 10;
+            TslStatus.Text = "Добавление нового пользователя...";
 
             bool Flag = TbxLastname.Text.Trim() == "" || TbxFirstname.Text.Trim() == "" || TbxPasportSeria.Text.Trim() == "" || TbxPasportNum.Text.Trim() == "" || TbxPhone.Text.Trim() == "";
 
@@ -694,7 +694,6 @@ where PassportSeria = '{TbxPasportSeria.Text.Trim()}' and PassportNum = '{TbxPas
             }
             SCon.Close();
 
-
             SCon.Open();
             string QueryAdd = $@"insert into Users (Lastname,Firstname, Patronymic, PassportSeria, PassportNum,Phone, IDUserType) values (@last,@first,@patr,@seria,@number,@phone,3)";
             SqlCommand Cmd = new SqlCommand(QueryAdd, SCon);
@@ -730,12 +729,9 @@ where PassportSeria = '{TbxPasportSeria.Text.Trim()}' and PassportNum = '{TbxPas
             TslStatus.Text = "Сохранение данных о пользователе...";
 
             ProgressTrain.Value = 50;
-            BtnSave.Text = "Сохранение...";
-
-            BtnSave.Text = "Сохранить";
+            TslStatus.Text = "Добавление нового пользователя...";
             //сохранение пути до фотографии
             SCon.Open();
-
             string QueryAddPathImage = $@"insert into FaceImages (UserID,Picture)
 values ({AddingUserID},'{PhotoPath}')";
 
@@ -748,7 +744,6 @@ values ({AddingUserID},'{PhotoPath}')";
             TimerSaving.Start();
 
             TslStatus.Text = "Готов";
-
             ProgressTrain.Value = 100;
         }
 
@@ -935,9 +930,9 @@ values ({AddingUserID},'{PhotoPath}')";
         private void STools_Click(object sender, EventArgs e)
         {
             TabPages.SelectTab(2);
-            ToolsMenu.Enabled = false;
-
-
+            RecogniseOff();
+            BtnEditUser.Enabled = false;
+            BtnDelUser.Enabled = false;
         }
 
         /// <summary>
@@ -1016,12 +1011,17 @@ values ({AddingUserID},'{PhotoPath}')";
             CmbCams.Visible = false;
             TslSelCamText.Visible = false;
 
-            BtnEditUser.Enabled = true;
-            BtnDelUser.Enabled = true;
-
             RecogniseOff();
 
+            GetUsersFromDB();
+
             TabPages.SelectTab(0);
+
+            BtnEditUser.Enabled = true;
+            BtnDelUser.Enabled = true;
+            BtnAddUser.Enabled = true;
+            BtnInfoTraffic.Enabled = true;
+
         }
 
         private void BtnEditUser_Click(object sender, EventArgs e)
@@ -1044,5 +1044,10 @@ values ({AddingUserID},'{PhotoPath}')";
                 TimerSaving.Enabled = false;
             }
         }
+
+        private void BtnInfoTraffic_Click(object sender, EventArgs e)
+        {
+            TabPages.SelectTab(3);
+        }
     }
 }

+ 1 - 1
ImpulseVision/FormMain.resx

@@ -139,7 +139,7 @@
     <value>711, 17</value>
   </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>69</value>
+    <value>58</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">

BIN
ImpulseVision/bin/Debug/ImpulseVision.exe


BIN
ImpulseVision/bin/Debug/Source/TrainedImages/1111.bmp


BIN
ImpulseVision/bin/Debug/Source/TrainedImages/www.bmp