Ver código fonte

RELEASE (BETA)

Вячеслав Терешенко 2 anos atrás
pai
commit
b91733fd0c

+ 116 - 92
T FaceRecognizer/FormMain.Designer.cs

@@ -77,15 +77,17 @@
             this.CmbCams = new System.Windows.Forms.ComboBox();
             this.label7 = new System.Windows.Forms.Label();
             this.tabPage5 = new System.Windows.Forms.TabPage();
-            this.SplitContainer = new System.Windows.Forms.SplitContainer();
-            this.PanelTitle = new System.Windows.Forms.Panel();
-            this.PbxLogo = new System.Windows.Forms.PictureBox();
-            this.LblTitle = new System.Windows.Forms.Label();
             this.GbxInfo = new System.Windows.Forms.GroupBox();
-            this.label6 = new System.Windows.Forms.Label();
-            this.label8 = new System.Windows.Forms.Label();
-            this.label9 = new System.Windows.Forms.Label();
             this.label10 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.PanelTitle = new System.Windows.Forms.Panel();
+            this.LblTitle = new System.Windows.Forms.Label();
+            this.PbxLogo = new System.Windows.Forms.PictureBox();
+            this.SplitContainer = new System.Windows.Forms.SplitContainer();
+            this.TbxSearch = new System.Windows.Forms.TextBox();
+            this.label11 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.PbxFaces)).BeginInit();
             this.PanelMenu.SuspendLayout();
             this.PanSettings.SuspendLayout();
@@ -107,13 +109,13 @@
             ((System.ComponentModel.ISupportInitialize)(this.DgbJournal)).BeginInit();
             this.tabPage4.SuspendLayout();
             this.tabPage5.SuspendLayout();
+            this.GbxInfo.SuspendLayout();
+            this.PanelTitle.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.PbxLogo)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).BeginInit();
             this.SplitContainer.Panel1.SuspendLayout();
             this.SplitContainer.Panel2.SuspendLayout();
             this.SplitContainer.SuspendLayout();
-            this.PanelTitle.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.PbxLogo)).BeginInit();
-            this.GbxInfo.SuspendLayout();
             this.SuspendLayout();
             // 
             // PbxFaces
@@ -504,11 +506,11 @@
             this.tabPage2.Controls.Add(this.BtnIn);
             this.tabPage2.Controls.Add(this.BtnOut);
             this.tabPage2.Controls.Add(this.PbxIdentification);
-            this.tabPage2.Location = new System.Drawing.Point(4, 22);
+            this.tabPage2.Location = new System.Drawing.Point(4, 30);
             this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.tabPage2.Name = "tabPage2";
             this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.tabPage2.Size = new System.Drawing.Size(429, 363);
+            this.tabPage2.Size = new System.Drawing.Size(429, 355);
             this.tabPage2.TabIndex = 1;
             this.tabPage2.Text = "Ident";
             this.tabPage2.UseVisualStyleBackColor = true;
@@ -518,7 +520,7 @@
             this.BtnIn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.BtnIn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(166)))), ((int)(((byte)(64)))));
             this.BtnIn.ForeColor = System.Drawing.Color.White;
-            this.BtnIn.Location = new System.Drawing.Point(230, 289);
+            this.BtnIn.Location = new System.Drawing.Point(235, 308);
             this.BtnIn.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.BtnIn.Name = "BtnIn";
             this.BtnIn.Size = new System.Drawing.Size(190, 37);
@@ -532,7 +534,7 @@
             this.BtnOut.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.BtnOut.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(166)))), ((int)(((byte)(64)))));
             this.BtnOut.ForeColor = System.Drawing.Color.White;
-            this.BtnOut.Location = new System.Drawing.Point(8, 289);
+            this.BtnOut.Location = new System.Drawing.Point(8, 308);
             this.BtnOut.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.BtnOut.Name = "BtnOut";
             this.BtnOut.Size = new System.Drawing.Size(190, 37);
@@ -550,17 +552,19 @@
             this.PbxIdentification.Location = new System.Drawing.Point(4, 5);
             this.PbxIdentification.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.PbxIdentification.Name = "PbxIdentification";
-            this.PbxIdentification.Size = new System.Drawing.Size(421, 274);
+            this.PbxIdentification.Size = new System.Drawing.Size(421, 293);
             this.PbxIdentification.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.PbxIdentification.TabIndex = 1;
             this.PbxIdentification.TabStop = false;
             // 
             // tabPage3
             // 
