From 2ad770cf6983c458a2cf511539a387fdbfd20124 Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sat, 8 Jul 2017 12:31:47 +0200 Subject: [PATCH 1/8] Updated TODO.md file --- TODO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index b72bef2..04467b8 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,6 @@ ## Modification to do for the project - Add validation part for can't modify computer progress when it's to be send out - Add logger for all operations -- Update ID Generator for more generation at a time +- Update ID Generator for more generation at a time (and try to add printing function) - Modify add computer function to add a full serial of computer (gain of time) - Add option to access at DB location (for backup ex.) From 00c07b4accc198d14e1318399bbdfbe5649a579b Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sat, 8 Jul 2017 12:58:53 +0200 Subject: [PATCH 2/8] Completed README.md for informations on the project --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 61e46d5..4cf29fc 100644 --- a/README.md +++ b/README.md @@ -1 +1,37 @@ # ISEN Repair Inventory Manager + + +## Brief description +The ISEN Repair Inventory Manager + is a project for the ultimate goal tracking and managing computers +restored by the ISEN Repair Club. The specifications are constantly changing according to the needs +and the remarks making it even easier to use. + +## How to install ? +You have two options for that : +- Using the ClickOnce's Microsoft technology for automated install and update +(Certified without ads/virus/unwanted content). Because I hate it ^^ +- Using the zip package in releases section to manually install of the app. In this way the application +can be installed on a key including the database (Be careful not to lose it, make backups !!) +In the case of updating the two ways seen above, they are carried out without erasing the database. +(But we will never repeat it enough: make backups !!!) + +## How to use this sh***t ? +Sorry... I'm busy on it :/ + +## What is planned ? +- Until the end of the 0.9 alpha the software will have to do the minimum of what is asked, ie it will +at least be able to record and manage the tracking of each computer individually. +- Starting with the 0.9 beta, the software will begin to have improvements after the return of users +to improve its ergonomics and use. +- Version 1.0 will be released when all aspects of improvements have been properly completed. As the +minor versions (1.1, 1.2, 1.3,...), there will be additions of functions for the more pars mentioned +in the file TODO.md. +- (Uncertain) For version 2.0, the system will be completely revised to run on a SQL database and also +have 'online' support to use its smartphone for all tracking operations. +- (Even more uncertain) For future versions, there will still be additions of functions that will be +for the most pars cited in the file TODO.md, with the possibility of adding a web platform allowing +customers / schools to make a return On the hardware, inform us in case of breakdown, etc... + +## Thanks +- The REPAIR team (for support) From 91c2520b2f76674ed8f940082b12ef67b39c3e56 Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sat, 8 Jul 2017 14:14:05 +0200 Subject: [PATCH 3/8] Last change to README and TODO files --- README.md | 6 +++--- TODO.md | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 TODO.md diff --git a/README.md b/README.md index 4cf29fc..1eb5526 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,12 @@ at least be able to record and manage the tracking of each computer individually - Starting with the 0.9 beta, the software will begin to have improvements after the return of users to improve its ergonomics and use. - Version 1.0 will be released when all aspects of improvements have been properly completed. As the -minor versions (1.1, 1.2, 1.3,...), there will be additions of functions for the more pars mentioned -in the file TODO.md. +minor versions (1.1, 1.2, 1.3,...), there will be additions of functions for the more parts mentioned +in the project V1.0 section. - (Uncertain) For version 2.0, the system will be completely revised to run on a SQL database and also have 'online' support to use its smartphone for all tracking operations. - (Even more uncertain) For future versions, there will still be additions of functions that will be -for the most pars cited in the file TODO.md, with the possibility of adding a web platform allowing +for the most parts cited in the project V2.0 section, with the possibility of adding a web platform allowing customers / schools to make a return On the hardware, inform us in case of breakdown, etc... ## Thanks diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 04467b8..0000000 --- a/TODO.md +++ /dev/null @@ -1,6 +0,0 @@ -## Modification to do for the project -- Add validation part for can't modify computer progress when it's to be send out -- Add logger for all operations -- Update ID Generator for more generation at a time (and try to add printing function) -- Modify add computer function to add a full serial of computer (gain of time) -- Add option to access at DB location (for backup ex.) From 9cffd0ff35314a93725a772dcec532bfd947a0c3 Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sat, 8 Jul 2017 14:16:37 +0200 Subject: [PATCH 4/8] Deleted config theme file --- _config.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 _config.yml diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 3397c9a..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-architect \ No newline at end of file From e7e1813d5349584cc0ac5e68d8b989f22c86fafd Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sat, 8 Jul 2017 17:05:38 +0200 Subject: [PATCH 5/8] An attempt to add logger class --- .../ISEN-Repair Inventory Manager.vbproj | 3 +- ISEN-Repair Inventory Manager/Logger.vb | 42 +++++++++++++++++++ ISEN-Repair Inventory Manager/Main.vb | 1 + 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 ISEN-Repair Inventory Manager/Logger.vb diff --git a/ISEN-Repair Inventory Manager/ISEN-Repair Inventory Manager.vbproj b/ISEN-Repair Inventory Manager/ISEN-Repair Inventory Manager.vbproj index 977ea89..c7369b3 100644 --- a/ISEN-Repair Inventory Manager/ISEN-Repair Inventory Manager.vbproj +++ b/ISEN-Repair Inventory Manager/ISEN-Repair Inventory Manager.vbproj @@ -33,7 +33,7 @@ ISEN-Repair 0.8.1.0 true - publish.htm + index.htm false 2 0.9.5.%2a @@ -171,6 +171,7 @@ Form + Form diff --git a/ISEN-Repair Inventory Manager/Logger.vb b/ISEN-Repair Inventory Manager/Logger.vb new file mode 100644 index 0000000..c081a75 --- /dev/null +++ b/ISEN-Repair Inventory Manager/Logger.vb @@ -0,0 +1,42 @@ +Imports System.IO + +Public Class Logger + 'DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + + Dim logFileName As String = "logs\" & DateTime.Now.ToString("yyyy-MM-dd") & ".txt" + + Shared Sub Load() + If Not My.Computer.FileSystem.DirectoryExists("logs") Then My.Computer.FileSystem.CreateDirectory("logs") + If Not My.Computer.FileSystem.FileExists(logFileName) Then File.WriteAllLines(logFileName, {"LOG FILE - " & DateTime.Now.ToString("dd/MM/yyyy"), "--------------------", "[INFO] Loading software"}) + End Sub + + Sub Info(str As String) + Dim objWriter As New StreamWriter(logFileName, True) + Try + objWriter.WriteLineAsync("[INFO] " & str) + Catch ex As Exception + MsgBox(ex.ToString) + End Try + objWriter.Close() + End Sub + + Sub Warn(str As String) + Dim objWriter As New StreamWriter(logFileName, True) + Try + objWriter.WriteLineAsync("[WARN] " & str) + Catch ex As Exception + MsgBox(ex.ToString) + End Try + objWriter.Close() + End Sub + + Sub Critical(str As String) + Dim objWriter As New StreamWriter(logFileName, True) + Try + objWriter.WriteLineAsync("[CRITICAL] " & str) + Catch ex As Exception + MsgBox(ex.ToString) + End Try + objWriter.Close() + End Sub +End Class diff --git a/ISEN-Repair Inventory Manager/Main.vb b/ISEN-Repair Inventory Manager/Main.vb index bfc2e15..694cab0 100644 --- a/ISEN-Repair Inventory Manager/Main.vb +++ b/ISEN-Repair Inventory Manager/Main.vb @@ -6,6 +6,7 @@ Public Class Main Dim idList As New ArrayList Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Logger.Load() CheckIfFirstRun() ListAllInv() End Sub From b170a860bed06fefa9970aea1dfdede58261d52e Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sat, 8 Jul 2017 17:24:17 +0200 Subject: [PATCH 6/8] Begin implementation of logger in the software --- ISEN-Repair Inventory Manager/Logger.vb | 8 ++++---- ISEN-Repair Inventory Manager/Main.vb | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ISEN-Repair Inventory Manager/Logger.vb b/ISEN-Repair Inventory Manager/Logger.vb index c081a75..652b8b2 100644 --- a/ISEN-Repair Inventory Manager/Logger.vb +++ b/ISEN-Repair Inventory Manager/Logger.vb @@ -5,12 +5,12 @@ Public Class Logger Dim logFileName As String = "logs\" & DateTime.Now.ToString("yyyy-MM-dd") & ".txt" - Shared Sub Load() + Public Sub Load() If Not My.Computer.FileSystem.DirectoryExists("logs") Then My.Computer.FileSystem.CreateDirectory("logs") If Not My.Computer.FileSystem.FileExists(logFileName) Then File.WriteAllLines(logFileName, {"LOG FILE - " & DateTime.Now.ToString("dd/MM/yyyy"), "--------------------", "[INFO] Loading software"}) End Sub - Sub Info(str As String) + Public Sub Info(str As String) Dim objWriter As New StreamWriter(logFileName, True) Try objWriter.WriteLineAsync("[INFO] " & str) @@ -20,7 +20,7 @@ Public Class Logger objWriter.Close() End Sub - Sub Warn(str As String) + Public Sub Warn(str As String) Dim objWriter As New StreamWriter(logFileName, True) Try objWriter.WriteLineAsync("[WARN] " & str) @@ -30,7 +30,7 @@ Public Class Logger objWriter.Close() End Sub - Sub Critical(str As String) + Public Sub Critical(str As String) Dim objWriter As New StreamWriter(logFileName, True) Try objWriter.WriteLineAsync("[CRITICAL] " & str) diff --git a/ISEN-Repair Inventory Manager/Main.vb b/ISEN-Repair Inventory Manager/Main.vb index 694cab0..338da54 100644 --- a/ISEN-Repair Inventory Manager/Main.vb +++ b/ISEN-Repair Inventory Manager/Main.vb @@ -4,9 +4,10 @@ Imports System.Text Public Class Main Dim manualID_selected As Boolean = False Dim idList As New ArrayList + Dim log As New Logger Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load - Logger.Load() + log.Load() CheckIfFirstRun() ListAllInv() End Sub @@ -15,8 +16,9 @@ Public Class Main ''' Function to check if app is running for the first time ''' Private Sub CheckIfFirstRun() + log.Info("Check and load of database") If Not My.Computer.FileSystem.FileExists("db.sqlite") Then - If MsgBox("La base de données SQLite est introuvable ou inaccesible, souhaitez-vous la régénérer ?", 4161, "Base SQLite absente ou inacessible") = 1 Then + If MsgBox("La base de données SQLite est introuvable ou inaccessible, souhaitez-vous la régénérer ?", 4161, "Base SQLite absente ou inaccessible") = 1 Then RegenerateDB() Else End @@ -107,6 +109,7 @@ Public Class Main ''' Construct the basic structure of SQLite DB ''' Private Sub RegenerateDB() + log.Warn("Reconstruct database...") Dim genesis_seq As String = " CREATE TABLE `computers_desc` ( `id` TEXT NOT NULL DEFAULT 0000000000 UNIQUE, From ebd37c68f2e2cd36550da97950526c494b6fcada Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sat, 8 Jul 2017 17:27:01 +0200 Subject: [PATCH 7/8] Added time support to logger, continu to add log function to software --- ISEN-Repair Inventory Manager/Logger.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ISEN-Repair Inventory Manager/Logger.vb b/ISEN-Repair Inventory Manager/Logger.vb index 652b8b2..5d406fe 100644 --- a/ISEN-Repair Inventory Manager/Logger.vb +++ b/ISEN-Repair Inventory Manager/Logger.vb @@ -13,7 +13,7 @@ Public Class Logger Public Sub Info(str As String) Dim objWriter As New StreamWriter(logFileName, True) Try - objWriter.WriteLineAsync("[INFO] " & str) + objWriter.WriteLineAsync("[" & DateTime.Now.ToString("HH:mm:ss") & "][INFO] " & str) Catch ex As Exception MsgBox(ex.ToString) End Try @@ -23,7 +23,7 @@ Public Class Logger Public Sub Warn(str As String) Dim objWriter As New StreamWriter(logFileName, True) Try - objWriter.WriteLineAsync("[WARN] " & str) + objWriter.WriteLineAsync("[" & DateTime.Now.ToString("HH:mm:ss") & "][WARN] " & str) Catch ex As Exception MsgBox(ex.ToString) End Try @@ -33,7 +33,7 @@ Public Class Logger Public Sub Critical(str As String) Dim objWriter As New StreamWriter(logFileName, True) Try - objWriter.WriteLineAsync("[CRITICAL] " & str) + objWriter.WriteLineAsync("[" & DateTime.Now.ToString("HH:mm:ss") & "][CRITICAL] " & str) Catch ex As Exception MsgBox(ex.ToString) End Try From f9fc973a525b85bcf3035b0a26582e4a7602649e Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sat, 8 Jul 2017 17:47:27 +0200 Subject: [PATCH 8/8] Finished add log functions to software --- ISEN-Repair Inventory Manager/AddMachine.vb | 1 + .../EditSpecs.Designer.vb | 20 +++++++++---------- ISEN-Repair Inventory Manager/EditSpecs.vb | 7 ++++--- ISEN-Repair Inventory Manager/Logger.vb | 2 +- ISEN-Repair Inventory Manager/Main.vb | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ISEN-Repair Inventory Manager/AddMachine.vb b/ISEN-Repair Inventory Manager/AddMachine.vb index e3b18d5..bda5c5a 100644 --- a/ISEN-Repair Inventory Manager/AddMachine.vb +++ b/ISEN-Repair Inventory Manager/AddMachine.vb @@ -39,6 +39,7 @@ Public Class AddMachine If cmd.ExecuteNonQuery() <> 1 Then MsgBox("Erreur inconnue au niveau de la base de données !", 16, "Defaillance générale !") : End con.Close() End Using + Main.log.Info("Computer " & NewIDBox.Text & " added") Main.StatusLabel.Text = "Ordinateur ajouté avec succés dans la base de données." Main.ListAllInv() Me.Close() diff --git a/ISEN-Repair Inventory Manager/EditSpecs.Designer.vb b/ISEN-Repair Inventory Manager/EditSpecs.Designer.vb index 1d727ae..2eaee28 100644 --- a/ISEN-Repair Inventory Manager/EditSpecs.Designer.vb +++ b/ISEN-Repair Inventory Manager/EditSpecs.Designer.vb @@ -34,7 +34,7 @@ Partial Class EditSpecs Me.OSCheck = New System.Windows.Forms.CheckBox() Me.HWCheck = New System.Windows.Forms.CheckBox() Me.GroupBox2 = New System.Windows.Forms.GroupBox() - Me.NewIDBox = New System.Windows.Forms.TextBox() + Me.IDBox = New System.Windows.Forms.TextBox() Me.GivedByBox = New System.Windows.Forms.TextBox() Me.Label8 = New System.Windows.Forms.Label() Me.EtatBox = New System.Windows.Forms.TextBox() @@ -168,7 +168,7 @@ Partial Class EditSpecs ' 'GroupBox2 ' - Me.GroupBox2.Controls.Add(Me.NewIDBox) + Me.GroupBox2.Controls.Add(Me.IDBox) Me.GroupBox2.Controls.Add(Me.GivedByBox) Me.GroupBox2.Controls.Add(Me.Label8) Me.GroupBox2.Controls.Add(Me.EtatBox) @@ -188,14 +188,14 @@ Partial Class EditSpecs Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "Information et détails" ' - 'NewIDBox + 'IDBox ' - Me.NewIDBox.Location = New System.Drawing.Point(37, 16) - Me.NewIDBox.Name = "NewIDBox" - Me.NewIDBox.ReadOnly = True - Me.NewIDBox.Size = New System.Drawing.Size(79, 20) - Me.NewIDBox.TabIndex = 17 - Me.NewIDBox.TabStop = False + Me.IDBox.Location = New System.Drawing.Point(37, 16) + Me.IDBox.Name = "IDBox" + Me.IDBox.ReadOnly = True + Me.IDBox.Size = New System.Drawing.Size(79, 20) + Me.IDBox.TabIndex = 17 + Me.IDBox.TabStop = False ' 'GivedByBox ' @@ -361,7 +361,7 @@ Partial Class EditSpecs Friend WithEvents Label4 As Label Friend WithEvents Label2 As Label Friend WithEvents Label1 As Label - Friend WithEvents NewIDBox As TextBox + Friend WithEvents IDBox As TextBox Friend WithEvents RAMCmbBox As ComboBox Friend WithEvents ProcArchCmbBox As ComboBox Friend WithEvents OSCmbBox As ComboBox diff --git a/ISEN-Repair Inventory Manager/EditSpecs.vb b/ISEN-Repair Inventory Manager/EditSpecs.vb index ad9f77e..b676e60 100644 --- a/ISEN-Repair Inventory Manager/EditSpecs.vb +++ b/ISEN-Repair Inventory Manager/EditSpecs.vb @@ -8,7 +8,7 @@ Public Class EditSpecs InitializeComponent() ' Ajoutez une initialisation quelconque après l'appel InitializeComponent(). - NewIDBox.Text = id + IDBox.Text = id NameBox.Text = name EtatBox.Text = stat GivedByBox.Text = givedBy @@ -68,13 +68,14 @@ Public Class EditSpecs Using con As New SQLiteConnection("URI=file:db.sqlite") con.Open() Dim cmd As New SQLiteCommand(con) - cmd.CommandText = "UPDATE `computers_desc` SET `giveTo`='" & EmprunterName.Text & "', `gived`=" & BooleanToNumeric(EmpruntCheckBox.Checked) & " WHERE id='" & NewIDBox.Text & "';" + cmd.CommandText = "UPDATE `computers_desc` SET `giveTo`='" & EmprunterName.Text & "', `gived`=" & BooleanToNumeric(EmpruntCheckBox.Checked) & " WHERE id='" & IDBox.Text & "';" If cmd.ExecuteNonQuery() <> 1 Then MsgBox("Erreur inconnue au niveau de la base de données !", 16, "Defaillance générale !") : End - cmd.CommandText = "UPDATE `computers_progress` SET `hardware_complete`=" & BooleanToNumeric(HWCheck.Checked) & ", `os_complete`=" & BooleanToNumeric(OSCheck.Checked) & ", `drivers_complete`=" & BooleanToNumeric(DrvCheck.Checked) & ", `activate_complete`=" & BooleanToNumeric(ActivateCheck.Checked) & ", `soft_complete`=" & BooleanToNumeric(SoftCheck.Checked) & ", `arch`=" & (ProcArchCmbBox.SelectedIndex + 1) & ", `ram`=" & (RAMCmbBox.SelectedIndex + 1) & ", `os`=" & (OSCmbBox.SelectedIndex + 1) & " WHERE id='" & NewIDBox.Text & "';" + cmd.CommandText = "UPDATE `computers_progress` SET `hardware_complete`=" & BooleanToNumeric(HWCheck.Checked) & ", `os_complete`=" & BooleanToNumeric(OSCheck.Checked) & ", `drivers_complete`=" & BooleanToNumeric(DrvCheck.Checked) & ", `activate_complete`=" & BooleanToNumeric(ActivateCheck.Checked) & ", `soft_complete`=" & BooleanToNumeric(SoftCheck.Checked) & ", `arch`=" & (ProcArchCmbBox.SelectedIndex + 1) & ", `ram`=" & (RAMCmbBox.SelectedIndex + 1) & ", `os`=" & (OSCmbBox.SelectedIndex + 1) & " WHERE id='" & IDBox.Text & "';" If cmd.ExecuteNonQuery() <> 1 Then MsgBox("Erreur inconnue au niveau de la base de données !", 16, "Defaillance générale !") : End con.Close() End Using Main.StatusLabel.Text = "Ordinateur enregistré avec succès !" + Main.log.Info("Edited computer " & IDBox.Text) Catch ex As Exception Main.StatusLabel.Text = "Une erreur avec la base SQLite s'est produite !" MsgBox(ex.Message) diff --git a/ISEN-Repair Inventory Manager/Logger.vb b/ISEN-Repair Inventory Manager/Logger.vb index 5d406fe..a3eefa2 100644 --- a/ISEN-Repair Inventory Manager/Logger.vb +++ b/ISEN-Repair Inventory Manager/Logger.vb @@ -7,7 +7,7 @@ Public Class Logger Public Sub Load() If Not My.Computer.FileSystem.DirectoryExists("logs") Then My.Computer.FileSystem.CreateDirectory("logs") - If Not My.Computer.FileSystem.FileExists(logFileName) Then File.WriteAllLines(logFileName, {"LOG FILE - " & DateTime.Now.ToString("dd/MM/yyyy"), "--------------------", "[INFO] Loading software"}) + If Not My.Computer.FileSystem.FileExists(logFileName) Then File.WriteAllLines(logFileName, {"LOG FILE - " & DateTime.Now.ToString("dd/MM/yyyy"), "--------------------", "[" & DateTime.Now.ToString("HH:mm:ss") & "][INFO] Loading software"}) End Sub Public Sub Info(str As String) diff --git a/ISEN-Repair Inventory Manager/Main.vb b/ISEN-Repair Inventory Manager/Main.vb index 338da54..61f7d31 100644 --- a/ISEN-Repair Inventory Manager/Main.vb +++ b/ISEN-Repair Inventory Manager/Main.vb @@ -4,7 +4,7 @@ Imports System.Text Public Class Main Dim manualID_selected As Boolean = False Dim idList As New ArrayList - Dim log As New Logger + Public log As New Logger Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load log.Load()