Procházet zdrojové kódy

Работа с окном просмотра посещений

Вячеслав Терешенко před 2 roky
rodič
revize
03fb23620d

+ 1 - 1
ImpulseVision/FormGuard.Designer.cs

@@ -430,7 +430,7 @@
             this.rPanel2.Name = "rPanel2";
             this.rPanel2.RippleColor = System.Drawing.Color.White;
             this.rPanel2.RoundingEnable = true;
-            this.rPanel2.Size = new System.Drawing.Size(527, 25);
+            this.rPanel2.Size = new System.Drawing.Size(539, 25);
             this.rPanel2.TabIndex = 27;
             this.rPanel2.TextHover = null;
             this.rPanel2.UseDownPressEffectOnClick = false;

+ 127 - 4
ImpulseVision/FormMain.Designer.cs

@@ -77,6 +77,13 @@
             this.LblTextSettings = new System.Windows.Forms.Label();
             this.SwAutoLoad = new ImpulseVision.EgoldsToggleSwitch();
             this.TbVisits = new System.Windows.Forms.TabPage();
+            this.PanelHeader = new System.Windows.Forms.Panel();
+            this.label11 = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.TbxFindUser = new System.Windows.Forms.TextBox();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
             this.TabJournal = new System.Windows.Forms.TableLayoutPanel();
             this.BtnJournal = new System.Windows.Forms.Button();
             this.DtpFiniteDate = new System.Windows.Forms.DateTimePicker();
@@ -89,6 +96,7 @@
             this.ImList = new System.Windows.Forms.ImageList(this.components);
             this.TimerSaving = new System.Windows.Forms.Timer(this.components);
             this.TmAnim = new System.Windows.Forms.Timer(this.components);
+            this.RPanelForNameUser = new ImpulseVision.RPanel();
             this.menuStrip1.SuspendLayout();
             this.ToolsMenu.SuspendLayout();
             this.statusStrip1.SuspendLayout();
@@ -104,6 +112,7 @@
             this.RPanelSettings.SuspendLayout();
             this.TbVisits.SuspendLayout();
             this.PanelPeriod.SuspendLayout();
+            this.RPanelForNameUser.SuspendLayout();
             this.SuspendLayout();
             // 
             // menuStrip1
@@ -677,6 +686,13 @@
             // TbVisits
             // 
             this.TbVisits.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(255)))), ((int)(((byte)(252)))));
+            this.TbVisits.Controls.Add(this.RPanelForNameUser);
+            this.TbVisits.Controls.Add(this.label11);
+            this.TbVisits.Controls.Add(this.PanelHeader);
+            this.TbVisits.Controls.Add(this.label10);
+            this.TbVisits.Controls.Add(this.TbxFindUser);
+            this.TbVisits.Controls.Add(this.label9);
+            this.TbVisits.Controls.Add(this.label7);
             this.TbVisits.Controls.Add(this.TabJournal);
             this.TbVisits.Controls.Add(this.BtnJournal);
             this.TbVisits.Controls.Add(this.DtpFiniteDate);
@@ -689,6 +705,76 @@
             this.TbVisits.TabIndex = 3;
             this.TbVisits.Text = "tabPage1";
             // 
+            // PanelHeader
+            // 
+            this.PanelHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.PanelHeader.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.PanelHeader.Location = new System.Drawing.Point(0, 49);
+            this.PanelHeader.Name = "PanelHeader";
+            this.PanelHeader.Size = new System.Drawing.Size(720, 26);
+            this.PanelHeader.TabIndex = 8;
+            // 
+            // label11
+            // 
+            this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.label11.Location = new System.Drawing.Point(578, 78);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(149, 26);
+            this.label11.TabIndex = 3;
+            this.label11.Text = "Дата";
+            this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label10
+            // 
+            this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.label10.Location = new System.Drawing.Point(443, 78);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(134, 26);
+            this.label10.TabIndex = 2;
+            this.label10.Text = "Время выхода";
+            this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // TbxFindUser
+            // 
+            this.TbxFindUser.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.TbxFindUser.Location = new System.Drawing.Point(143, 317);
+            this.TbxFindUser.Name = "TbxFindUser";
+            this.TbxFindUser.Size = new System.Drawing.Size(221, 29);
+            this.TbxFindUser.TabIndex = 7;
+            this.TbxFindUser.TextChanged += new System.EventHandler(this.TbxFindUser_TextChanged);
+            // 
+            // label9
+            // 
+            this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.label9.Location = new System.Drawing.Point(280, 78);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(149, 26);
+            this.label9.TabIndex = 1;
+            this.label9.Text = "Время входа";
+            this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label7
+            // 
+            this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(9, 320);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(128, 21);
+            this.label7.TabIndex = 6;
+            this.label7.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(5, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(235, 25);
+            this.label8.TabIndex = 0;
+            this.label8.Text = "Имя пользователя";
+            this.label8.TextAlign = System.Drawing.ContentAlignment.TopCenter;
+            // 
             // TabJournal
             // 
             this.TabJournal.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
@@ -697,20 +783,20 @@
             this.TabJournal.AutoScroll = true;
             this.TabJournal.ColumnCount = 1;
             this.TabJournal.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
-            this.TabJournal.Location = new System.Drawing.Point(0, 49);
+            this.TabJournal.Location = new System.Drawing.Point(0, 131);
             this.TabJournal.Name = "TabJournal";
             this.TabJournal.RowCount = 1;
             this.TabJournal.RowStyles.Add(new System.Windows.Forms.RowStyle());
-            this.TabJournal.Size = new System.Drawing.Size(723, 264);
+            this.TabJournal.Size = new System.Drawing.Size(723, 182);
             this.TabJournal.TabIndex = 5;
             // 
             // BtnJournal
             // 
-            this.BtnJournal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.BtnJournal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.BtnJournal.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(124)))), ((int)(((byte)(136)))), ((int)(((byte)(144)))));
             this.BtnJournal.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
             this.BtnJournal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(255)))), ((int)(((byte)(248)))));