+            this.tabPage3.Controls.Add(this.label11);
+            this.tabPage3.Controls.Add(this.TbxSearch);
             this.tabPage3.Controls.Add(this.DgbJournal);
-            this.tabPage3.Location = new System.Drawing.Point(4, 22);
+            this.tabPage3.Location = new System.Drawing.Point(4, 30);
             this.tabPage3.Name = "tabPage3";
-            this.tabPage3.Size = new System.Drawing.Size(429, 363);
+            this.tabPage3.Size = new System.Drawing.Size(429, 355);
             this.tabPage3.TabIndex = 2;
             this.tabPage3.Text = "Journal";
             this.tabPage3.UseVisualStyleBackColor = true;
@@ -583,7 +587,7 @@
             this.Column2,
             this.Column3});
             this.DgbJournal.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(243)))), ((int)(((byte)(243)))));
-            this.DgbJournal.Location = new System.Drawing.Point(3, 3);
+            this.DgbJournal.Location = new System.Drawing.Point(3, 40);
             this.DgbJournal.MultiSelect = false;
             this.DgbJournal.Name = "DgbJournal";
             this.DgbJournal.ReadOnly = true;
@@ -591,7 +595,7 @@
             this.DgbJournal.RowTemplate.DividerHeight = 5;
             this.DgbJournal.RowTemplate.Height = 35;
             this.DgbJournal.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
-            this.DgbJournal.Size = new System.Drawing.Size(423, 349);
+            this.DgbJournal.Size = new System.Drawing.Size(423, 304);
             this.DgbJournal.TabIndex = 0;
             this.DgbJournal.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgbJournal_CellDoubleClick);
             // 
@@ -636,7 +640,7 @@
             this.BtnSaveParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.BtnSaveParameters.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(166)))), ((int)(((byte)(64)))));
             this.BtnSaveParameters.ForeColor = System.Drawing.Color.White;
-            this.BtnSaveParameters.Location = new System.Drawing.Point(79, 308);
+            this.BtnSaveParameters.Location = new System.Drawing.Point(79, 300);
             this.BtnSaveParameters.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.BtnSaveParameters.Name = "BtnSaveParameters";
             this.BtnSaveParameters.Size = new System.Drawing.Size(341, 37);
@@ -695,23 +699,61 @@
             this.tabPage5.Text = "Main";
             this.tabPage5.UseVisualStyleBackColor = true;
             // 
-            // SplitContainer
+            // GbxInfo
             // 
-            this.SplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.SplitContainer.IsSplitterFixed = true;
-            this.SplitContainer.Location = new System.Drawing.Point(0, 0);
-            this.SplitContainer.Name = "SplitContainer";
+            this.GbxInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.GbxInfo.Controls.Add(this.label10);
+            this.GbxInfo.Controls.Add(this.label9);
+            this.GbxInfo.Controls.Add(this.label8);
+            this.GbxInfo.Controls.Add(this.label6);
+            this.GbxInfo.Location = new System.Drawing.Point(6, 110);
+            this.GbxInfo.Name = "GbxInfo";
+            this.GbxInfo.Size = new System.Drawing.Size(415, 229);
+            this.GbxInfo.TabIndex = 1;
+            this.GbxInfo.TabStop = false;
+            this.GbxInfo.Text = "О программе";
             // 
-            // SplitContainer.Panel1
+            // label10
             // 
-            this.SplitContainer.Panel1.Controls.Add(this.PanelMenu);
+            this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.label10.Location = new System.Drawing.Point(6, 176);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(403, 58);
+            this.label10.TabIndex = 3;
+            this.label10.Text = "• Настройка параметров приложения";
             // 
-            // SplitContainer.Panel2
+            // label9
             // 
