Переглянути джерело

Исправление багов и оптимизация системы

phoenix.XLIX 2 роки тому
батько
коміт
37f5ad84e7

+ 1 - 15
ImpulseVision/ApplicationParameters.cs

@@ -93,21 +93,7 @@ namespace ImpulseVision
         {
 
         }
-        public struct FormParameters
-        {
-            public bool startingWithWindows;
-            public Point points;
-            public Size sizes;
-            public int countDay;
-        }
-        /// <summary>
-        /// получение параметров формы
-        /// </summary>
-        private FormParameters GetParameters()
-        {
-            //получить параметры из реестра и возвратить в качестве структуры
-            return new FormParameters();
-        }
+
         public void DeleteAllParameter()
         {
             RegistryKey Reg = Registry.CurrentUser.OpenSubKey("Software", true);

+ 2 - 2
ImpulseVision/FormEditingGuard.Designer.cs

@@ -277,7 +277,7 @@
             this.TbxPass.TabIndex = 18;
             this.TbxPass.TextInput = "";
             this.TbxPass.TextPreview = "Пароль";
-            this.TbxPass.UseSystemPasswordChar = false;
+            this.TbxPass.UseSystemPasswordChar = true;
             // 
             // TbxConfirmPass
             // 
@@ -297,7 +297,7 @@
             this.TbxConfirmPass.TabIndex = 19;
             this.TbxConfirmPass.TextInput = "";
             this.TbxConfirmPass.TextPreview = "Подтвердите пароль";
-            this.TbxConfirmPass.UseSystemPasswordChar = false;
+            this.TbxConfirmPass.UseSystemPasswordChar = true;
             // 
             // LblUserType
             // 

+ 15 - 7
ImpulseVision/FormGuard.cs

@@ -188,13 +188,17 @@ namespace ImpulseVision
             {
                 while (Res.Read())
                 {
-                    FaceItem = new FaceData();
-                    FaceItem.FaceImage = new Image<Gray, byte>(Application.StartupPath +"\\"+ Res["Picture"].ToString());
-                    FaceItem.PersonName = Res["Firstname"].ToString();
-                    FaceItem.LastName = Res["Lastname"].ToString();
-                    FaceItem.Patronymic = Res["Patronymic"].ToString();
-                    FaceItem.UserID = Res["ID"].ToString();
-                    FaceList.Add(FaceItem);
+                    try
+                    {
+                        FaceItem = new FaceData();
+                        FaceItem.FaceImage = new Image<Gray, byte>(Application.StartupPath + "\\" + Res["Picture"].ToString());
+                        FaceItem.PersonName = Res["Firstname"].ToString();
+                        FaceItem.LastName = Res["Lastname"].ToString();
+                        FaceItem.Patronymic = Res["Patronymic"].ToString();
+                        FaceItem.UserID = Res["ID"].ToString();
+                        FaceList.Add(FaceItem);
+                    }
+                    catch { }
                 }
             }
             else
@@ -545,6 +549,10 @@ where ut.[Date] = cast(GETDATE() as date)";
             try
             {
                 Image<Bgr, byte> Img = BgrFrame.Copy();
+                if(!Directory.Exists(Application.StartupPath+@"\Source\log"))
+                {
+                    Directory.CreateDirectory(Application.StartupPath + @"\Source\log");
+                }
                 string PathLog = Application.StartupPath + $"\\Source\\log\\{"User_" + CurrentUserID + "_" + DateTime.Now.ToString("HHmmss") + "_" + DateTime.Now.ToString("dd.MM.yyyy") + "_" + Guid.NewGuid().ToString().Substring(0, 4)}.bmp";
                 Img.Save(PathLog);
             }

+ 7 - 2
ImpulseVision/FormMain.cs

@@ -362,11 +362,16 @@ where ID = '{IdUser}'";
             else
             {
                 SCon.Open();
+                string QueryDelUser = $@"delete 
+from HistoryLogin
+where StaffsID = '{IdUser}'";
+                SqlCommand Cmd = new SqlCommand(QueryDelUser, SCon);
+                Cmd.ExecuteNonQuery();
 
-                string QueryDelUser = $@"delete
+                QueryDelUser = $@"delete
 from {NameUserType}
 where ID = '{IdUser}'";
-                SqlCommand Cmd = new SqlCommand(QueryDelUser, SCon);
+                Cmd = new SqlCommand(QueryDelUser, SCon);
                 Cmd.ExecuteNonQuery();
 
                 SCon.Close();

BIN
ImpulseVision/bin/Debug/ImpulseVision.exe