-            this.BtnJournal.Location = new System.Drawing.Point(3, 319);
+            this.BtnJournal.Location = new System.Drawing.Point(434, 319);
             this.BtnJournal.Name = "BtnJournal";
             this.BtnJournal.Size = new System.Drawing.Size(281, 35);
             this.BtnJournal.TabIndex = 4;
@@ -800,6 +886,33 @@
             this.TmAnim.Interval = 25;
             this.TmAnim.Tick += new System.EventHandler(this.TmAnim_Tick);
             // 
+            // RPanelForNameUser
+            // 
+            this.RPanelForNameUser.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.RPanelForNameUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(104)))), ((int)(((byte)(112)))));
+            this.RPanelForNameUser.BackColorAdditional = System.Drawing.Color.Gray;
+            this.RPanelForNameUser.BackColorGradientEnabled = false;
+            this.RPanelForNameUser.BackColorGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
+            this.RPanelForNameUser.BorderColor = System.Drawing.Color.Tomato;
+            this.RPanelForNameUser.BorderColorEnabled = false;
+            this.RPanelForNameUser.BorderColorOnHover = System.Drawing.Color.Tomato;
+            this.RPanelForNameUser.BorderColorOnHoverEnabled = false;
+            this.RPanelForNameUser.Controls.Add(this.label8);
+            this.RPanelForNameUser.Cursor = System.Windows.Forms.Cursors.Default;
+            this.RPanelForNameUser.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 12F, System.Drawing.FontStyle.Bold);
+            this.RPanelForNameUser.ForeColor = System.Drawing.Color.White;
+            this.RPanelForNameUser.Location = new System.Drawing.Point(3, 98);
+            this.RPanelForNameUser.Name = "RPanelForNameUser";
+            this.RPanelForNameUser.RippleColor = System.Drawing.Color.Black;
+            this.RPanelForNameUser.RoundingEnable = true;
+            this.RPanelForNameUser.Size = new System.Drawing.Size(243, 25);
+            this.RPanelForNameUser.TabIndex = 9;
+            this.RPanelForNameUser.TextHover = null;
+            this.RPanelForNameUser.UseDownPressEffectOnClick = false;
+            this.RPanelForNameUser.UseRippleEffect = true;
+            this.RPanelForNameUser.UseZoomEffectOnHover = false;
+            // 
             // FormMain
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F);
@@ -839,8 +952,10 @@
             this.TbSettings.PerformLayout();
             this.RPanelSettings.ResumeLayout(false);
             this.TbVisits.ResumeLayout(false);
+            this.TbVisits.PerformLayout();
             this.PanelPeriod.ResumeLayout(false);
             this.PanelPeriod.PerformLayout();
+            this.RPanelForNameUser.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -907,6 +1022,14 @@
         private System.Windows.Forms.Timer TmAnim;
         private System.Windows.Forms.Button BtnJournal;
         private System.Windows.Forms.TableLayoutPanel TabJournal;
+        private System.Windows.Forms.TextBox TbxFindUser;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Panel PanelHeader;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label label8;
+        private RPanel RPanelForNameUser;
     }
 }
 

+ 8 - 10
ImpulseVision/FormMain.cs

@@ -935,6 +935,7 @@ from UserTraffic ut join Users on ut.UserID = Users.ID
             {
                 QueryGetVisits += $"  where [Date] between '{DtpDateStart.Value.Date}' and '{DtpDateEnd.Value.Date}'";
             }
+            QueryGetVisits += $@"  and Users.Lastname +' '+ Users.Firstname + ' '+Users.Patronymic like '%{TbxFindUser.Text.Trim()}%'";
             SqlCommand Cmd = new SqlCommand(QueryGetVisits, SCon);
             SqlDataReader Res = Cmd.ExecuteReader();
 
@@ -1034,16 +1035,7 @@ from UserTraffic ut join Users on ut.UserID = Users.ID
 
         private void BtnJournal_Click(object sender, EventArgs e)
         {
-            TabJournal.Controls.Clear();
-            for (int i = 0; i < 10; i++)
-            {
-                TileOvals Ovals = new TileOvals();
-                Ovals.LblNameUser.Text = "Иванов Иван Иванович";
-                Ovals.LblTimeEntrance.Text = "13:15:00";
-                Ovals.LblTimeExit.Text = "13:48:59";
-                Ovals.LblDate.Text = "26.04.2023";
-                TabJournal.Controls.Add(Ovals);
-            }
+
         }
 
         private void DtpFiniteDate_ValueChanged(object sender, EventArgs e)
@@ -1060,5 +1052,11 @@ from UserTraffic ut join Users on ut.UserID = Users.ID
         {
             GetJournalVisits();
         }
+
+        private void TbxFindUser_TextChanged(object sender, EventArgs e)
+        {
+            GetJournalVisits();
+        }
+
     }
 }

binární
ImpulseVision/bin/Debug/ImpulseVision.exe