-            this.SplitContainer.Panel2.Controls.Add(this.TabPages);
-            this.SplitContainer.Size = new System.Drawing.Size(689, 389);
-            this.SplitContainer.SplitterDistance = 248;
-            this.SplitContainer.TabIndex = 5;
+            this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.label9.Location = new System.Drawing.Point(6, 133);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(403, 43);
+            this.label9.TabIndex = 2;
+            this.label9.Text = "• Просмотр журнала посещений для каждого пользователя";
+            // 
+            // label8
+            // 
+            this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.label8.Location = new System.Drawing.Point(6, 88);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(403, 45);
+            this.label8.TabIndex = 1;
+            this.label8.Text = "• Идентификация учащихся при входе и выходе из учебного заведения";
+            // 
+            // label6
+            // 
+            this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.label6.Location = new System.Drawing.Point(6, 38);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(388, 39);
+            this.label6.TabIndex = 0;
+            this.label6.Text = "• Простое добавление новых пользователей";
             // 
             // PanelTitle
             // 
@@ -724,17 +766,6 @@
             this.PanelTitle.Size = new System.Drawing.Size(429, 100);
             this.PanelTitle.TabIndex = 0;
             // 
-            // PbxLogo
-            // 
-            this.PbxLogo.Dock = System.Windows.Forms.DockStyle.Right;
-            this.PbxLogo.Image = global::T_FaceRecognizer.Properties.Resources.FaceIcon;
-            this.PbxLogo.Location = new System.Drawing.Point(325, 0);
-            this.PbxLogo.Name = "PbxLogo";
-            this.PbxLogo.Size = new System.Drawing.Size(104, 100);
-            this.PbxLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
-            this.PbxLogo.TabIndex = 0;
-            this.PbxLogo.TabStop = false;
-            // 
             // LblTitle
             // 
             this.LblTitle.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -746,61 +777,51 @@
             this.LblTitle.Text = "FaceTrack профессиональный";
             this.LblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
-            // GbxInfo
+            // PbxLogo
             // 
-            this.GbxInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.GbxInfo.Controls.Add(this.label10);
-            this.GbxInfo.Controls.Add(this.label9);
-            this.GbxInfo.Controls.Add(this.label8);
-            this.GbxInfo.Controls.Add(this.label6);
-            this.GbxInfo.Location = new System.Drawing.Point(6, 110);
-            this.GbxInfo.Name = "GbxInfo";
-            this.GbxInfo.Size = new System.Drawing.Size(415, 237);
-            this.GbxInfo.TabIndex = 1;
-            this.GbxInfo.TabStop = false;
-            this.GbxInfo.Text = "О программе";
+            this.PbxLogo.Dock = System.Windows.Forms.DockStyle.Right;
+            this.PbxLogo.Image = global::T_FaceRecognizer.Properties.Resources.FaceIcon;
+            this.PbxLogo.Location = new System.Drawing.Point(325, 0);
+            this.PbxLogo.Name = "PbxLogo";
+            this.PbxLogo.Size = new System.Drawing.Size(104, 100);
+            this.PbxLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.PbxLogo.TabIndex = 0;
+            this.PbxLogo.TabStop = false;
             // 
-            // label6
+            // SplitContainer
             // 
-            this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.label6.Location = new System.Drawing.Point(6, 38);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(388, 39);
-            this.label6.TabIndex = 0;
-            this.label6.Text = "• Простое добавление новых пользователей";
+            this.SplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.SplitContainer.IsSplitterFixed = true;
+            this.SplitContainer.Location = new System.Drawing.Point(0, 0);
+            this.SplitContainer.Name = "SplitContainer";
             // 
-            // label8
+            // SplitContainer.Panel1
             // 
-            this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.label8.Location = new System.Drawing.Point(6, 88);
-            this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(403, 45);
-            this.label8.TabIndex = 1;
-            this.label8.Text = "• Идентификация учащихся при входе и выходе из учебного заведения";
+            this.SplitContainer.Panel1.Controls.Add(this.PanelMenu);
             // 
-            // label9
+            // SplitContainer.Panel2
             // 
-            this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.label9.Location = new System.Drawing.Point(6, 133);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(403, 43);
-            this.label9.TabIndex = 2;
-            this.label9.Text = "• Просмотр журнала посещений для каждого пользователя";
+            this.SplitContainer.Panel2.Controls.Add(this.TabPages);
+            this.SplitContainer.Size = new System.Drawing.Size(689, 389);
+            this.SplitContainer.SplitterDistance = 248;
+            this.SplitContainer.TabIndex = 5;
             // 
-            // label10
+            // TbxSearch
             // 
-            this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.label10.Location = new System.Drawing.Point(6, 176);
-            this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(403, 58);
-            this.label10.TabIndex = 3;
-            this.label10.Text = "• Настройка параметров приложения";
+            this.TbxSearch.Location = new System.Drawing.Point(139, 5);
+            this.TbxSearch.Name = "TbxSearch";
+            this.TbxSearch.Size = new System.Drawing.Size(282, 29);
+            this.TbxSearch.TabIndex = 1;
+            this.TbxSearch.TextChanged += new System.EventHandler(this.TbxSearch_TextChanged);
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(4, 8);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(129, 21);
+            this.label11.TabIndex = 2;
+            this.label11.Text = "Поиск по ФИО: ";
             // 
             // FormMain
             // 
@@ -840,17 +861,18 @@
             this.tabPage2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.PbxIdentification)).EndInit();
             this.tabPage3.ResumeLayout(false);
+            this.tabPage3.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.DgbJournal)).EndInit();
             this.tabPage4.ResumeLayout(false);
             this.tabPage4.PerformLayout();
             this.tabPage5.ResumeLayout(false);
+            this.GbxInfo.ResumeLayout(false);
+            this.PanelTitle.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.PbxLogo)).EndInit();
             this.SplitContainer.Panel1.ResumeLayout(false);
             this.SplitContainer.Panel2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).EndInit();
             this.SplitContainer.ResumeLayout(false);
-            this.PanelTitle.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.PbxLogo)).EndInit();
-            this.GbxInfo.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
@@ -913,6 +935,8 @@
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.Label label8;
         private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.TextBox TbxSearch;
     }
 }
 

+ 16 - 16
T FaceRecognizer/FormMain.cs

@@ -206,7 +206,6 @@ namespace T_FaceRecognizer
         {
             if (ImageList.Size != 0)
             {
-                //Eigen Face Algorithm
                 FaceRecognizer.PredictionResult result = recognizer.Predict(DetectedFace.Resize(100, 100, Inter.Cubic));
                 FaceName = NameList[result.Label];
 
@@ -392,8 +391,6 @@ values (@last,@first,@patr,@phone,@snils,@photo)
 
         private void BtnAddUser_Click(object sender, EventArgs e)
         {
-            //RecognizeOff();
-
             CaptureTimer = new Timer()
             {
                 Interval = Config.TimerResponseValue
@@ -422,15 +419,6 @@ values (@last,@first,@patr,@phone,@snils,@photo)
             };
             CaptureTimerIdent.Tick += CaptureTimerIdent_Tick;
 
-            //try
-            //{
-            //    RecognizeOff();
-            //}
-            //catch (Exception ex)
-            //{
-            //    MessageBox.Show(ex.Message, "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
-            //}
-
             GetFacesListForIdentification();
 
             Capture = new VideoCapture(SelectedCameraID);
@@ -488,7 +476,7 @@ values (@last,@first,@patr,@phone,@snils,@photo)
             if (BgrFrame != null)
             {
                 try
-                {//for emgu cv bug
+                {
                     Image<Gray, byte> grayframe = BgrFrame.Convert<Gray, byte>();
 
                     Rectangle[] faces = HaarCascade.DetectMultiScale(grayframe, 1.2, 10, new System.Drawing.Size(50, 50), new System.Drawing.Size(200, 200));
@@ -514,7 +502,9 @@ values (@last,@first,@patr,@phone,@snils,@photo)
         }
 
 
-
+        /// <summary>
+        /// получение информации о пользователе и тренировка модели для распознавания
+        /// </summary>
         private void GetFacesListForIdentification()
         {
             //файл Хаара
@@ -569,7 +559,7 @@ from Users";
                 LabelList.Push(new[] { i++ });
             }
 
-            // Тренировка распознавания
+            // Тренировка модели
             if (ImageList.Size > 0)
             {
                 recognizer = new EigenFaceRecognizer(ImageList.Size);
@@ -677,7 +667,12 @@ where UsersID = '{CurrentUserID}' and [Date] = cast(GETDATE() as date)";
             string QueryGetVisits = $@"select UserID,Lastname +' '+Firstname+' '+Patronymic as FIO,(select MAX([Date])
 from Visits
 where UsersID = Users.UserID) as LastDateVisit
-from Users";
+from Users
+";
+            if(TbxSearch.Text.Trim() != string.Empty)
+            {
+                QueryGetVisits += $@"  where Lastname +' '+Firstname+' '+Patronymic like '%{TbxSearch.Text.Trim()}%'";
+            }
             SqlCommand CommandGetVisits = new SqlCommand(QueryGetVisits, SCon);
             SqlDataReader Res = CommandGetVisits.ExecuteReader();
             if(Res.HasRows)
@@ -847,5 +842,10 @@ from Users";
             MessageBox.Show("Выбранные параметры успешно применены!", "FaceTrack", MessageBoxButtons.OK, MessageBoxIcon.Information);
 
         }
+
+        private void TbxSearch_TextChanged(object sender, EventArgs e)
+        {
+            GetInformationAboutVisiting();
+        }
     }
 }

+ 14 - 16
T FaceRecognizer/FormVisiting.Designer.cs

@@ -30,8 +30,8 @@
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormVisiting));
             this.PanelTitle = new System.Windows.Forms.Panel();
-            this.label1 = new System.Windows.Forms.Label();
             this.LblUserName = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
             this.DgbVisitingForSelectedUser = new System.Windows.Forms.DataGridView();
             this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -55,18 +55,6 @@
             this.PanelTitle.Size = new System.Drawing.Size(643, 84);
             this.PanelTitle.TabIndex = 0;
             // 
-            // label1
-            // 
-            this.label1.Dock = System.Windows.Forms.DockStyle.Top;
-            this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 16F, System.Drawing.FontStyle.Bold);
-            this.label1.ForeColor = System.Drawing.Color.White;
-            this.label1.Location = new System.Drawing.Point(0, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(643, 47);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "Сводка посещений для пользователя: ";
-            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
             // LblUserName
             // 
             this.LblUserName.Dock = System.Windows.Forms.DockStyle.Bottom;
@@ -79,6 +67,18 @@
             this.LblUserName.Text = "Lastname Firstname Patronymic";
             this.LblUserName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
+            // label1
+            // 
+            this.label1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 16F, System.Drawing.FontStyle.Bold);
+            this.label1.ForeColor = System.Drawing.Color.White;
+            this.label1.Location = new System.Drawing.Point(0, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(643, 47);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Сводка посещений для пользователя: ";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
             // DgbVisitingForSelectedUser
             // 
             this.DgbVisitingForSelectedUser.AllowUserToAddRows = false;
@@ -161,13 +161,11 @@
             // CbxFilterDate
             // 
             this.CbxFilterDate.AutoSize = true;
-            this.CbxFilterDate.Checked = true;
-            this.CbxFilterDate.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CbxFilterDate.Location = new System.Drawing.Point(262, 92);
             this.CbxFilterDate.Name = "CbxFilterDate";
             this.CbxFilterDate.Size = new System.Drawing.Size(181, 25);
             this.CbxFilterDate.TabIndex = 7;
-            this.CbxFilterDate.Text = "Сортировка по дате";
+            this.CbxFilterDate.Text = "Фильтрация по дате";
             this.CbxFilterDate.UseVisualStyleBackColor = true;
             this.CbxFilterDate.CheckedChanged += new System.EventHandler(this.CbxFilterDate_CheckedChanged);
             // 

+ 3 - 1
T FaceRecognizer/FormVisiting.cs

@@ -39,11 +39,13 @@ namespace T_FaceRecognizer
             string QueryOnGetVisitsForSelectedUser = $@"set dateformat dmy
 select UsersID,FORMAT(cast([Date] as date),N'dd\.MM\.yyyy') as VisitDate,FORMAT(cast(TimeEntrance as time), N'hh\:mm\:ss') as timeIn,FORMAT(cast(TimeExit as time),N'hh\:mm\:ss')as timeEx
 from Visits
-where UsersID = '{UserID}' ";
+where UsersID = '{UserID}' 
+";
             if(CbxFilterDate.Checked)
             {
                 QueryOnGetVisitsForSelectedUser += $@"  and [Date] = '{DtpVisitDate.Value.Date}'";
             }
+            QueryOnGetVisitsForSelectedUser += "  order by VisitDate";
 
             SqlCommand Cmd = new SqlCommand(QueryOnGetVisitsForSelectedUser, SCon);
             SqlDataReader Res = Cmd.ExecuteReader();

BIN
T FaceRecognizer/bin/Debug/T FaceRecognizer.exe